Repository navigation
GCM: 48 prepared powers on SSE registers (vg_aes_gcm_prepare_pclmul) - #4521
Conversation
…ul_avx) PrepareAvx.prepare runs the first three rounds of prepare16's plan (H'^2-H'^8), puts H'^9-H'^16 into eight registers keeping H'^8, and multiplies them by H'^8 four times, eight independent products a round, storing each power: vg_aes_gcm_prepare for CPUs with AVX and PCLMULQDQ. The plan's proof is generalized over the largest power computed (16 or 48); the new function is proven against prepareContract, and constant time by taint_decide. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKUFHHDjuK1puxAcLZKKff
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKUFHHDjuK1puxAcLZKKff
PrepareAvx.prepareSse is the SSE code that PrepareAvx.prepare is proven on: vg_aes_gcm_prepare for CPUs with PCLMULQDQ and SSSE3 but not AVX, proven directly (planS_ok) against prepareContract, and constant time by taint_decide. The SSE code (sqS, mulDS, stepS, setupS) moves from Proof/ to Impl/, which may not import Proof/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKUFHHDjuK1puxAcLZKKff
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKUFHHDjuK1puxAcLZKKff
|
Generated by Claude Code |
|
This pull request has conflicts with Posted by |
Restack onto main after #4520's squash: main's files with this PR's commit re-applied. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKUFHHDjuK1puxAcLZKKff
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKUFHHDjuK1puxAcLZKKff
|
what is this waiting on? |
|
Correction: this no longer waits on anything. The Rust rework that calls
Generated by Claude Code |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKUFHHDjuK1puxAcLZKKff
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKUFHHDjuK1puxAcLZKKff
With #4538's baseline vg_aes_gcm_prepare on main, the dispatcher also tries vg_aes_gcm_prepare_pclmul, after _pclmul_avx and before the baseline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKUFHHDjuK1puxAcLZKKff
|
The merge queue dropped this on I don't think that failure is this PR's:
I have no fix to port into this PR: it belongs in Generated by Claude Code |
Implementation PR, based on
main. NoTCB/orSpec/change.vg_aes_gcm_preparefor CPUs with PCLMULQDQ and SSSE3 but not AVX. It is part of moving AES-GCM onto one key layout per target, where every x86-64 backend takes the 1 KiB prepared context. It joins_vpclmul_avx512,_vpclmul(#4518) and_pclmul_avx(#4520).Impl/Gcm/X86_64/PrepareAvx.lean:prepareSseissetupS ++ plan48.flatMap stepS, the SSE code that GCM: 48 prepared powers on 128-bit registers (vg_aes_gcm_prepare_pclmul_avx) #4520'sprepareis proven on throughWP.lane0. The SSE code (sqS,mulDS,stepS,setupS) moves here fromProof/Gcm/X86_64/PrepareAvx/{Step,Ok}.lean, sinceImpl/may not importProof/. The proofs now open it fromImpl.Proof/Gcm/X86_64/PrepareAvx/Ok.lean:prepareSse_okcomes straight fromsetupS_okandplanS_ok(no lane projection), thenPrepare.verified_of.Proof/Gcm/X86_64/PrepareCT.lean:prepareSse_ct, bytaint_decide.Artifacts/Gcm/X86_64.lean:vg_aes_gcm_prepare_pclmul, featurespclmulqdqandssse3, as the SSE GHASH (GhashImpls).Nothing in Rust calls it yet. The Rust GCM rework that calls
vg_aes_gcm_prepare_autofollows separately, with a Benchmarks run of key setup.Checks:
Emit.lean --checkis clean onmaindaf7be3;check_lean_public_imports.py, everyStatic checksstep andcargo clippy --all-targets -- -D warningspass;🤖 Generated with Claude Code
https://claude.ai/code/session_01TKUFHHDjuK1puxAcLZKKff