Skip to content

ML-KEM AArch64: the noise sampler and PRF call are 16-bit only - #2858

Merged
alex merged 3 commits into
mainfrom
claude/a64-mlkem-w16-cleanup
Oct 19, 2026
Merged

alex merged 3 commits into
mainfrom
claude/a64-mlkem-w16-cleanup

Conversation

@alex

@alex alex commented Oct 19, 2026

Copy link
Copy Markdown
Member

Part of #991.

This is the cleanup that #2849 left as a follow-up. Since #2849, every caller of the AArch64 ML-KEM noise sampler (noiseAllWith, noisePairWith, noiseOutWith), cbdCall and prfCbdUsing passes w16 := true.

Changes

No changes to TCB/ or Spec/.

Not changed

The rejection sampler (Rej8, Paired, Hybrid) keeps its w16 parameter. Its proofs share SampleLoop's width-generic invariants with the 32-bit sampleNTT, which the instances without the SHA-3 extension still emit. Making it 16-bit only would touch about 120 proof files with no runtime change.

Speed

The generated code is unchanged: Emit.lean --check passes. No benchmark run, since the change cannot affect speed.

Checks

These pass locally:

  • full lake build
  • Emit.lean --check
  • check_lean_imports, check_lean_modules, check_registrations, check_lean_speed, check_vectors, check_arch_gates, check_variants, check_mcdt
  • algorithms_table.py (table unchanged)

Generated by Claude Code

Every caller of the noise sampler, `prfCbdUsing` and the readonly
transforms passes `w16 := true` since the 16-bit whole-KEM replaced the
paired u32 compositions, so the flag and its 32-bit branches go, with
the lemmas only those branches used (`readonly_out_ok`) and the 16-bit
subtraction nothing calls (`subW`).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ma2fA9rUTPXEEQjYyCMCRw
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ma2fA9rUTPXEEQjYyCMCRw
@alex
alex added this pull request to the merge queue Oct 19, 2026
Merged via the queue into main with commit d137955 Oct 19, 2026
11 checks passed
@alex
alex deleted the claude/a64-mlkem-w16-cleanup branch October 19, 2026 11:55
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