⏱️ Reading time: 7 min

Verified Garbage is a cryptography library in which no human wrote a single line of assembly: every implementation was generated by a language model, and its correctness is not guaranteed by code review but by a formal proof in Lean (project announcement). Its maintainers say they are also long-term maintainers of cryptography libraries widely used in production, and they present the project as an experiment, not as an immediate replacement for what already runs on servers worldwide (source).

📑 En este artículo
  1. Cryptography Written by Language Models, Proven by Lean
  2. How the Proof Is Built: Specifications, ISAs and Constant Time
  3. What Verified Garbage’s Verified Cryptography Covers: Algorithms and Architectures
  4. What This Means for a Rust Developer Using rustls
  5. Verified Garbage vs. OpenSSL, AWS-LC and graviola
  6. The Point the Announcement Buries: the Trust Base Is Still Human
  7. When Not to Use It Yet
  8. Frequently Asked Questions
    1. Does Verified Garbage Already Replace OpenSSL or AWS-LC in Production?
    2. What Is pyca/cryptography and Why Does It Matter as a Reference?
  9. References

The approach tackles a known problem in cryptography design: choosing between performance, security, verifiability, complexity and cross-platform support usually forces a tradeoff (source). Writing in assembly performs better but complicates code review. Writing in a high-level language avoids buffer overflows but makes it harder to prove that a routine runs in constant time, a basic security requirement in cryptography to avoid side-channel leaks.

Cryptography Written by Language Models, Proven by Lean

The core approach borrows an idea AWS already tested in its s2n-bignum library: write in assembly and mathematically prove that the code meets what matters, that it is correct, well-defined and runs in constant time (source). The difference is scale. Verified Garbage tries to apply that verification to every algorithm, on every processor architecture it supports, and makes it feasible by using LLMs to write and optimize the assembly for each combination.

The authors summarize the logic this way: given a reliable set of formal proofs, a language model can aggressively optimize a routine because every change is validated instantly against the mathematical specification (source). If the proof fails, the change is discarded. If it passes, the assembly can become as sophisticated as needed without risking security, because verification, not human review, certifies the result.

How the Proof Is Built: Specifications, ISAs and Constant Time

The process starts with Lean specifications of concrete cryptographic algorithms, such as AES-GCM or X25519, and with specifications of each processor’s instruction set, modeling what every instruction does (source). On that basis, assembly is written for each algorithm and each architecture, and it is formally proven that the assembly is equivalent to the specification and that it also runs in constant time.

The result is that assembly complexity stops being a risk by itself. An aggressive optimization that a traditional library would require careful manual review for is accepted or rejected here based on whether it passes the formal proof, which runs automatically every time the code changes.

flowchart TD
  A["Lean specification of the algorithm and the instruction set"] --> B["LLM writes the assembly per architecture"]
  B --> C["Formal proof of equivalence and constant time"]
  C -->|"passes"| D["Integrated into the verified-garbage crate"]
  C -->|"fails"| E["Discarded and retried"]
The project covers six CPU architectures: x86, x86-64, ARMv7, ARM64, PPC64le and RISCV64. Foto de Albert Stoynov en Unsplash

What Verified Garbage’s Verified Cryptography Covers: Algorithms and Architectures

The authors claim to include support for every cryptographic algorithm used by pyca/cryptography, the most widely used cryptography library in the Python ecosystem, and to run them on x86, x86-64, ARMv7, ARM64, PPC64le and RISCV64 (source). The published benchmarks include ML-KEM, ML-DSA, ECDH, ECDSA, RSA PKCS#1, RSA PSS, AES-128-GCM, ChaCha20Poly1305, SHA256 and HMAC-SHA256 (source).

There is a fact the announcement itself never highlights in those words: ML-KEM and ML-DSA are the post-quantum algorithms NIST standardized, so their presence alone in the benchmark list confirms the project already covers the post-quantum migration, not just the classical cryptography that dominates the rest of the text. For teams just beginning to plan that migration, it is a signal that the project is worth following even before adopting it.

What This Means for a Rust Developer Using rustls

