Documentation

CslibFrontier.Crypto.Computational.SIS.SelfTargetFork

Classical random-oracle reduction from self-target solutions to Module-SIS #

[BDK+21], §6.1, “Classical Hardness of SelfTargetMSIS”, forks the solver at the oracle query for its output. Two accepting runs at that point give short vectors with the same module product and different last coordinates. Their integer difference is a nonzero kernel vector with twice the coefficient bound.

The statement works for a given matrix, including the systematic matrix [I | A]. The ideal challenge game draws uniform challenges embedded in the ring. The digest game draws uniform digests instead, and its deterministic partial challenge expansion may reject a digest or map different digests to the same polynomial. The verifier can make one last oracle query, so the bound covers solvers that never queried their output point. The experiment counts oracle queries and uses an explicit distribution of saved coins.

@[reducible, inline]

The oracle receives a message representative and the full module product.

@[reducible, inline]

A classical self-target solver with saved coins. It receives the public matrix and returns a message and an integer vector whose last polynomial must encode the challenge.

def Cslib.Crypto.ModuleSIS.SelfTarget.product {d k n q : ℕ} (A : Matrix (Fin d) (Fin (k + 1)) (Fin n → ZMod q)) (y : Fin (k + 1) → Fin n → ℤ) :
Fin d → Fin n → ZMod q

Ring product of the matrix and an integer witness reduced coefficientwise.

def Cslib.Crypto.ModuleSIS.SelfTarget.accepts {k n q : ℕ} {C : Type} (expand : C → Option (Fin n → ZMod q)) (radius : ℕ) (y : Fin (k + 1) → Fin n → ℤ) (c : C) :

A short witness with last coordinate equal to a successful expansion of the reply.

noncomputable def Cslib.Crypto.ModuleSIS.SelfTarget.game {d k n q : ℕ} {C Coins : Type} [Fintype C] [Nonempty C] (expand : C → Option (Fin n → ZMod q)) (radius : ℕ) (coins : PMF Coins) (adv : Adversary d k n q C Coins) (A : Matrix (Fin d) (Fin (k + 1)) (Fin n → ZMod q)) :

Run the solver with a shared, lazy uniform random oracle and verify its candidate with the same oracle, including candidates whose point it did not query.

def Cslib.Crypto.ModuleSIS.SelfTarget.reduction {d k n q : ℕ} {C Coins : Type} [DecidableEq C] (fallback : C) (expand : C → Option (Fin n → ZMod q)) (radius Q : ℕ) (coins : ProbComp Coins) (tape : ProbComp (Fin (Q + 1) → C)) (adv : Adversary d k n q C Coins) (A : Matrix (Fin d) (Fin (k + 1)) (Fin n → ZMod q)) :
ProbComp (Fin (k + 1) → Fin n → ℤ)

The program draws its private coins once and two independent reply tapes, then returns the difference of the two accepted integer witnesses. A failed fork returns the zero vector.

noncomputable def Cslib.Crypto.ModuleSIS.SelfTarget.reductionLaw {d k n q : ℕ} {C Coins : Type} [Fintype C] [Nonempty C] [DecidableEq C] (fallback : C) (expand : C → Option (Fin n → ZMod q)) (radius Q : ℕ) (coins : PMF Coins) (adv : Adversary d k n q C Coins) (A : Matrix (Fin d) (Fin (k + 1)) (Fin n → ZMod q)) :
PMF (Fin (k + 1) → Fin n → ℤ)

Distribution of the extracted vector for an arbitrary saved-coin law and two uniform reply tapes. eval_reduction realizes it whenever a program supplies the coins and tapes.

theorem Cslib.Crypto.ModuleSIS.SelfTarget.eval_reduction {d k n q : ℕ} {C Coins : Type} [Fintype C] [Nonempty C] [DecidableEq C] (fallback : C) (expand : C → Option (Fin n → ZMod q)) (radius Q : ℕ) (coins : ProbComp Coins) (tape : ProbComp (Fin (Q + 1) → C)) (uniform : tape.eval = Probability.PMF.uniformOfFintype (Fin (Q + 1) → C)) (adv : Adversary d k n q C Coins) (A : Matrix (Fin d) (Fin (k + 1)) (Fin n → ZMod q)) :
(reduction fallback expand radius Q coins tape adv A).eval = reductionLaw fallback expand radius Q coins.eval adv A

