Skip to content

Spec: delete HMAC-SHA-256's and PBKDF2-HMAC-SHA-256's 32-bit contracts - #594

Merged
alex merged 1 commit into
mainfrom
claude/inspiring-pascal-labmxq-spec-sha256-32
Oct 2, 2026
Merged

alex merged 1 commit into
mainfrom
claude/inspiring-pascal-labmxq-spec-sha256-32

Conversation

@alex

@alex alex commented Oct 2, 2026

Copy link
Copy Markdown
Member

Summary

This is a trust change: it touches only Spec/, plus its tests in VerifiedGarbageTest/. It removes trusted definitions and adds none.

Since #583, HMAC-SHA-256 and PBKDF2-HMAC-SHA-256 on ARMv7 and x86 are proven against Spec.Hmac.sha256I's generic contracts, like every other hash on every target. The SHA-256-specific 32-bit contracts are therefore unused. This PR deletes them:

  • Spec/Hmac/Contract.lean: initSha256Sig, initSha256Contract, initSha256Api, finalizeSha256OutSig, finalizeSha256OutContract and finalizeSha256OutApi.
  • Spec/Pbkdf2/Contract.lean: iterateSha256Sig, iterateSha256Contract and iterateSha256Api.

It also makes these supporting changes:

  • Docs: removes the references to those contracts from Spec/Hmac.lean, Spec/Hmac/Generic.lean, Spec/Pbkdf2.lean and Spec/Pbkdf2/Generic.lean. Spec/Hmac/Generic.lean drops the note "removed once sha256I is implemented on every target", since that has now happened.
  • Imports: Spec/Scrypt/Contract.lean used to import Spec/Pbkdf2/Contract.lean. It now imports what it actually uses, Spec/Pbkdf2.lean and TCB/Artifact.lean.
  • Tests: VerifiedGarbageTest/Hmac.lean dropped the rfl checks that compared sha256I's contracts with the deleted ones. It now checks sha256I's function names and modules directly against the ones the Rust code calls (hmac_sha256::vg_hmac_sha256_init, etc.).

No implementation, proof or generated code changes.

Validation

  • Full lake build, including VerifiedGarbageTest, then lake env lean --run Emit.lean --check. The axiom, compiler-override and Spec-origin audits pass, and src/asm is unchanged.
  • check_lean_imports, check_lean_speed, check_vectors, check_arch_gates, check_variants, check_mcdt and algorithms_table all pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RjfTK5YMk2jDsiKRYs2dbn


Generated by Claude Code

Since #583, HMAC-SHA-256 and PBKDF2-HMAC-SHA-256 are proven against
Spec.Hmac.sha256I's generic contracts on every target, so nothing uses
initSha256*, finalizeSha256Out* (Spec/Hmac/Contract.lean) and
iterateSha256* (Spec/Pbkdf2/Contract.lean) any more. Delete both files,
the documentation that mentions them, and the tests that compared them
with sha256I's; the test now checks sha256I's names and modules against
the ones the Rust code uses. Spec/Scrypt/Contract.lean imports what it
used of Spec/Pbkdf2/Contract.lean directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RjfTK5YMk2jDsiKRYs2dbn
@alex
alex enabled auto-merge October 2, 2026 13:30
@alex
alex added this pull request to the merge queue Oct 2, 2026
Merged via the queue into main with commit 2c0a617 Oct 2, 2026
37 checks passed
@alex
alex deleted the claude/inspiring-pascal-labmxq-spec-sha256-32 branch October 2, 2026 13:44
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.

2 participants