Toolchain verifies x86-64, AArch64

s2n-bignum

Also known as s2n-bignum HOL Light framework

Prove hand-written x86-64 or Arm64 assembly correct in HOL Light, on the exact bytes of the built object file; used for AWS's cryptography code.

Stage 1 · Usable Interactive Open source · Apache-2.0 OR ISC OR MIT-0 Last commit · today
Trust: Checker strong, Semantics partial, Frontend strong, Binary gap strong, Escape hatches strong CheckerSemanticsFrontendBinary gapEscape hatches 4 of 5 strong

Use it if

  • You write performance-critical assembly (for example cryptography) and need proofs about the object code that actually ships.
  • You also need constant-time, memory-safety or equivalence proofs (for example after vectorizing or reordering code).

Look elsewhere if

  • Your code uses system instructions, interrupts, floating point or threads; the machine models are user-mode, integer/SIMD and single-core.
  • You want push-button checking; proofs are written by hand in HOL Light with tactic support.

How it works

From your code to an accepted proof. Each step either has to be trusted or is checked by something else.

  1. Input
    x86-64 / AArch64 code
  2. Front end
    OCaml ELF loader (reads the .text bytes of the built object file) Trusted The soundness review notes a loader error would usually make the proof fail rather than pass wrongly.
  3. Semantics
    s2n-bignum x86-64 model (hand-written in HOL Light) Validated Instructions are added as needed; tested by random co-simulation against real hardware in CI.
  4. Semantics
    s2n-bignum AArch64 model (hand-written in HOL Light) Validated Instructions are added as needed; tested by random co-simulation in CI. A partial RV32IM RISC-V model was added in September 2026, with tutorial examples only.
  5. Translation
    Symbolic simulation tactics in HOL Light Checked
  6. Checker
  7. Compiler
    Assembler (GNU as via gcc or another) Validated Each proof checks its byte sequence against the object file from the build. Projects that reassemble the .S files elsewhere do not get this check.

Verified or checked: outside the trusted base Validated per run or by tests Trusted without proof

  • x86-64: Library routines for bignums, elliptic curves, ML-KEM, ML-DSA and SHA-3; some need the BMI and ADX extensions (MULX, ADCX, ADOX).
  • AArch64: Library routines for bignums, elliptic curves, ML-KEM, ML-DSA, SHA-3, AES-XTS and AES-GCM; some need crypto extensions.

Trust

What a proof from this toolchain relies on: the trusted computing baseTrusted computing base (TCB). Everything that must be correct for a proof to mean what it says., one part at a time. How these are rated.

  1. Checker What has the final word on a proof?
    Strong

    The HOL Light kernel (about 400 lines of OCaml) checks every proof.

    OCaml's compiler and runtime are also trusted. Independent re-checking is possible in principle (Candle, HOLTrace) but not part of the build.

    source

  2. Semantics Is the tool's model of the language the real language?
    Partial

    Hand-written instruction models; random co-simulation against real CPUs in CI.

    Models are written from the Intel/AMD and Arm manuals, not taken from an official model. CI compares random instruction encodings and states against an independent backend (hardware, an emulator or another model); we found no published report of these results.

    source

  3. Frontend How does your source get into the model?
    Strong

    The proved bytes are checked against the object file produced by the build.

    source

  4. Binary gap Does the proof cover what actually runs?
    Strong

    Proofs are about the object code; the assembler is not trusted.

    Downstream projects that reassemble the .S files on another system are not checked against the proved bytes.

    source

  5. Escape hatches Can a proof silently rest on unchecked assumptions?
    Strong

    Every proof build runs check_axioms, which fails if any extra axiom was added.

    source

What it can prove

Kinds of guarantees, not how easy they are to get.

