Documentation

CslibFrontier.Crypto.Computational.MLDSA.SigningSimulation

Simulation of one ML-DSA signing attempt with a fresh challenge #

In [NIST24a], Algorithm 7, the mask coefficients are uniform on (-γ₁,γ₁] in the ideal-mask model, and the response check is strict. This gives (2(γ₁-β)-1)^(ℓn) admissible responses out of (2γ₁)^(ℓn) masks.

For every fixed sparse challenge independent of the mask, the simulator receives the full public vector t = A s₁ + s₂. It draws a fresh uniform response in the inner box after an independent gate with that exact ratio. It computes the remaining rejection checks and the hint from A,t,z,c. The resulting law agrees with the signing attempt on its complete accepted algebraic transcript and on aborts. The transcript includes the high-bits commitment used for the hash query. This is the fresh-challenge distribution step of the signing simulation argument in [BDK+21], Appendix B.

The public data of a successful signing attempt at a fresh challenge. The commitment is the coefficient vector encoded for the hash input, and the compressed signature contains the response, hint and polynomial challenge.

  • commitment : Fin P.k → Fin P.n → ℤ

    The high-order commitment hashed with the message representative.

  • signature : CompressedSignature P

    The accepted response, hint, and sparse challenge.

noncomputable def Cslib.Crypto.MLDSA.signingMaskLaw (P : Params) (hγ : 0 < P.γ₁) :
PMF (Fin P.ℓ → Fin P.n → ZMod P.q)

An ideal Algorithm 7 mask, uniform over the coefficient box (-γ₁, γ₁]^(ℓ n).

theorem Cslib.Crypto.MLDSA.signingMaskLaw_apply_le (P : Params) [NeZero P.q] (hγ : 0 < P.γ₁) (hq : 2 * P.γ₁ < P.q) (y : Fin P.ℓ → Fin P.n → ZMod P.q) :
(signingMaskLaw P hγ) y ≤ (↑(2 * P.γ₁) ^ (P.ℓ * P.n))⁻¹

Every individual ideal mask has probability at most the reciprocal of the full FIPS box.

noncomputable def Cslib.Crypto.MLDSA.freshSigningAttempt (P : Params) (d ω : ℕ) (hγ : 0 < P.γ₁) (sk : SecretKey P) (c : Fin P.n → ZMod P.q) :

The signing attempt with an ideal, coefficientwise uniform mask and the given fresh challenge. On success it emits the high bits of the original commitment A y and the signature returned by Algorithm 7's two rejection stages.

noncomputable def Cslib.Crypto.MLDSA.simulateFreshSigningAttempt (P : Params) (d ω : ℕ) (hβ : P.β < P.γ₁) (pk : PublicKey P) (c : Fin P.n → ZMod P.q) :

Simulate the accepted transcript and abort mass from (A,t). Keep the response with probability ((2(γ₁-β)-1)/(2γ₁))^(ℓ n), sample it independently and uniformly inside the strict response box, then perform the public low-bits, product and hint checks.

theorem Cslib.Crypto.MLDSA.simulateFreshSigningAttempt_support_finite (P : Params) [NeZero P.q] (d ω : ℕ) (hβ : P.β < P.γ₁) (pk : PublicKey P) (c : Fin P.n → ZMod P.q) :

The simulated attempt transcript distribution has finite support.

theorem Cslib.Crypto.MLDSA.simulateFreshSigningAttempt_support (P : Params) (hP : P.Valid) (hq : 2 * P.γ₁ < P.q) (hγq : 4 * P.γ₂ < P.q) (d ω : ℕ) (hβ : P.β < P.γ₁) (pk : PublicKey P) (c : Fin P.n → ZMod P.q) {t : AttemptTranscript P} (ht : some t ∈ (simulateFreshSigningAttempt P d ω hβ pk c).support) :

Every accepted public simulation has the requested challenge, a short response, an encodable hint, and the very commitment that the verifier recovers. This holds for every full public key, including a uniformly sampled vector in the Module-LWE hybrid.

theorem Cslib.Crypto.MLDSA.freshSigningAttempt_eq_simulate (P : Params) (hP : P.Valid) (hq : 2 * P.γ₁ < P.q) (hβ : P.β < P.γ₁) (d ω : ℕ) (sk : SecretKey P) (hs₁ : ∀ (i : Fin P.ℓ) (j : Fin P.n), |(sk.s₁ i j).valMinAbs| ≤ ↑P.η) (hs₂ : ∀ (i : Fin P.k) (j : Fin P.n), |(sk.s₂ i j).valMinAbs| ≤ ↑P.η) {c : Fin P.n → ZMod P.q} (hc : InBall P.τ c) :

For every fresh sparse challenge, the complete accepted transcript and the probability of an abort agree with the public simulator. A distribution of challenges independent of the mask can bind this equality pointwise, retaining the challenge and any commitment-digest bytes.