Verified Garbage is an experimental cryptography library that tries to reconcile assembly-level speed with strong guarantees of correctness and security. Its developers write algorithm specifications and CPU instruction-set models in Lean, then implement each algorithm in assembly for each supported architecture. Formal proofs establish that the assembly matches the specified algorithm, is well-defined, and meets a constant-time standard: secret inputs must not affect instruction traces or data-dependent timing. The library covers the cryptographic algorithms used by pyca/cryptography and supports x86, x86-64, ARMv7, ARM64, PPC64le, and RISC-V 64-bit systems.
Large language models generated much of the assembly and helped optimize it; the authors argue that formal verification lets them explore complex performance improvements while checking the resulting code. Benchmarks compare representative algorithms with OpenSSL and AWS-LC on an AMD Ryzen 9 9950X and Apple M1 Max, and use rustls tests to assess TLS handshakes and bulk data. The developers report strong performance, but provide no numerical results in the supplied text, and note that results depend on hardware. Their confidence has an important boundary: the algorithm and instruction-set specifications are the trusted foundation, and those LLM-written specifications require human review. The project remains an experiment, not a proposed replacement for OpenSSL in pyca/cryptography. Future work includes broader optimization and strengthening trust in the specifications, possibly through community-written versions.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.