Documentation

CslibFrontier.Crypto.Computational.SchnorrSignature.Security

Schnorr signatures are EUF-CMA secure under discrete log #

This module proves that Schnorr signatures are EUF-CMA secure in the random-oracle model under the discrete-logarithm assumption ([BS23], Theorem 19.7 and Lemma 19.8; [PS00]; [BN06]):

theorem DiscreteLog.eufCma_schnorrNativeROMScheme
    (hDL : F.DiscreteLog fun n => PMF.pure (description n)) … :
    ROMSignature.EUFCMA (fun n => encBitString (width n))
      (fun n => F.schnorrNativeROMScheme n (description n) (width n))

schnorrNativeROMScheme is the scheme as its native algorithms run it, with the actual key generator schnorrSigKeyGen and nonce sampler sampleExp. ROMSignature.EUFCMA says that every uniform oracle-PPT word forger wins its EUF-CMA game ROMSignature.wordEufCmaGame (adaptive signing queries, hash queries on arbitrary words, final-message freshness) with negligible probability. The other premises fix a group family, one description per security parameter with encoded descriptions of polynomial length, and a challenge width w computable in polynomial time with 2 ^ w ≤ q and negligible 2⁻ʷ.

The discrete-logarithm adversary is the explicit program schnorrForkingAdversary. It samples the forger's tape, 2B strict-PPT simulated transcripts (schnorrSimulatedTranscript) and two banks of B + 1 uniform answers, where B is the forger's saved-coin call budget. It then runs the native pass schnorrForkPass on the first bank, runs it again with the answers from the named index on taken from the second bank, and outputs extractNat of the two forgeries when the fork succeeds. isPPTOn_schnorrForkingAdversary certifies it as strict PPT from the forger's certificate, so F.DiscreteLog applies to it.

The proof chains four steps, each about existing objects:

  1. exists_closeTo_wordEufCmaGame_schnorrNativeROMScheme moves from the actual samplers to the typed word game within (B + 1) / 2 ^ n;
  2. succProbability_eufCmaGame_schnorrWordROMScheme_le bounds the typed game by the one-way success of the typed forking reduction schnorrWordROMSchemeReduction;
  3. succProbability_oneWayGame_schnorrWordROMSchemeReduction_le replaces its perfect simulator by the law of the strict-PPT simulator (schnorrSampledSimulate) within 2B / 2 ^ n;
  4. discreteLogGame_schnorrForkingAdversary identifies that one-way game with the discrete-log game of the native adversary, through map_eval_schnorrForkingAdversary and the exact pass agreement eval_schnorrForkPass.

The group family fixes one description per security parameter. It need not be computable: the discrete-logarithm game gives the description to the reduction, and the saved-coin budget needs only its encoded length to be polynomial. Random setups are not covered, because the existing game gives the forger only the public key.

Main definitions #

Main results #

References #

The output of the forking adversary from two native passes: when the first pass names a query j, the second pass on answers spliced at j names j too, and the two answers at j differ, the witness extractNat computed from the two challenges and responses; otherwise the empty word.

noncomputable def Cslib.Crypto.PrimeOrderGroupFamily.schnorrForkingAdversary (F : PrimeOrderGroupFamily) {k : ℕ} {Control : Type} (machine : Turing.MultiTapePTM k Bool Control Bool) (c e keyC keyD : ℕ) (width : ℕ → ℕ) (n : ℕ) (input : F.Desc × List Bool) :

The native forking discrete-logarithm adversary built from a native forger's guarded saved-coin replay ([BS23], Lemma 19.8; [BN06], Lemma 1). On the group description d and an encoded public key, it samples the forger's tape, 2B simulated transcripts and two banks of B + 1 uniform w n-bit answers, where B is the saved-coin budget. It runs schnorrForkPass once, runs it again with the answers from the named index on replaced, and extracts a discrete logarithm from the two forgeries.

Efficiency of the forking adversary #

The forking adversary is uniform strict PPT whenever the challenge width is computable in polynomial time. The forger enters only through its replay machine, whose full-input certificate isPPTOn_schnorrForkPass is part of the native pass.

The adversary's law #

The native forking adversary realizes the typed forking reduction with the sampled simulator: on a canonical public key, its output read as a scalar has exactly the law of FiatShamir.reduction for schnorrWordROMScheme, the decoded saved-coin forger and schnorrSampledSimulate, with call budgets B and B.