The concrete two-run program realizes the full distribution of the forking reduction.

noncomputable def Cslib.Crypto.ModuleSIS.SelfTarget.collisionMass {n q : ℕ} {C : Type} [Fintype C] [Nonempty C] [DecidableEq C] (expand : C → Option (Fin n → ZMod q)) :

Largest probability that a fresh uniform digest differs from a fixed digest and expands to the same successfully decoded polynomial. Failed expansions contribute zero.

theorem Cslib.Crypto.ModuleSIS.SelfTarget.collisionMass_eq_card {n q : ℕ} {C : Type} [Fintype C] [Nonempty C] [DecidableEq C] (expand : C → Option (Fin n → ZMod q)) :
collisionMass expand = Finset.univ.sup fun (c : C) => ↑(Nat.card { c' : C // c ≠ c' ∧ (expand c).isSome = true ∧ expand c = expand c' }) / ↑(Fintype.card C)

Count successful colliding digests directly. The first digest and all failure outputs are excluded from each fiber.

theorem Cslib.Crypto.ModuleSIS.SelfTarget.success_le_fork_digest {d k n q : ℕ} {C Coins : Type} [Fintype C] [Nonempty C] [DecidableEq C] (expand : C → Option (Fin n → ZMod q)) (radius Q : ℕ) (matrices : PMF (Matrix (Fin d) (Fin (k + 1)) (Fin n → ZMod q))) (coins : PMF Coins) (adv : Adversary d k n q C Coins) (hQ : ∀ (A : Matrix (Fin d) (Fin (k + 1)) (Fin n → ZMod q)) (s : Coins), (adv A s).IsQueryBounded Q) (fallback : C := Classical.arbitrary C) :
((matrices.bind (game expand radius coins adv)) true).toReal ≤ ↑(Q + 1) / ↑(Fintype.card C) + √(↑(Q + 1) * ((matrices.bind fun (A : Matrix (Fin d) (Fin (k + 1)) (Fin n → ZMod q)) => PMF.map (fun (w : Fin (k + 1) → Fin n → ℤ) => decide (IsSolution A (2 * radius) w)) (reductionLaw fallback expand radius Q coins adv A)) true + collisionMass expand).toReal)

Classical self-target success with a uniform digest oracle and deterministic partial challenge expansion. A fork extracting two distinct polynomials gives a Module-SIS solution at twice the radius. The additional probability inside the square root counts fresh distinct digests that could expand to the same accepted polynomial. For fixed SHAKE256 in FIPS 204, this quantity is a property of the concrete function and the bound here is only at most one.

theorem Cslib.Crypto.ModuleSIS.SelfTarget.success_le_fork {d k n q : ℕ} {C Coins : Type} [Fintype C] [Nonempty C] [DecidableEq C] (encode : C ↪ Fin n → ZMod q) (radius Q : ℕ) (matrices : PMF (Matrix (Fin d) (Fin (k + 1)) (Fin n → ZMod q))) (coins : PMF Coins) (adv : Adversary d k n q C Coins) (hQ : ∀ (A : Matrix (Fin d) (Fin (k + 1)) (Fin n → ZMod q)) (s : Coins), (adv A s).IsQueryBounded Q) (fallback : C := Classical.arbitrary C) :
((matrices.bind (game (some ∘ ⇑encode) radius coins adv)) true).toReal ≤ ↑(Q + 1) / ↑(Fintype.card C) + √(↑(Q + 1) * ((matrices.bind fun (A : Matrix (Fin d) (Fin (k + 1)) (Fin n → ZMod q)) => PMF.map (fun (w : Fin (k + 1) → Fin n → ℤ) => decide (IsSolution A (2 * radius) w)) (reductionLaw fallback (@Function.comp (optParam C (Classical.arbitrary C)) (Fin n → ZMod q) (Option (Fin n → ZMod q)) some ⇑encode) radius Q coins adv A)) true).toReal)

For ideal challenges embedded in the ring, different replies always produce different last coordinates. The bound recovers the classical Dilithium §6.1 fork with zero collision loss.