Skip to content

Argon2 on x86-64: prove memory initialization and reference-index arithmetic - #456

Merged
reaperhulk merged 3 commits into
mainfrom
argon2-memory-init
Oct 1, 2026
Merged

reaperhulk merged 3 commits into
mainfrom
argon2-memory-init

Conversation

@reaperhulk

@reaperhulk reaperhulk commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Argon2's x86-64 derivation can now initialize its entire memory matrix from H₀ using the supplied BLAKE2b backend. The code clears the allocation, then computes H′(1024, H₀ || LE32(column) || LE32(lane)) for columns zero and one of each lane. It works from arbitrary initial allocation contents and leaves all other cells zero, matching Spec.Argon2.initMemory.

The proofs establish termination and permitted memory accesses for both loops, correctness of every matrix cell against the reviewed spec, preservation of H₀ and enclosing-frame arguments, and bounded writes to the matrix, hash scratch, call stack and eight-byte column/lane suffix. Relational proofs establish the public trace of the complete initialization program, composing the allocation-clearing loop, parameter setup and all lanes through generic H′ calls. H₀ and incoming values in registers overwritten by setup may differ between runs; only public bases and dimensions determine the trace.

The reference-index layer merged from #457 adds fixed-time J₂ lane division, the squared J₁ relative-position mapping and chronological-window wraparound. Its proofs establish the reviewed natural-number formulas under the valid parameter bounds, unchanged memory and execution traces independent of secret numerators.

These are inline building blocks for the eventual derive artifact, following #440. It introduces no spec or TCB changes, independent helper API, emitted assembly or Rust cryptographic code. The complete derive Verified certificate still requires the memory filling, finalization and composition with the other derivation layers; this PR does not claim complete Argon2 verification. The final generic caller will supply the H′ symbol for each backend.

Validation: targeted Lean builds of the complete memory-initialization trace and reference-index proofs after rebasing; direct standard-axiom, compiler-override and spec-origin audits; Lean imports/speed, vector provenance, architecture-gate and variant checks; Rust formatting/clippy and normal/baseline Wycheproof test suites. Earlier versions of both layers passed full local Lean builds and emitter checks; CI runs those checks on the current combined PR. No architecture support or public API changes, so no algorithm-table or benchmark changes.

reaperhulk and others added 3 commits October 1, 2026 14:03
* Argon2 on x86-64: prove reference-window arithmetic

* Argon2 on x86-64: prove fixed-time reference-lane selection

---------

Co-authored-by: Paul Kehrer <161495+reaperhulk@users.noreply.github.com>
@reaperhulk reaperhulk changed the title Argon2 on x86-64: prove complete memory initialization Argon2 on x86-64: prove memory initialization and reference-index arithmetic Oct 1, 2026
@reaperhulk
reaperhulk added this pull request to the merge queue Oct 1, 2026
Merged via the queue into main with commit 5839e79 Oct 1, 2026
31 checks passed
@reaperhulk
reaperhulk deleted the argon2-memory-init branch October 1, 2026 14:21
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