← Back to section · Research Resources

Formally Verified Code: Where HACL*, Jasmin, and Proven Implementations Live

Some cryptographic code comes not only with tests but with mathematical proofs. This guide maps verification-oriented projects such as HACL*, libjade, Fiat Cryptography, and s2n-bignum, and explains how to read the scope of a verification claim.

Published 22 November 2026 · 5 min read · PQ Frontier

Formally Verified Code: Where HACL*, Jasmin, and Proven Implementations Live
AI-generated site artwork
Video explainer · Open Source Code Index: from repositories to trusted code

Why cryptographic code needs proofs

Test vectors can only show that an implementation behaves correctly on a selected set of inputs; they cannot exhaust all inputs, and they cannot prove properties that never appear in the output, such as memory safety or constant-time behavior. Formal verification takes the other road: state the desired property as a mathematical proposition and construct a machine-checkable proof with dedicated tooling, so correctness no longer depends on the luck of test coverage. For cryptographic code, such high-assurance implementations have a double value: they are more trustworthy components in engineering terms, and they are the best teaching material for understanding what details a rigorous implementation of an algorithm actually has to handle. This guide maps the main project shapes in this ecosystem, with emphasis on how to read their verification claims.

The main projects and their routes

HACL* is among the most representative projects: it writes cryptographic implementations in the F* language, verifies them, and generates readable C code through its toolchain, and its results have been adopted by mainstream software. Its coverage is centered on classical algorithms and is gradually extending to post-quantum ones; its sister effort EverCrypt packages verified implementations from multiple sources into a single verified cryptographic library. For researchers, the value of the HACL* repository lies not only in the code but in how it shows specification, implementation, and proof organized in one place.

Jasmin and libjade take the assembly-level route. Jasmin is a low-level language designed for cryptographic implementations whose compiler produces assembly, and whose accompanying verification framework can prove functional correctness, memory safety, and constant-time behavior; libjade is an algorithm library written with this toolchain. High-performance implementations of lattice cryptography — the number theoretic transform components inside them, for instance — are a focus of this route, because such code is performance-critical, often hand-written in assembly, and the most prone to hiding bugs.

A third category is dedicated projects that “prove only one layer”. Fiat Cryptography specializes in generating and proving bignum arithmetic code, and its output has been adopted by several mainstream TLS libraries; s2n-bignum provides proven assembly-level bignum routines. They are a reminder that verification can be very fine-grained: a project may well be responsible for a single data path, and “one layer is verified” must never be inflated into “the whole implementation is verified” when citing it.

On the post-quantum side, beyond the projects above gradually extending their algorithm coverage, verification-oriented implementation work aimed at ML-KEM has appeared: some efforts take memory safety and type safety as their proof goals (using model-checking tools to prove properties of C code), while others bring constant-time behavior into the verified scope. Such projects typically list explicitly, in the repository, which properties have been proven and which parts remain uncovered — the primary material for judging their maturity.

How to read a verification claim

The credibility of a verification claim rests on the answers to four questions, and researchers should locate each answer in the project documentation before citing it. First, which property was proven: functional correctness (against which specification), memory safety, and constant-time behavior are different propositions, and a project proving only one of them must not be described as “fully verified”. Second, where the specification itself comes from: functional correctness is relative to a formal specification, and if that specification disagrees with the official standard text, an impeccable proof proves the wrong object. Third, what the trusted computing base includes: which parts of the proof tools, compiler, specification, and hardware model are assumed correct rather than proven — rigorous projects say this out loud. Fourth, whether the proofs ship with the code and can be re-run: a project that puts proof scripts in the repository and re-verifies them in continuous integration carries far more weight than one whose claims live only in a paper.

Also distinguish “verified code” from “code extracted from a verification”: some routes develop inside a proof environment and then mechanically generate C or assembly, with the toolchain guaranteeing agreement between the artifact and the proven object; other routes prove properties of existing C code directly. The former is methodologically cleaner, the latter applies more broadly, and both are used in practice — when reading documentation, simply note which kind you are dealing with, without favoring either.

How researchers can use this code

Even without any intention of writing proofs yourself, verified codebases have three practical uses. First, as a reference point for implementations: when an ordinary implementation of an algorithm disagrees with the standard text, a verified implementation — precisely because it carries a formal specification — often gives the clearest ruling. Second, as an encyclopedia of details: the verification process forces authors to handle every boundary case — parameter validation, failure paths, memory zeroization, overflow — and the places ordinary implementations gloss over must be written out explicitly in verified code; reading those parts yields the most. Third, as a high-assurance baseline for reproducing experiments: in cryptanalysis or protocol experiments, using a verified implementation as the control group separates “the phenomenon comes from the algorithm” from “it comes from an implementation defect”, which matters especially when checking contested results.

As for a reading order: start with the generated artifacts (generated C code looks like any ordinary implementation), then go back to the specification files, and only then touch the proof scripts; diving straight into proof details is the most common way beginners get discouraged.

Notes on consulting and using it

Version management for verified projects needs extra care: code updated without its proofs being updated in step is not rare in research repositories, so when citing, confirm the target version carries complete proof artifacts. Keep performance expectations realistic too: verified implementations are usually fast, but their first goal is the assured property, and for individual algorithms they may not be the fastest implementation available — rank your selection criteria by need. Finally, check licenses and upstream relationships: many verified implementations are vendored wholesale into other libraries, and the same code may appear at different versions in different repositories; tracing the original source is the only way to find the proof files.

Tags: formal verificationHACL*Jasminhigh-assurance implementations