Skip to content

ML-DSA on AArch64: check norms in vector registers - #7084

Merged
alex merged 1 commit into
mainfrom
claude/mldsa-norm-a64
Dec 5, 2026
Merged

alex merged 1 commit into
mainfrom
claude/mldsa-norm-a64

Conversation

@alex

@alex alex commented Dec 5, 2026

Copy link
Copy Markdown
Member

ML-DSA verification gets 1.7–2.5% faster on AArch64, by checking with vector instructions that the coefficients of the signature's z are small enough.

Speed

Benchmarks run on Neoverse N2:

Benchmark Base Head Change
mldsa44_verify 25.29 µs 24.66 µs −2.5%
mldsa65_verify 38.85 µs 38.05 µs −2.0%
mldsa87_verify 66.77 µs 65.64 µs −1.7%

Code size

AArch64, in bytes: +92 (vg_mldsa_norm_lt, 64 → 156).

Implementation

A coefficient a < q is out of bounds if bound ≤ a ≤ q − bound, which is the same as (a − bound) mod 2³² ≤ q − 2·bound. The old code tested each coefficient by itself. The new code takes the minimum of (a − bound) mod 2³² over the polynomial, 16 coefficients per iteration, and compares it once.

The loop that the old code used (mapLoop) had no other user, so it and its proof are gone.

There are no changes to TCB/ or Spec/.


Generated by Claude Code

vg_mldsa_norm_lt compared one coefficient at a time, in general-purpose
registers. A coefficient a < q is out of bounds exactly when
(a - bound) mod 2^32 <= q - 2 bound, so it now takes the minimum of
(a - bound) mod 2^32 over the polynomial, 16 coefficients at a time, and
compares it once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TKUFHHJ19UwwasyKpuVuqb
@github-actions github-actions Bot added the untrusted-only This changes exclusively implementations and proofs, and thus is entirely formally verified. label Dec 5, 2026
@alex
alex added this pull request to the merge queue Dec 5, 2026
Merged via the queue into main with commit 5f5d4e1 Dec 5, 2026
27 checks passed
@alex
alex deleted the claude/mldsa-norm-a64 branch December 5, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

untrusted-only This changes exclusively implementations and proofs, and thus is entirely formally verified.

Development

Successfully merging this pull request may close these issues.

2 participants