Documentation

CslibFrontier.Crypto.Protocols.SigmaProtocol.SchnorrSignature

Schnorr signatures #

Schnorr signatures ([BS23], Section 19.2) are the Fiat–Shamir signatures of Schnorr's Sigma protocol. Over a vector space of prime order q with a nonzero base g, the commitment r • g of a uniform r takes each value with probability at most 1 / q (schnorr_commit_map_fst_le). The Fiat–Shamir theorem then bounds the success of a forger making at most Qs signing calls and Qro hash calls by

Qs · (Qs + Qro) / q + (Qro + 1) / N + √((Qro + 1) · ε'),

where N is the number of challenges and ε' the probability that the forking reduction computes a discrete logarithm of the public key (schnorr_succProbability_eufCmaGame_le_ideal). This is an ideal-sampling step toward [BS23], Theorem 19.7, not the cited result: it is the bound (19.21) of Theorem 19.16 at δ = 1 / q, with Qs · (Qs + Qro) / q in place of the slightly larger Qs · (Qs + Qro + 1) / q, for one group, the key drawn at the PMF level by schnorrKeyGen g, and one forger. It does not prove the forking reduction efficient. Security of the native scheme under the discrete-logarithm assumption is PrimeOrderGroupFamily.DiscreteLog.eufCma_schnorrNativeROMScheme in CslibFrontier.Crypto.Computational.SchnorrSignature.Security.

Main definitions #

Main results #

Ideal-sampling step toward Theorem 19.7 #

References #

theorem Cslib.Crypto.Protocols.SigmaProtocol.schnorr_commit_map_fst_le {q : ℕ} [Fact (Nat.Prime q)] {G C : Type} [AddCommGroup G] [Module (ZMod q) G] [DecidableEq G] {ι : C ↪ ZMod q} {g : G} (hg : g ≠ 0) (x : ZMod q) (y t : G) :
(PMF.map Prod.fst ((schnorr ι g).commit x y)) t ≤ (↑q)⁻¹

Unpredictable Schnorr commitments ([BS23], Definition 19.7): with a nonzero base, the commitment r • g of a uniform r takes each value with probability at most 1 / q.

@[reducible, inline]
noncomputable abbrev Cslib.Crypto.Protocols.SigmaProtocol.schnorrROMScheme {q : ℕ} [Fact (Nat.Prime q)] {G C : Type} [AddCommGroup G] [Module (ZMod q) G] [DecidableEq G] {M : Type} (ι : C ↪ ZMod q) (g : G) :
ROMSignature.Scheme G (ZMod q × G) M (G × ZMod q) (M × G) C

The Schnorr signature scheme in the random-oracle model ([BS23], Section 19.2): the Fiat–Shamir transform of schnorr ι g with key generator schnorrKeyGen g.

Completeness of Schnorr signatures: every honest signature produced by schnorrROMScheme ι g verifies under the shared random oracle.

theorem Cslib.Crypto.Protocols.SigmaProtocol.schnorr_succProbability_eufCmaGame_le_ideal {q : ℕ} [Fact (Nat.Prime q)] {G C : Type} [AddCommGroup G] [Module (ZMod q) G] [DecidableEq G] {ι : C ↪ ZMod q} {g : G} {M : Type} [Fintype C] [Nonempty C] [DecidableEq M] [DecidableEq C] (hg : g ≠ 0) (A : ROMSignature.Forger G M (G × ZMod q) (M × G) C) {Qs Qro : ℕ} (hA : A.CallBounded Qs Qro) :
↑(Game.succProbability (ROMSignature.eufCmaGame (fiatShamir (Function.Embedding.refl (M × G)) (schnorr ι g) (schnorrKeyGen g)) A)) ≤ ↑Qs * (↑Qs + ↑Qro) / ↑q + (↑Qro + 1) / ↑(Fintype.card C) + √((↑Qro + 1) * ↑(oneWayGame (schnorrKeyGen g) (fun (α : ZMod q) (u : G) => α • g = u) (FiatShamir.reduction (Function.Embedding.refl (M × G)) (schnorr ι g) (linearSimulate (fun (x : G) => LinearMap.toSpanSingleton (ZMod q) G g) id ι) (linearExtract ι) 0 A Qs Qro)).succProbability)

Ideal-sampling step toward [BS23], Theorem 19.7, not the cited result: at a fixed group with a nonzero base, with the key drawn at the PMF level by schnorrKeyGen g, a forger making at most Qs signing calls and Qro hash calls succeeds with probability at most Qs · (Qs + Qro) / q + (Qro + 1) / N + √((Qro + 1) · ε'), where N is the number of challenges and ε' the probability that the forking reduction computes a discrete logarithm of the public key, returning zero on a failed fork. This is the bound (19.21) of Theorem 19.16 at δ = 1 / q, with Qs · (Qs + Qro) / q in place of the slightly larger Qs · (Qs + Qro + 1) / q. Missing are the efficiency of the forking reduction and the asymptotic statement; for the native scheme they are PrimeOrderGroupFamily.isPPTOn_schnorrForkingAdversary and PrimeOrderGroupFamily.DiscreteLog.eufCma_schnorrNativeROMScheme.