feat(MLDSA): compose the short-model EUF-NMA/CMA headline - #508
feat(MLDSA): compose the short-model EUF-NMA/CMA headline#508alik-eth wants to merge 15 commits into
Conversation
…image Thread the RO preimage through SelfTargetMSIS.Problem.isValid (now Challenge → Target → HashInput → HashOutput → Response → Bool) and have the experiment pass the cache-consistent hashInput it already looks up. The ML-DSA instance mldsaSTMSIS additionally requires hashInput.2 = w' — the recovered commitment must equal the commitment component of the hashed pair — closing the trivial X = X solution the tailored relation previously admitted. On the accepting path the forger's own returned (msg, w') is the queried preimage, so the extraction proof discharges the binding for free. The characterization mldsaSTMSIS_isValid_eq_true_iff states acceptance as verifier acceptance ∧ the binding conjunct, keeping the self-target requirement visible. The abstract SelfTargetMSIS.Problem type parameters are unchanged, so abstract references elsewhere are unaffected; the diff is confined to the two touched declarations. Claude-Session: https://claude.ai/code/session_01DaNGD9nDo3Grwk58nsjS77
Add the corrected short-secret idealized ML-DSA model and the exact NMA key-swap hop, purely additively on top of the existing seed-based chain. Scheme.lean: validKeyPairShort (+ validKeyPairShort_eq_true_iff), identificationSchemeShort. SecurityNMA.lean: polyVecBounded_zero, sampleShortVec, mem_support_sampleShortVec, keygenShort, keygenShort1, hrShort, keygenShort_generable, nmaGameShort, nmaAdvantageShort, nmaGameShort_eq_keygen_bind, mldsaMLWEShort, mldsaMatrixMLWE, expandAIdealization, distinguisherBShort, matrixLift, advantage_mldsaMLWEShort_le_matrix, and the headline nma_keyswap_hop_short (an exact identity: no statistical slack, no extra axioms). The seed-to-matrix bridge uses the existing generic evalDist_bind_bind_swap. Claude-Session: https://claude.ai/code/session_01DaNGD9nDo3Grwk58nsjS77
🤖 PR Summary
Failed to generate AI summary. Please check the per-file summaries and statistics below. Statistics
Lean Declarations ✏️ Removed: 3 declaration(s)
✏️ Added: 283 declaration(s)
…and 133 more not listed.
✅ Removed: 1 `sorry`(s)
Coverage Notes
Partially Analyzed Files
📄 **Per-File Summaries**
The existing lemma Last updated: 2026-08-09 08:28 UTC. |
dtumad
left a comment
There was a problem hiding this comment.
I reviewed the PR-specific commit (ef1439a..16ac818d) separately from the four stacked dependencies. The finite NMA composition itself looks coherent: the real/short PRG hop instantiates the advertised distinguisher, and the CMA theorem goes through the managed-RO/plain-NMA equality before applying the short NMA bound. The asymptotic argument also appears mathematically valid under its stated family-wise assumptions, and its note that this is not yet a PPT/cost-model theorem is useful.
There are a couple of scope distinctions that I think would be worth making sharper before treating this as the ML-DSA headline:
-
euf_cma_security_of_nma_shortis currently a theorem about the genericFiatShamirWithAbortsignature typeOption (Commitment × Response), where the commitment is carried in the signature. The published EasyCrypt Dilithium theorem first uses commitment recovery to reach that generic form; this adds one hash query per signing query, so its final loss usesqH + qS(and the resultingqH + qS + 1term). The repository already documents exactly this distinction inMLDSA.cmaToNmaLossinSecurity.lean. It might be clearest either to describe this theorem consistently as the commitment-carrying/standard-FS short-model composition, or to add the commitment-recovery bridge before calling it the end-to-end ML-DSA CMA headline. The same distinction also means the present CMA theorem is not yet the FIPS-keygen theorem;nma_security_fipsis presently NMA-only. -
nma_security_short_matrixdischarges the seed-to-uniform-matrix MLWE bridge, which is useful, but its SelfTargetMSIS target is still the tailoredmldsaSTMSISShortrelation. Since the PR itself correctly says that the tailored-to-standard normal-form reduction remains follow-up work, wording such as “matrix-MLWE-facing” would be more precise than “literature-facing” for the whole theorem until that second bridge exists.
For comparison, the published mechanization makes both boundaries explicit: the final Dilithium theorem has the qH + qS loss, while the simplified-scheme proof contains the generic FS-with-aborts and commitment-recovery layers.
A smaller organizational suggestion: NonVacuity.lean is very candid that it proves only joint logical consistency at unit slacks and a no-query adversary. That certificate is fine as stated, but it may fit better as a test/example or a follow-up module rather than a new top-level LatticeCrypto.lean import; separating it and the asymptotic wrapper from the finite capstone would also make the semantic core easier to review and merge. The new file also just needs the standard blank line between its copyright header and imports.
Finally, the PR is currently conflicting because of its stacked history, so I would wait for #506/#507 to settle and then review the rebased, small diff. None of the points above calls for a maintainer-side semantic rewrite; they seem better left as author-directed framing/bridging choices.
…oute headline through the direct pair-charge Address review feedback on the CMA-to-NMA engine: - Recast campaign-state comments across the WithAbort/Security and GhostBodies modules as intrinsic descriptions of the finished, kernel-checked declarations (drop issue refs, 'banked', 'multi-week', 'still-open', 'sole open core'). - Correct the probEvent_ghostRead_bad_le docstring and its siblings: the theorems assume 0 ≤ p_abort, not p_abort < 0. - Route the pair charge directly through readRecord_expected_pairs_nontape_le, since the tape/nontape transports cancel; keep the tape factorization (readRecord_expected_pairs_tape_le / _le) as labeled reusable infrastructure off the live path. - Note near deferredDrawReadImpl where generic cursor/path instrumentation stops being sufficient: the commitment draws are introduced inside the signing handler, not as occurrences in the original adversary tree.
… sharpen tailored-vs-standard framing Address review feedback on the tailored SelfTargetMSIS leg: - identificationSchemeShort_verify_eq_true_iff and mldsaSTMSISShort_isValid_iff take the minimal NTTRingLaws premise (their proofs only consume the transform laws via computeWApprox_eq_mul_sub_smul), not the full Primitives.Laws, keeping these semantic certificates independent of unrelated primitive-law assumptions. - Docstrings describe the endpoint as the tailored algebraic verifier relation and state directly that the reduction to the standard SelfTargetMSIS normal form [I_m | A]·y is follow-up work; the dangling module-docstring pointers are replaced by a self-contained 'Tailored vs. standard SelfTargetMSIS' section.
…ed legs and engine Claude-Session: https://claude.ai/code/session_01DaNGD9nDo3Grwk58nsjS77
…sistency witness to the test lib Address review feedback on the composition capstone: - euf_cma_security_of_nma_short: frame it as the commitment-carrying, standard-FS short-model composition rather than the end-to-end ML-DSA CMA headline. The FIPS-204 signature recovers (does not carry) the commitment; that recovery bridge costs one hash query per signing query (qH + qS loss, cf. cmaToNmaLoss) and, together with FIPS-keygen composition, is follow-up work — nma_security_fips is currently NMA-only. - nma_security_short_matrix: describe it as matrix-MLWE-facing, not literature-facing; only the MLWE leg lands on a standard problem (mldsaMatrixMLWE), while the SelfTargetMSIS leg is still the tailored mldsaSTMSISShort (the standard normal-form bridge is follow-up). - Move the joint hypothesis-consistency witness out of the core LatticeCrypto aggregate to LatticeCryptoTest.MLDSA.NonVacuity: it is a logical-consistency (inhabitance) certificate at unit slacks and a no-query adversary, not a security instantiation. Add the standard header blank line.
16ac818 to
46e1649
Compare
… mldsa-nma-headline
…seded full-ring NMA headline The full-ring `nma_security` and its key-swap hop were removed upstream as the theorems coupled to the unsatisfiable honest-sampling law; the short-key model (`nma_security_short`, `nma_security_fips`) supersedes them here.
The capstone of the #467 decomposition: the composed short-model ML-DSA EUF-NMA/CMA security headline, assembled on the landed legs and engine. Purely additive.
Stacks on #503 (binding) / #504 (short-MLWE) / #506 (SelfTargetMSIS leg) / #507 (CMA-to-NMA engine). Until those land, this PR's diff shows their content too; its own contribution is the ~994 additive lines composing the headline. Once the four land, this shrinks to the headline layer.
What this adds
nma_security_short— the EUF-NMA bound composing the exact key-swap hop (feat(MLDSA): short-secret MLWE model and the exact NMA key-swap hop #504's MLWE leg), the reprogramming hops (the feat(FiatShamir): Fiat-Shamir-with-aborts CMA-to-NMA reduction engine #507 engine), and the tailored-STMSIS extraction (feat(MLDSA): tailored SelfTargetMSIS problem and the NMA extraction bound #506):advantage ≤ ofReal(MLWE + εbridge) + SelfTargetMSIS.advantage. Needs noPrimitives.Laws(the short key-swap is an exact identity).nma_security_short_matrix— the literature-facing corollary at the uniform-matrix MLWE, discharging the bridge viaexpandAIdealization.nma_security_fips— connects the FIPS seed-derived key generation to the short model at costεPRGvia the namedexpandSReplacementassumption, with thekeygen0_generable/hrFipscertificate.euf_cma_security_of_nma_short— the CMA-to-NMA composition, using the feat(FiatShamir): Fiat-Shamir-with-aborts CMA-to-NMA reduction engine #507 engine'seuf_cma_to_nma; plus the re-pointed asymptotic corollary (euf_cma_security_asymptotic_short/asymptotic_loss_regime_satisfiable, numerical-loss regime only).LatticeCrypto/MLDSA/NonVacuity.lean, new):mldsa_short_cma_hyps_inhabited+trivial_euf_cma_security_of_nma_short— every hypothesis of the CMA headline inhabited simultaneously at a concrete trivial adversary (consistency-only, no quantitative content).Scope
Additive — the base's old-model
mldsaMLWE/nma_securitydecls are untouched here (retired in a later cleanup). The tailored→standard SelfTargetMSIS normal-form reduction is separate follow-up work.Verification
Off current main (v4.32.0).
lake buildof the full CI library set green.nma_security_short,nma_security_fips,euf_cma_security_of_nma_short, and the witnesstrivial_euf_cma_security_of_nma_shortall kernel-check[propext, Classical.choice, Quot.sound](the witness at abstract parameters — nonative_decide). Both touched files CI-lint clean; no base declaration changed.https://claude.ai/code/session_01DaNGD9nDo3Grwk58nsjS77