0
0
mirror of https://github.com/signalapp/libsignal.git synced 2024-09-20 20:03:07 +02:00
Home to the Signal Protocol as well as other cryptographic primitives which make Signal possible.
Go to file
2021-05-18 15:56:15 -07:00
.github GitHub: "Publish to NPM" action should always check out the same ref 2021-05-18 15:56:15 -07:00
bin Add a bloaty source that estimates code size contributions of crates 2021-03-16 15:38:44 -07:00
java Revert "Add registration IDs to the Sealed Sender v2 upload (encrypt) format" (#303) 2021-05-17 10:03:49 -07:00
node Revert "Add registration IDs to the Sealed Sender v2 upload (encrypt) format" (#303) 2021-05-17 10:03:49 -07:00
rust Merge pull request #305 from signalapp/jrose/SSv2-registration-id-placeholders 2021-05-18 15:16:41 -07:00
swift Merge pull request #286 from cosmicexplorer/docs-1 2021-05-17 17:20:20 -07:00
.clippy.toml Fix clippy warnings 2020-07-30 13:49:20 -04:00
.dockerignore Move makefile and docker file into java subdir 2020-11-06 16:40:54 -05:00
.flake8 Add flake8 for checking our Python scripts 2020-11-30 11:02:57 -08:00
.gitignore Node: allow Rust async blocks to wait on JavaScript futures 2021-02-04 10:22:58 -08:00
.nvmrc Bump node to match Signal-Desktop next-beta 2021-01-28 18:23:21 -05:00
.prettierignore Node: use 'Native' to refer to the loaded Rust library 2021-03-12 12:57:10 -08:00
.prettierrc.js Switch ESLint configuration to more closely match Signal-Desktop 2020-11-11 11:06:05 -08:00
.rustfmt.license-template Switch to AGPL 3.0 2020-11-02 17:53:10 -05:00
.rustfmt.toml Switch to AGPL 3.0 2020-11-02 17:53:10 -05:00
binding.gyp Add Node multi-arch support 2021-02-13 01:45:37 +01:00
Cargo.lock rust/crypto: bump libc to support getauxval on musl 2021-05-02 13:29:41 -04:00
Cargo.toml Move AES-GCM-SIV implementation into rust/crypto 2021-03-15 13:33:33 -04:00
LICENSE Switch to AGPL 3.0 2020-11-02 17:53:10 -05:00
package.json Bump version to 0.5.1 2021-04-28 17:05:25 -07:00
README.md Fill out README.md a little further 2021-03-25 18:03:03 -07:00
rust-toolchain Pin nightly to a specific date 2020-11-09 15:39:29 -05:00
SECURITY.md Add SECURITY.md so that GitHub can display it 2021-03-25 18:03:22 -07:00
SignalClient.podspec Bump version to 0.5.1 2021-04-28 17:05:25 -07:00
yarn.lock Node: use prebuildify to handle package prebuilding 2021-04-28 10:50:27 -07:00

Overview

libsignal-client contains platform-agnostic APIs useful for Signal client apps, exposed as a Java, Swift, or TypeScript library. The underlying implementations are written in Rust:

  • libsignal-protocol: Implements the Signal protocol, including the Double Ratchet algorithm. A replacement for libsignal-protocol-java and libsignal-metadata-java.
  • signal-crypto: Cryptographic primitives such as AES-GCM-SIV. We use RustCrypto's where we can but sometimes have differing needs.
  • device-transfer: Support logic for Signal's device-to-device transfer feature.
  • poksho: Utilities for implementing zero-knowledge proofs; stands for "proof-of-knowledge, stateful-hash-object". See zkgroup.

This repository is used by the Signal client apps (Android, iOS, and Desktop). Use outside of Signal is unsupported. In particular, the products of this repository are the Java, Swift, and TypeScript libraries that wrap the underlying Rust implementations. Those underlying implementations are subject to change without notice, as are the JNI, C, and Node add-on "bridge" layers.

Building

To build anything in this repository you must have Rust installed. The build currently uses a specific version of the Rust nightly compiler, which will be downloaded automatically by cargo. To build and test the basic protocol libraries:

$ cargo build
...
$ cargo test
...

Java/Android

To build for Android you must install several additional packages including a JDK, the Android NDK/SDK, and add the Android targets to the Rust compiler, using

rustup target add armv7-linux-androideabi aarch64-linux-android i686-linux-android x86_64-linux-android

as well as the Cargo NDK tool using

cargo install --version=1.0.0 cargo-ndk

To build the Java/Android jar and aar, and run the tests:

$ cd java
$ ./gradlew test

Alternately, a build system using Docker is available:

$ cd java
$ make java_test

Local Java testing is also supported with gradlew test if none of the ANDROID_* environment variables are set.

When exposing new APIs to Java, you will need to run rust/bridge/jni/bin/gen_java_decl.py in addition to rebuilding.

Swift

To learn about the Swift build process see swift/README.md

Node

You'll need Node installed to build. If you have nvm, you can run nvm use to select an appropriate version automatically.

We use yarn as our package manager. The Rust library will automatically be built when you run yarn install.

$ nvm use
$ yarn install
$ yarn tsc
$ yarn test

When testing changes locally, you can use yarn build to do an incremental rebuild of the Rust library.

When exposing new APIs to Node, you will need to run rust/bridge/node/bin/gen_ts_decl.py in addition to rebuilding.

Contributions

Signal does accept external contributions to this project. However unless the change is simple and easily understood, for example fixing a bug or portability issue, adding a new test, or improving performance, first open an issue to discuss your intended change as not all changes can be accepted.

Contributions that will not be used directly by one of Signal's official client apps may still be considered, but only if they do not pose an undue maintenance burden or conflict with the goals of the project.

Signing a CLA (Contributor License Agreement) is required for all contributions.

Legal things

Cryptography Notice

This distribution includes cryptographic software. The country in which you currently reside may have restrictions on the import, possession, use, and/or re-export to another country, of encryption software. BEFORE using any encryption software, please check your country's laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this is permitted. See http://www.wassenaar.org/ for more information.

The U.S. Government Department of Commerce, Bureau of Industry and Security (BIS), has classified this software as Export Commodity Control Number (ECCN) 5D002.C.1, which includes information security software using or performing cryptographic functions with asymmetric algorithms. The form and manner of this distribution makes it eligible for export under the License Exception ENC Technology Software Unrestricted (TSU) exception (see the BIS Export Administration Regulations, Section 740.13) for both object code and source code.

License

Copyright 2020-2021 Signal Messenger, LLC

Licensed under the AGPLv3: https://www.gnu.org/licenses/agpl-3.0.html