Skip to content

Implement verified Argon2 on x86-64 - #479

Merged
reaperhulk merged 8 commits into
mainfrom
argon2-reference-map
Oct 2, 2026
Merged

reaperhulk merged 8 commits into
mainfrom
argon2-reference-map

Conversation

@reaperhulk

@reaperhulk reaperhulk commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Implements Argon2d, Argon2i, and Argon2id version 1.3 on x86-64 against the merged specification and ISA models. The public argon2::derive API supports passwords, salts, secrets, associated data, memory and iteration costs, lanes, worker limits, and variable-length output. Rust validates parameters and allocates memory; the entire derivation runs in Lean-generated assembly. Lanes are evaluated serially.

The complete entry point is proven Verified against Spec.Argon2.deriveContract, including H₀, initialization, every filling pass, final reduction and H′, memory framing, termination, ABI preservation, and the shared contract’s exact leakage policy. Argon2i leaks no input contents; Argon2d/id permit precisely the specified flattened reference-index log. The implementation is generic over the BLAKE2b backend, so future variants propagate through H′ and the whole derivation.

This consolidates the implementation and proof stack into one complete platform PR. There are no changes to Spec/ or TCB/, no unverified proof shortcuts or resource-limit overrides, and no manually written assembly. Stack arguments remain read-only; normalized copies live in the verified private frame.

Validation:

  • Targeted complete-derivation, registration, and Argon2 golden-test builds pass, including standard-axiom, compiler-override, and spec-origin audits.
  • The repository-wide emitter check passed for the completed implementation before the latest main update. After this rebase, the Argon2 registration build and scoped emitter check pass; unrelated full checks are left to CI.
  • The Rust suite passes with Wycheproof; RFC 9106 vectors cover all three variants, and 360 cases match OpenSSL across costs, lanes, output lengths, empty inputs, secrets, and associated data. Baseline CPU-feature tests pass.
  • New Rust API and RFC test code have 100% line coverage. Formatting and clippy pass, as do import, proof-speed, vector provenance, architecture gate, variant propagation, MCDT, and algorithm-table checks.
  • End-to-end benchmarks cover all three variants at 1 MiB and 16 MiB. The runners use OpenSSL 3.0, which predates Argon2, so they benchmark this library alone. On OpenSSL 3.2+ hosts, cargo bench --manifest-path bench/Cargo.toml --features openssl-argon2 enables the comparison and cargo test --manifest-path bench/Cargo.toml --features openssl-argon2 --test argon2 runs the differential tests. Benchmark smoke tests and clippy also pass against the runners’ exact OpenSSL 3.0.13 version.

Rebased onto main at ac71ac2a; the complete Argon2 registration build and scoped emitter audits pass after the rebase, and generated Argon2 assembly remains unchanged.

@reaperhulk
reaperhulk force-pushed the argon2-reference-map branch from 92344db to dc9d00b Compare October 1, 2026 21:56
@reaperhulk reaperhulk changed the title Argon2 on x86-64: prove complete reference-index mapping Implement verified Argon2 on x86-64 Oct 1, 2026
@reaperhulk
reaperhulk marked this pull request as draft October 1, 2026 21:56
@reaperhulk
reaperhulk force-pushed the argon2-reference-map branch 2 times, most recently from d40608f to dc7ee9c Compare October 2, 2026 11:49
@reaperhulk
reaperhulk marked this pull request as ready for review October 2, 2026 11:49
@reaperhulk
reaperhulk force-pushed the argon2-reference-map branch from dc7ee9c to bdfe5b1 Compare October 2, 2026 11:58
@reaperhulk
reaperhulk added this pull request to the merge queue Oct 2, 2026
Merged via the queue into main with commit cda82f0 Oct 2, 2026
50 checks passed
@reaperhulk
reaperhulk deleted the argon2-reference-map branch October 2, 2026 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant