Verified Garbage: an experimental cryptography library with formally verified assembly
Verified Garbage is an experimental cryptography library. Its authors, who say they have long maintained widely used crypto libraries, write the code in assembly and then formally prove that it is correct and constant-time[1]. The proofs are checked against specifications, written in Lean[2], for algorithms such as AES-GCM and X25519 and for CPU instruction sets. The library covers every algorithm used by pyca/cryptography and runs on x86, x86-64, ARMv7, ARM64, PPC64le and RISCV64.
LLMs wrote the assembly optimizations and the specifications, and humans reviewed the specifications. The specifications form the trusted computing base (TCB[3]), which must be checked by hand, because the proofs only show that the assembly matches them. Benchmarks compare throughput with OpenSSL 4.1.0 as the 1.0 baseline and with AWS-LC 5.12.0 on an AMD Ryzen 9 9950X and an Apple M1 Max.
The library is published as the Rust crate verified-garbage, with a separate rustls provider called rustls-verified-garbage. The authors call the project an experiment and ask potential users what would make it valuable to them.
Read the original verified-garbage.devDiscussion
Sources
-
verified-garbage.dev
Verified Garbage: An experimental formally verified cryptography library