The statistical step #

The strict-PPT simulator's conversations are within 2⁻ⁿ of the perfect simulator's.

Replacing the perfect simulator by the strict-PPT simulator's law in the typed forking reduction costs at most 2⁻ⁿ per presampled transcript.

The statistical step. The typed forking reduction with the perfect simulator wins the one-way game at most (Qs + Qro) / 2 ^ n more often than with the strict-PPT simulator's law.

theorem Cslib.Crypto.PrimeOrderGroupFamily.discreteLogGame_schnorrForkingAdversary {F : PrimeOrderGroupFamily} {k : ℕ} {Control : Type} (machine : Turing.MultiTapePTM k Bool Control Bool) (c e keyC keyD : ℕ) (width : ℕ → ℕ) (description : ℕ → F.Desc) (n : ℕ) (hm : 2 ^ width n ≤ F.order (description n)) :
F.discreteLogGame (fun (n : ℕ) => PMF.pure (description n)) (F.schnorrForkingAdversary machine c e keyC keyD width) n = Protocols.SigmaProtocol.oneWayGame (Protocols.SigmaProtocol.schnorrKeyGen (F.generator (description n))) (fun (α : ZMod (F.order (description n))) (u : F.Carrier (description n)) => α • F.generator (description n) = u) (Protocols.SigmaProtocol.FiatShamir.reduction (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits) (F.schnorrWordSigma (description n) hm) (schnorrSampledSimulate n (description n)) (F.schnorrWordExtract (description n) hm) 0 (F.schnorrDecodedForger (description n) (Protocols.ROMSignature.savedCoinForger machine (Turing.MultiTapeTM.encBitString (width n)) c e keyC keyD n)) (Probability.savedCoinBudget c e keyC keyD n) (Probability.savedCoinBudget c e keyC keyD n))

The native adversary's discrete-log game is the typed one-way game of the forking reduction with the strict-PPT simulator's law, at a deterministic group description.

Security under the discrete-logarithm assumption #

theorem Cslib.Crypto.PrimeOrderGroupFamily.DiscreteLog.eufCma_schnorrNativeROMScheme {F : PrimeOrderGroupFamily} {description : ℕ → F.Desc} (hDL : F.DiscreteLog fun (n : ℕ) => PMF.pure (description n)) (hdescription : PolynomiallyBounded fun (n : ℕ) => (F.encDesc (description n)).length) {width : ℕ → ℕ} (hwidth : Turing.MultiTapeTM.ComputableInPolyTime width Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encUnary) (hwq : ∀ (n : ℕ), 2 ^ width n ≤ F.order (description n)) (hchallenge : Negligible fun (n : ℕ) => 1 / 2 ^ width n) :
Protocols.ROMSignature.EUFCMA (fun (n : ℕ) => Turing.MultiTapeTM.encBitString (width n)) fun (n : ℕ) => F.schnorrNativeROMScheme n (description n) (width n)

Schnorr signatures are EUF-CMA secure in the random-oracle model under the discrete-logarithm assumption ([BS23], Theorem 19.7 and Lemma 19.8; [PS00]; [BN06]). Fix a group family description, one description per security parameter with encoded length polynomial in n, and a challenge width w computable in polynomial time with 2 ^ w n ≤ q and negligible 1 / 2 ^ w n. If discrete logarithms are hard for the setup fun n => PMF.pure (description n), then the native Schnorr scheme with w n-bit challenges is EUF-CMA secure in the random-oracle model: every uniform oracle-PPT word forger wins ROMSignature.wordEufCmaGame with negligible probability. The game uses the actual key generator schnorrSigKeyGen and nonce sampler sampleExp, adaptive signing queries, hash queries on arbitrary words, and final-message freshness.

The premises are the discrete-logarithm assumption and the parameter side conditions; the forger's certificate is part of ROMSignature.EUFCMA. The proof applies F.DiscreteLog to the explicit two-pass adversary schnorrForkingAdversary, whose certificate isPPTOn_schnorrForkingAdversary is derived from the forger's. The family need not be computable, because the discrete-logarithm game gives the description to the reduction. Random setups are not covered: the game gives the forger only the public key.