Repository navigation
ML-DSA x86-64 sign: each row of w with one fused dot-inverse call - #3744
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015ajQWygy8vKC2iCbkRdW6i
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signing computes each row of
w = NTT⁻¹(Â ∘ ŷ)with one call to a new fused function,vg_mldsa_dot_inverse{4,5,7}. Before this change, each row took ℓ multiply and multiply-add calls followed by an inverse NTT.What's new
Impl/MlDsa/X86_64/Arith/Dot.lean(SSE2) anddotInvAvx2inArith/Montgomery.lean(AVX2, suffix_avx2).pmuludqon the even and on thepsrlq 32odd doublewords).nttInvBody/montInvBodyand shared withvg_mldsa_ntt_inverse*, so the inverse-NTT code isn't duplicated.Spec.MlDsa.dotInverseContract(Proof/.../Arith/Dot.lean,YDot.lean), with shared lemmas inDotCore.leanandProof/MlDsa/Arith/DotSum.lean.taint_decide.MlDsaArith's backend gains the threedotInvfunctions, andPrimsOkgainsdotInv.rowWis a singledotInvAtcall.Prims.No
Spec/orTCB/change.Instruction counts
callgrind,
sign, 32 messages, AVX2:Verification is unchanged.
Benchmarks (x86_64, mldsa, against main 7b0c28e): https://github.com/pyca/verified-garbage/actions/runs/41016364679
Generated by Claude Code