Skip to content

Make x86 SHA-256 constructions generic over compression backends - #460

Merged
reaperhulk merged 2 commits into
mainfrom
codex/sha256-x86-variants
Oct 1, 2026
Merged

reaperhulk merged 2 commits into
mainfrom
codex/sha256-x86-variants

Conversation

@reaperhulk

@reaperhulk reaperhulk commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

x86 SHA-256 compression currently has fixed scalar callers. Register it as a backend and make streaming SHA-256, HMAC-SHA-256, and PBKDF2-HMAC-SHA-256 follow every compression variant automatically. Rust HMAC and PBKDF2 selection now matches the hash backend exhaustively, so adding a backend requires its constructions to handle it.

The HMAC initializer/finalizer and PBKDF2 iteration retain their existing specialized word-copy and direct-compression bodies. Their correctness and ABI proofs now accept any verified compressor, replacing the duplicate scalar proofs. The scalar constructions are definitionally identical to the existing implementations (checked by scalar_code_unchanged); every emitted SHA-256/HMAC/PBKDF2 assembly body is unchanged. This prepares the x86 SHA-NI implementation without claiming a scalar performance improvement.

The ARM benchmark container now installs Rust into a fresh rustup home, matching the merged CI repair in #458. Updating its trimmed preinstalled Cargo failed on missing man-page files before benchmarks could run.

No changes to TCB/ or Spec/.

Validation:

  • Full lake build and emitter --check, including artifact axiom and compiler-override audits. This validation is reused after the rebase that changes only workflow setup; no Lean or Rust implementation changes followed it.
  • All repository static checks, generated algorithm tables, and git diff --check.
  • Formatting and Clippy on the host and i686.
  • Full Wycheproof-backed Rust tests on the host and native i686, both default dispatch and VG_CPU_FEATURES=none with cpu-features-env.

@reaperhulk
reaperhulk force-pushed the codex/sha256-x86-variants branch from 2c17e61 to 37cbaba Compare October 1, 2026 13:38
@reaperhulk
reaperhulk added this pull request to the merge queue Oct 1, 2026
Merged via the queue into main with commit 0e3f24c Oct 1, 2026
39 of 41 checks passed
@reaperhulk
reaperhulk deleted the codex/sha256-x86-variants branch October 1, 2026 14:15
alex pushed a commit that referenced this pull request Oct 1, 2026
src/asm/x86/sha256.rs regenerated (main's #460 reworked the x86 SHA-256
artifacts; vg_sha224_init is re-emitted).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HDRg9k22FbCYq3TnciKvwG
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