The crates in this directory compile and wrap code of Signal's libsignal, so that the generated
AArch64 machine code can be verified in Lean. This file records what comes from
libsignal, from where, and under which license.
| Project | signalapp/libsignal |
| Version | tag v0.105.4, commit b2a5c30f3245c1bcad04b27b1e752a38321c793d |
| Copyright | Copyright 2020-2026 Signal Messenger, LLC. |
| License | AGPL-3.0-only; full text in LICENSE, copied from the upstream LICENSE at that commit |
Important
No upstream checkout and no compiler output is committed in this repository. Every
libsignal-*/vendor/ (a symlink to a libsignal checkout), every target/ and .GeneratedLean/
(the AArch64 machine code compiled from these crates and the upstream sources) are gitignored
build products, regenerated locally by lake build. The libsignal material that is committed
is listed item by item below.
| Directory | What it is | Copied upstream code |
|---|---|---|
libsignal-session/ |
wrappers and the libsignal-cli CLI around the 1:1 session API (src/, cli/), plus untrusted tooling (tools/, tests/) |
none in the wrappers; see item 2 for tools/ |
bug-injection/ |
known, upstream-fixed libsignal bugs as patches, with the registry, witness inputs and replayer of the bug-injection framework (Symbolic/BugInjection/README.md); not part of any image |
the patches: see item 3 |
test-vectors/ |
Lean data module (lean_lib LibsignalTestVectors) holding test vectors of libsignal's own tests, imported by Lean tests under Computational/Tests/ |
the vectors: see item 4 |
Each file states its license in its header comment: portions copied from libsignal keep Signal
Messenger's copyright and SPDX-License-Identifier: AGPL-3.0-only, and the Google-authored code
is Copyright 2026 Google LLC under Apache-2.0. Files without a header comment (the
Cargo.toml, translation.toml, events.toml and cli-elf/ .toml/.lock/.ld configuration files
and the README.md files) are Google-authored. A few files in libsignal-session/cli-elf/ contain
code from other projects and say so in their header: rdl_shim.S and stock/rdl_shim.S (Rust standard library 1.98.1,
Copyright (c) The Rust Project Contributors, MIT OR Apache-2.0), string-include/features.h
and string-include/string.h (musl 1.2.5, Copyright © 2005-2020 Rich Felker, et al., MIT),
and the generated signal_session_io.S, which is compiled from the Google-authored cli/io crate
and contains inlined Rust core/alloc code (MIT OR Apache-2.0). The Cargo.lock files are generated by Cargo; they name upstream crate
versions and checksums and contain no upstream code.
The headers of the verified crate (libsignal-session incl. cli/) must keep their
line counts: the source line of every panic site is compiled into the verified machine code.
libsignal-session depends on libsignal v0.105.4 (b2a5c30) through path dependencies on
vendor/libsignal, a gitignored symlink to a libsignal checkout that rust-obj2lean resolves or
fetches at build time ([upstream] in the crate's translation.toml: $LIBSIGNAL_SRC,
~/sw/libsignal, or a shallow clone of tag v0.105.4).
The AArch64 machine code that lake build generates from libsignal-session/translation.toml into
the gitignored .GeneratedLean/GeneratedLean/ (every Libsignal* file: LibsignalSessionObj,
LibsignalSessionPlacedObj, LibsignalSessionCode, LibsignalSession*, LibsignalTripleRatchet*)
is compiled from AGPL-3.0-only source and is a derived work of libsignal; the separately translated
I/O crate libsignal-session/cli/io/translation.toml (SignalSessionIoObj,
SignalSessionIoPlacedObj, SignalSessionIoCode) is compiled from original Google-authored
Apache-2.0 code (libsignal-session/cli/io/src/lib.rs, plus inlined Rust core/alloc and std
re-exports of core/alloc items under MIT OR Apache-2.0, with no std::fs/std::io) and copies no upstream libsignal source. Each generated *Obj /
*PlacedObj module carries the license_header of its translation.toml.
-
libsignal-session/src/lib.rsandlibsignal-session/cli/src/: wrappers and CLI entry points that call libsignal's public API (message_encrypt,message_decrypt_signal,process_prekey_bundle,SignalMessage::try_from, the in-memory stores); the companion CLI process-I/O cratelibsignal-session/cli/io/src/lib.rsuses bounded C-ABImuslsyscalls (open,read,write,close,__errno_location; nostd::fs/std::io; onlystdre-exports ofcoreitems andalloc::vec::Vec) with nolibsignaldependency. None of them copies upstream source. -
libsignal-session/tools/prost-diff/src/main.rs(untrusted differential-fuzz tool):SignalMessage(lines 30-44) is prost-build's output for upstreamrust/protocol/src/proto/wire.proto(Copyright 2020 Signal Messenger, LLC.). -
bug-injection/patches/(inputs of the bug-injection framework,Symbolic/BugInjection/README.md; never compiled into a verified image): each directory holds the diff of an upstream libsignal fix commit, byte-identical tohttps://github.com/signalapp/libsignal/commit/<sha>.diff(upstream-<sha>.diff), and that diff's reversal ported to v0.105.4 (v0.105.4.diff, with a preamble saying so). Both contain libsignal source lines (Copyright 2020-2026 Signal Messenger, LLC.,AGPL-3.0-only, full text inLICENSE). The fix commits are5293caa6cad81566b80f3c3731857bedaa78737bandcd361186fba60c83186262d91b03af608fb8c7c3(listed inbug-injection/bugs.toml). The replayer, registry, witness inputs and README beside them are Google-authored. -
test-vectors/LibsignalTestVectors/ChainKeyDerivation.lean(Lean moduleLibsignalTestVectors.ChainKeyDerivation, libraryLibsignalTestVectorsinlakefile.lean): the four 32-byte vectorsseed,message_key,mac_keyandnext_chain_keyof libsignal's own testtest_chain_key_derivation(rust/protocol/src/ratchet/keys.rs:231-277,Copyright 2020 Signal Messenger, LLC.,AGPL-3.0-only, full text inLICENSE), as hex literals; the file holds nothing else. The Lean testsComputational/Tests/AEAD/HKDFTest.leanandComputational/Tests/Binary/SessionRunTest.leanimport it and contain no copy of the vectors.
Elsewhere, Lean files and Markdown cite libsignal by file and line and describe its behaviour in prose or pseudocode; they do not copy its source.