If you maintain a Rust service that terminates TLS with rustls, the concrete fact is that a dedicated provider already exists to test it: the rustls-verified-garbage crate, installable alongside the base verified-garbage crate via cargo add (crates.io, crates.io). The reasonable move is not to migrate production today, but to spin it up in a staging service or a secondary project and compare how it behaves against the provider you already use, before considering replacing anything critical.

Before vendoring it in any context with compliance requirements, it is worth reviewing the crate’s version history and the notes on which specifications received additional human review, because that is exactly what defines how much trust the library can support at that point.

The rustls provider is distributed as the rustls-verified-garbage crate on crates.io.

Verified Garbage vs. OpenSSL, AWS-LC and graviola

The authors themselves compared its performance against OpenSSL 4.1.0 built from source and against AWS-LC 5.12.0, as distributed in aws-lc-rs 1.19.0, running on an AMD Ryzen 9 9950X with Ubuntu 26.04 pinned to a single core and on an Apple M1 Max with macOS 27 (source). The exact figures for each chart were not published in the available text, so this article does not repeat them; what is verifiable today is the methodology and the scope of the comparison, not a standalone number without the chart that supports it.

ProjectHow It’s WrittenFormal VerificationRust Integration
OpenSSLC, with parts in assemblyNo comprehensive formal verification of the wholeVia the openssl crate (bindings)
AWS-LC (aws-lc-rs)C and assembly, part of it comes from s2n-bignumPartial formal verification, not of the whole libraryNative provider, widely used in rustls
graviolaRust and hand-written assemblyWithout Verified Garbage’s automated verification machineryRust crate, cited as a direct inspiration for the project
Verified GarbageLLM-generated assemblyEnd-to-end formal verification in Lean for every supported ISARust-first, with its own provider for rustls

The important nuance is that AWS-LC already uses s2n-bignum for part of its primitives (source), so the real difference is not verified versus unverified, but how much of the entire library is covered by that verification. graviola, for its part, appears in the announcement itself as one of the project’s sources of inspiration, along with Bobby Powers and venues such as Real World Crypto and the High Assurance Cryptography Software Workshop (source).

The Point the Announcement Buries: the Trust Base Is Still Human

The correctness of the entire library depends on the Lean specifications of each algorithm and each instruction set being correct, because there is no formal proof that validates those: those specifications are the project’s trust base, and they were written by LLMs, with later human review (source). The assembly and the proofs, by contrast, do not need review because formal verification already certifies them.

The authors themselves anticipate the skepticism: they acknowledge that many will doubt a new cryptography library, even more so one built with heavy LLM use, and describe it as an experiment that still needs time and community feedback to mature (source).

When Not to Use It Yet

For regulated or high-risk systems, such as banking, healthcare or critical infrastructure, it makes sense to wait for an independent external audit before relying on it in production. The announcement only describes packaging for Rust, via cargo add verified-garbage and the rustls provider, so if your stack is not Rust you will have to wait or wrap it yourself.

The lack of track record also matters: a library announced just now, without years of real-world use, does not yet have the same trust cushion that decades of patches and audits gave OpenSSL. Teams that have no way to review the Lean specifications on their own also cannot audit the most fragile point of the design, which is exactly that trust base.

📬 Get new articles by email

We only email about big articles (1-2 a month).

Frequently Asked Questions

Does Verified Garbage Already Replace OpenSSL or AWS-LC in Production?

Not according to its own creators, who describe it as an experiment that still benefits from time and feedback before being considered a mature alternative (source).

What Is pyca/cryptography and Why Does It Matter as a Reference?

It is the most widely used cryptography library in the Python ecosystem. Verified Garbage’s claim to cover all of its algorithms works as a concrete measure of how complete its coverage is for the typical needs of a web backend (source).

References

Featured image: Foto de Mohamed Marey en Unsplash

How each article is made (sources, testing and editorial criteria): How we work.

Did it work for you? Got a different error? Say so below: questions get answered and help the next reader.

Leave a comment
Categories: SecurityTutorials

El Solitario Editorial

Article prepared by the El Solitario editorial team from cited sources, under the editorial responsibility of Luis Navarro. More details in "How we work".

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

You can include code inside <code>…</code> or, for several lines, <pre><code>…</code></pre>.

This site uses Akismet to reduce spam. Learn how your comment data is processed.