Documentation

CslibFrontier.Crypto.Computational.MLDSA.KeyOnly

A finite forgery bound for uncompressed keys and polynomial challenges #

The model publishes the full matrix and vector (A, t) and verifies a response and a challenge polynomial (z, c) using a fixed hash. Following the algebraic argument of [DKL+18], the proof changes t = A s₁ + s₂ to a uniform vector at a Module-LWE distinguishing cost, then extracts a self-target solution for [I_k | A | -t]. The FIPS 204 byte verifier and its seeded key-only game are in CslibFrontier.Crypto.Computational.MLDSA.FIPS204.

The bound leaves the self-target success probability as an explicit term. Applying hardness assumptions to efficient reductions and simulating signing queries are further steps in a chosen-message security proof.

Main definitions #

Main results #

References #

Self-target MSIS #

def Cslib.Crypto.MLDSA.selfTargetMap (P : Params) (pk : PublicKey P) (u : Fin P.k → Fin P.n → ZMod P.q) (z : Fin P.ℓ → Fin P.n → ZMod P.q) (c : Fin P.n → ZMod P.q) :
Fin P.k → Fin P.n → ZMod P.q

The self-target linear map [I_k | A | -t] · (u, z, c) = u + A z - c t.

@[reducible, inline]

A self-target hash, mapping a vector of R_q^k and a message to a challenge.

A candidate solution (M, u, z, c) to self-target MSIS: a message, a low part u ∈ R_q^k, a response z ∈ R_q^ℓ and a challenge c ∈ R_q.

s = (M, u, z, c) solves self-target MSIS for [I_k | A | -t], the hash G and the bound ζ: ‖u‖_∞ ≤ ζ, ‖z‖_∞ ≤ ζ, c ∈ B_τ and G(u + A z - c t, M) = c.

Instances For

    The self-target hash induced by an ML-DSA hash: G(v, M) = H(HighBits(v), M).

    def Cslib.Crypto.MLDSA.forgeryLowPart (P : Params) (pk : PublicKey P) (σ : Signature P) :
    Fin P.k → Fin P.n → ZMod P.q

    The low part u = -LowBits(A z - c t) of a candidate signature (z, c).

    The self-target candidate (M, -LowBits(A z - c t), z, c) read off a forgery (M, (z, c)).

    theorem Cslib.Crypto.MLDSA.selfTargetMap_forgeryLowPart {P : Params} [NeZero P.q] (pk : PublicKey P) (σ : Signature P) :
    selfTargetMap P pk (forgeryLowPart P pk σ) σ.z σ.c = fun (i : Fin P.k) (j : Fin P.n) => ↑(highBits P.q P.γ₂ (verifierCommitment P pk σ.z σ.c i j) * ↑(2 * P.γ₂))

    u + (A z - c t) = 2 γ₂ · HighBits(A z - c t) for the low part u of (z, c).

    theorem Cslib.Crypto.MLDSA.isSelfTargetSolution_of_verify {P : Params} (hP : P.Valid) {H : Hash P} {pk : PublicKey P} {msg : List Bool} {σ : Signature P} (h : verify P H pk msg σ = true) :

    A verifying forgery is a self-target solution. If (z, c) verifies on M under (A, t), then (-LowBits(A z - c t), z, c) solves self-target MSIS for [I_k | A | -t], the hash H(HighBits(·), ·) and the bound max γ₁ γ₂.

    Key distributions and experiments #

    The honest public key is a Module-LWE sample (A, A s₁ + s₂) with secret s₁ and error s₂.

    noncomputable def Cslib.Crypto.MLDSA.keyLaw (P : Params) [NeZero P.q] (secret : PMF (ZMod P.q)) :

    Honest public keys: A uniform, and every coefficient of s₁ and s₂ drawn independently from secret (in ML-DSA, uniform on [-η, η]). The deterministic part of key generation is SecretKey.publicKey; this is the semantic key distribution compared in the reduction, in the style of ModuleLWE.sampleLaw, not a sampling program.

    noncomputable def Cslib.Crypto.MLDSA.uniformKeyLaw (P : Params) [NeZero P.q] :

    Uniform public keys: A and t independent and uniform.

    The key-only forgery experiment for a fixed public key pk: run the forger on pk and accept when its output (M, σ) verifies.

    The self-target MSIS experiment for the matrix [I_k | A | -t] of a fixed public key pk: accept when the solver's candidate is a self-target solution.

    noncomputable def Cslib.Crypto.MLDSA.koaGame (P : Params) (keys : PMF (PublicKey P)) (H : Hash P) (adv : PublicKey P → ProbComp (List Bool × Signature P)) :

    The key-only forgery game: draw a public key from keys and run koaExperiment.

    noncomputable def Cslib.Crypto.MLDSA.selfTargetGame (P : Params) (keys : PMF (PublicKey P)) (G : SelfTargetHash P) (ζ : ℕ) (B : PublicKey P → ProbComp (SelfTargetCandidate P)) :

    The self-target MSIS game: draw a public key from keys and run selfTargetExperiment.

    def Cslib.Crypto.MLDSA.forgeryDistinguisher (P : Params) (H : Hash P) (adv : PublicKey P → ProbComp (List Bool × Signature P)) (A : Matrix (Fin P.k) (Fin P.ℓ) (Fin P.n → ZMod P.q)) (t : Fin P.k → Fin P.n → ZMod P.q) :

    The Module-LWE reduction: read the sample (A, t) as a public key, run the forger and output whether its forgery verifies, that is, run koaExperiment on (A, t).

    The self-target MSIS reduction: run the forger on (A, t) and read its forgery as a self-target candidate.

    theorem Cslib.Crypto.MLDSA.koaGame_keyLaw {P : Params} [NeZero P.q] (secret : PMF (ZMod P.q)) (H : Hash P) (adv : PublicKey P → ProbComp (List Bool × Signature P)) :
    koaGame P (keyLaw P secret) H adv = ModuleLWE.realGame (Probability.PMF.pi fun (x : Fin P.ℓ) => Probability.PMF.pi fun (x : Fin P.n) => secret) (Probability.PMF.pi fun (x : Fin P.k) => Probability.PMF.pi fun (x : Fin P.n) => secret) (forgeryDistinguisher P H adv)

    The forgery game for honest keys is the real Module-LWE game of forgeryDistinguisher, with secret s₁ and error s₂ drawn coefficientwise from secret.

    The forgery game for uniform keys is the random Module-LWE game of forgeryDistinguisher.

    Forging reduces to self-target MSIS. For every key distribution, a key-only forger succeeds at most as often as selfTargetReduction solves self-target MSIS for the hash H(HighBits(·), ·) and the bound max γ₁ γ₂.

    theorem Cslib.Crypto.MLDSA.succProbability_koaGame_le {P : Params} (hP : P.Valid) [NeZero P.q] (secret : PMF (ZMod P.q)) (H : Hash P) (adv : PublicKey P → ProbComp (List Bool × Signature P)) :

    Finite key-only bound in the uncompressed, fixed-hash model. Against its honest keys, the success probability of a key-only forger is at most the Module-LWE advantage of forgeryDistinguisher, with secret and error drawn coefficientwise from secret, plus the success probability of selfTargetReduction against self-target MSIS for a uniform matrix [A | t].