Properties
FeatureSupportNotes
No undefined behavior Memory safety and absence of runtime errors: no out-of-bounds access, use-after-free, overflow traps, panics or undefined behavior on any input allowed by the precondition. PartialPartial.Memory-safety proofs (all accesses inside the declared buffers) exist for the functions AWS-LC uses, not yet for the whole library. They do not check accesses below the stack pointer, and the memory model has no unmapped pages, so the caller must pass mapped memory.
Source
Memory-safety proofs (all accesses inside the declared buffers) exist for the functions AWS-LC uses, not yet for the whole library. They do not check accesses below the stack pointer, and the memory model has no unmapped pages, so the caller must pass mapped memory. source
Functional correctness The code meets a written specification of its results, for example “returns the sorted list” or “implements this RFC”. SupportedSupported.Each function has a HOL Light theorem that the code computes a mathematical specification for all inputs.
Source
Each function has a HOL Light theorem that the code computes a mathematical specification for all inputs. source
Equivalence Two programs (an optimized and a reference version, or code before and after a change) are proved to behave the same, or one refines the other. SupportedSupported.A relational Hoare logic (CAV 2025) is used to prove optimized code (NEON vectorization, SLOTHY reordering) equivalent to a reference version.
Source
A relational Hoare logic (CAV 2025) is used to prove optimized code (NEON vectorization, SLOTHY reordering) equivalent to a reference version. source
Information flow Secrets do not influence public outputs, timing or memory access patterns (constant-time code, non-interference). SupportedSupported.Since late 2025, constant-time proofs show the instruction sequence and memory addresses do not depend on secrets and no variable-time instructions are used; done for the functions AWS-LC uses. They cannot rule out timing differences inside the hardware.
Source
Since late 2025, constant-time proofs show the instruction sequence and memory addresses do not depend on secrets and no variable-time instructions are used; done for the functions AWS-LC uses. They cannot rule out timing differences inside the hardware. source
Concurrency Correctness of code with threads or shared memory: absence of data races, deadlock freedom, linearizability of concurrent data structures. Not supportedNot supported.The machine model is sequential and single-core.
Source
The machine model is sequential and single-core. source
Termination and liveness Every run finishes, or the system keeps making progress (liveness). SupportedSupported.Specifications state that execution eventually reaches the postcondition (total correctness).
Source
Specifications state that execution eventually reaches the postcondition (total correctness). source

Language coverage

Which parts of x86-64 and AArch64 it handles. Hover or focus a mark for details.

ISA-level features

ISA-level features
FeatureSupportNotes
User-level instructions The ordinary integer, memory and branch instructions programs use. PartialPartial.Only the user-mode integer, load/store and branch instructions needed so far are modeled ("modeled by need").
Source
Only the user-mode integer, load/store and branch instructions needed so far are modeled ("modeled by need"). source
Floating-point instructions Scalar floating-point instructions. Not supportedNot supported.No floating-point arithmetic; on Arm only register moves such as FMOV and FCSEL are modeled.
Source
No floating-point arithmetic; on Arm only register moves such as FMOV and FCSEL are modeled. source
Vector / SIMD instructions Vector and SIMD extensions. PartialPartial.A subset of Arm NEON (including AES, SHA-3 and polynomial-multiply instructions) and of x86 SSE/AVX, added as needed.
Source
A subset of Arm NEON (including AES, SHA-3 and polynomial-multiply instructions) and of x86 SSE/AVX, added as needed. source
Privileged mode Privilege levels, control registers, traps and exceptions. Not supportedNot supported.No system registers, privilege levels, interrupts or exceptions.
Source
No system registers, privilege levels, interrupts or exceptions. source
Virtual memory Page tables and address translation. Not supportedNot supported.Flat address space; no page tables or page faults.
Source
Flat address space; no page tables or page faults. source
Concurrency memory model The multiprocessor memory model (for example x86-TSO, Arm, RVWMO). Not supportedNot supported.No caches, memory ordering or multiple cores.
Source
No caches, memory ordering or multiple cores. source

Stage

Computed from the evidence below; see the criteria. 1criterion is missing for Stage 2.

Stage 0 Research Met
  • Met: Publicly available evidence
  • Met: At least one published verification uses it Relational Hoare Logic for Realistically Modelled Machine Code (CAV 2025), demonstrated on s2n-bignum. evidence
Stage 1 Usable Met
  • Met: Released or updated in the last 12 months Latest release: main@3ab28d2, 2026-11-26. evidence
  • Met: Installs and runs on current platforms CI on main passes (checked 2026-11-26); proofs need a recent HOL Light from GitHub. evidence
  • Met: User documentation or tutorial README, tutorials for Arm and x86, instruction-modeling guides and a soundness review. evidence
  • Met: Used by a group other than its authors mlkem-native (PQ Code Package) proves its AArch64 and x86-64 assembly with the s2n-bignum infrastructure; some of its maintainers also work at AWS. The CAV 2025 paper has co-authors from CMU and Stanford. evidence
Stage 2 Production Next
  • Not met: Verified code in production at two or more independent organizations 1 recorded: Amazon Web Services.
  • Met: Checker axis is not red
  • Met: Semantics axis is not red
  • Met: Public channel for soundness bugs Public issue tracker; security issues go through AWS vulnerability reporting (see CONTRIBUTING.md). evidence

In use

Verified code in production, and notable verification projects.

In production

  • Amazon Web Services AWS-LC, the cryptographic library that AWS managed services such as AWS KMS rely on, uses machine-checked code from s2n-bignum (per the AWS Security Blog, Nov 2026). source

Facts and sources

Effort
Interactive: You write proofs step by step in a proof assistant.
Licence
Open source, Apache-2.0 OR ISC OR MIT-0
Maintained by
Amazon Web Services (awslabs)
Latest release
main@3ab28d2 (26 Nov 2026) source
Last checked
26 Nov 2026

Further sources

esc