Expand description
ML-DSA-65 (FIPS-204 / Dilithium) runtime kernels — the post-quantum SIGNATURE scheme that
complements ML-KEM-768 in the channel. This module builds bottom-up: the length-256 NTT over
the Dilithium prime q = 8380417 (a COMPLETE transform, unlike Kyber’s incomplete one — q ≡ 1 (mod 512), so X²⁵⁶+1 splits fully), with signed Montgomery reduction. Validated against the
schoolbook negacyclic convolution.
Constants§
- PK_
BYTES pk= ρ ‖ pack(t1).- SIG_
BYTES - ML-DSA-65 signature length.
- SK_
BYTES sk= ρ ‖ K ‖ tr ‖ pack(s1) ‖ pack(s2) ‖ pack(t0).
Functions§
- bench_
verify_ breakdown - Dev-only profiler: break
verify’s cost into components to locate the hot spot. Not shipped logic. - keygen
- ML-DSA.KeyGen_internal(ξ) → (pk, sk), deterministic in the 32-byte seed ξ.
- mldsa_
keypair_ seq mldsaKeypair(seed)→ pk(1952) ‖ sk(4032).- mldsa_
sign_ seq mldsaSign(sk, msg, ctx)→ signature(3309).- mldsa_
verify_ seq mldsaVerify(pk, msg, ctx, sig)→ 1 if valid, else 0.- sign
- Deterministic ML-DSA-65 signature over
mwith contextctx(thernd = 0variant). - verify
- Verify an ML-DSA-65 signature;
trueiff valid for(pk, m, ctx).