Documentation

CslibFrontier.Crypto.Computational.SchnorrEavesdrop

Direct and eavesdropping security of Schnorr identification in the strict-PPT model #

In an eavesdropping attack on an identification scheme ([BS23], Section 18.5, Attack Game 18.2), the adversary first overhears Q n honest conversations between the prover and the verifier for the public key u = α • g before attempting impersonation. For an idealized simulator that samples ZMod q uniformly, special HVZK makes simulated conversations identically distributed to honest ones ([BS23], Theorems 19.3 and 19.5; schnorr_eavesdropAttack_eq_directAttack_ideal in CslibFrontier.Crypto.Protocols.SigmaProtocol.SchnorrIdentification).

In the uniform strict-PPT model, fair-coin machines with a fixed polynomial clock cannot sample ZMod q exactly when the prime group order q is not a power of two. Instead, exponent sampling uses F.sampleExp n d (ProbComp.sampleModNat), which is within statistical distance 1 / 2 ^ n of uniform on ZMod q (closeTo_uniform_sampleExp). Consequently:

Main definitions #

Main results #

Ideal-sampling steps #

References #

@[reducible, inline]

Encoding of a single Schnorr conversation (t, c, z) of bit words.

The word view of a typed conversation (t, c, z): the challenge as its list of bits.

A uniform eavesdropping adversary against Schnorr identification ([BS23], Attack Game 18.2). Its first stage sees the security parameter, the group description, the encoded public key, and a list of overheard conversations (t, c, z), and returns a commitment word and a state word; its second stage sees the security parameter, the state and the challenge word.

Both stages of an eavesdropping adversary are uniform strict PPT in their whole inputs.

Ideal honest, strict-PPT honest, and strict-PPT simulated conversations #

An ideal honest Schnorr conversation with an m-bit challenge ([BS23], Section 19.1): sample a uniform commitment exponent r : ZMod (F.order d) and a uniform m-bit challenge c, and output the encoded commitment r • g, the challenge c, and the binary response (r + c * α).val.bits.

A strict-PPT honest Schnorr conversation at security parameter n with an m-bit challenge: sample the commitment exponent r with F.sampleExp n d and the challenge c with BitString.sampleList m, and output (encode (r • g), c, ((r + ofBits c * α) % q).bits).

A strict-PPT simulated Schnorr conversation at security parameter n with an m-bit challenge ([BS23], Example 19.3 and Theorem 19.3): sample a uniform m-bit challenge c and run F.schnorrSimulateWord ((n, d), u, c) on the encoded public key u to obtain (t, z), returning (t, c, z) without using the secret key.

Statistical closeness of single and repeated conversations #

The law of one strict-PPT simulated conversation on a canonical public key encode u: a uniform m-bit challenge c, a sampled scalar response z, and the commitment encode (z • g - c • u).

The law of the strict-PPT Schnorr simulator at a typed challenge: a sampled scalar response z and the commitment z • g - c • u, with the challenge read as a binary number.

A strict-PPT simulated transcript is a typed simulated conversation, written as words.

k strict-PPT simulated transcripts are k typed simulated conversations, written as words.

A strict-PPT honest Schnorr conversation is within statistical distance 1 / 2 ^ n of an ideal honest conversation.

An ideal honest Schnorr conversation is within statistical distance 1 / 2 ^ n of a strict-PPT simulated conversation on the public key encode (α • g).

A strict-PPT honest Schnorr conversation is within statistical distance 2 / 2 ^ n of a strict-PPT simulated conversation on the public key encode (α • g).

Q independent ideal honest Schnorr conversations are within statistical distance Q / 2 ^ n of Q strict-PPT simulated conversations on the public key encode (α • g).

Q independent strict-PPT honest Schnorr conversations are within statistical distance 2 * Q / 2 ^ n of Q strict-PPT simulated conversations on the public key encode (α • g).

Eavesdropping games and reduction to direct attacks #

The eavesdropping impersonation attack on Schnorr identification ([BS23], Attack Game 18.2) with an ideal key: the secret key is drawn with PMF.uniformOfFintype, which a strict PPT machine cannot do. Before committing, the adversary overhears Q n independent conversations generated by the strict-PPT honest prover (schnorrRealTranscript) with k n-bit challenges. This game is the intermediate step between schnorrEavesdropProbGame, with the native key generator, and the direct attack schnorrDirectGame.

Turn an eavesdropping adversary into a direct impersonator ([BS23], Theorem 19.3 and Figure 19.2): before committing, simulate Q n conversations on the public key using schnorrSimulatedTranscript.

Ideal-sampling step: in the ideal-key games, replacing Q n strict-PPT honest conversations by strict-PPT simulated ones changes the game advantage by at most 2 * Q n / 2 ^ n.

Efficiency of conversation generation and the eavesdropping reduction #

schnorrRealTranscript is uniform strict PPT when the security parameter, group description, secret exponent, and challenge length are computable in polynomial time.

schnorrSimulatedTranscript is uniform strict PPT when the security parameter, group description, encoded public key, and challenge length are computable in polynomial time.

Native games and security under the discrete-logarithm assumption #

The direct impersonation attack on Schnorr identification ([BS23], Attack Game 18.1) with k n-bit challenges and the native key generator: the key pair comes from F.schnorrSigKeyGen n d, whose exponent F.sampleExp n d is within statistical distance 1 / 2 ^ n of uniform on ZMod (F.order d). The verifier accepts when the commitment encodes z • g - c • u.

Executable ProbComp Bool direct impersonation experiment at group description d: sample the key pair with schnorrSigKeyGen n d, run A.commit, sample c ← BitString.sampleList (k n), run A.respond, and check acceptance with encodeSchnorrVerify.

Replacing schnorrSigKeyGen with ideal uniform key generation in schnorrDirectProbGame changes the game advantage by at most 1 / 2 ^ n.

theorem Cslib.Crypto.PrimeOrderGroupFamily.succProbability_schnorrDirectProbGame_le {F : PrimeOrderGroupFamily} (setup : ℕ → PMF F.Desc) (k : ℕ → ℕ) (A : F.SchnorrImpersonator) (n : ℕ) (hkq : ∀ d ∈ (setup n).support, 2 ^ k n ≤ F.order d) :

Concrete bound for the native direct attack, the bound (19.2) of [BS23], Theorem 19.1, plus the key generator's statistical distance: at each security parameter where every supported group has at least 2 ^ k n elements, an impersonator's success probability in schnorrDirectProbGame is at most 1 / 2 ^ n + 1 / 2 ^ k n + √ε', where ε' is the discrete-logarithm success probability of the rewinding adversary A.rewind k.

theorem Cslib.Crypto.PrimeOrderGroupFamily.negligible_schnorrDirectProbGame {F : PrimeOrderGroupFamily} {setup : ℕ → PMF F.Desc} (hDL : F.DiscreteLog setup) {k : ℕ → ℕ} (hk : Turing.MultiTapeTM.ComputableInPolyTime k Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encUnary) (hkq : ∀ (n : ℕ), ∀ d ∈ (setup n).support, 2 ^ k n ≤ F.order d) (hchallenge : Negligible fun (n : ℕ) => 1 / 2 ^ k n) {A : F.SchnorrImpersonator} (hA : A.IsPPT) :

Schnorr identification is secure against direct attacks under the discrete-logarithm assumption ([BS23], Theorem 19.1), with its native key generator schnorrSigKeyGen. Suppose the challenge length k is computable in polynomial time, every group the setup can produce at parameter n has at least 2 ^ k n elements, and 1 / 2 ^ k n is negligible (the source's super-poly N := |C|). Then every uniform strict PPT impersonator succeeds in schnorrDirectProbGame with negligible probability. The proof applies F.DiscreteLog setup to the rewinding adversary A.rewind k through its certificate isPPTOn_rewind.

Differences from the source: challenges are k n-bit words read as numbers modulo q, which embed injectively when 2 ^ k n ≤ q (challengeEmbedding), where the source takes any C ⊆ ℤ_q; commitments and responses are words, and the verifier accepts when the commitment encodes z • g - c • u; the key exponent comes from the strict-PPT sampler sampleExp rather than exactly uniformly; and the setup law is arbitrary, so F.DiscreteLog setup is the source's assumption when an efficient algorithm samples the setup (see DiscreteLog).

The eavesdropping impersonation attack on Schnorr identification ([BS23], Attack Game 18.2) with its native algorithms: the key pair comes from schnorrSigKeyGen and the Q n overheard honest conversations from the strict-PPT honest prover schnorrRealTranscript, both of which sample exponents with F.sampleExp n d.

Executable ProbComp Bool eavesdropping experiment at group description d: sample (pk, sk) ← schnorrSigKeyGen n d, generate Q n honest transcripts with schnorrRealTranscript, run A.commit, sample c ← BitString.sampleList (k n), run A.respond, and verify with encodeSchnorrVerify.

Replacing schnorrSigKeyGen with ideal uniform key generation in schnorrEavesdropProbGame changes the game advantage by at most 1 / 2 ^ n.

Replacing both schnorrSigKeyGen and the Q n strict-PPT honest conversations in schnorrEavesdropProbGame with ideal key generation and simulated conversations in schnorrDirectGame setup k (A.toDirect k Q) changes the game advantage by at most (2 * Q n + 1) / 2 ^ n.

Concrete bound for the native eavesdropping attack: at each security parameter where every supported group has at least 2 ^ k n elements, an eavesdropper's success probability in schnorrEavesdropProbGame is at most (2 * Q n + 1) / 2 ^ n + 1 / 2 ^ k n + √ε', where ε' is the discrete-logarithm success probability of the rewinding adversary (A.toDirect k Q).rewind k. The term (2 * Q n + 1) / 2 ^ n is the statistical distance of the native key generator and the Q n simulated conversations from ideal ones, where [BS23], Theorem 19.5 has an exact equality.

Schnorr identification with challenge length k is secure against eavesdropping attacks ([BS23], Definition 18.6) with its native algorithms (schnorrEavesdropProbGame): for every polynomial-time conversation count Q and every uniform strict PPT eavesdropping adversary A, the success probability is negligible. The source's adversary chooses how many conversations to request; quantifying over every polynomial-time count Q covers an adversary that requests at most Q n of them.

Schnorr identification is secure against eavesdropping attacks under the discrete-logarithm assumption ([BS23], Theorems 19.1 and 19.5 combined), with its native algorithms. Under the premises of negligible_schnorrDirectProbGame and a conversation count Q computable in polynomial time, every uniform strict PPT eavesdropping adversary succeeds in schnorrEavesdropProbGame with negligible probability. The proof applies F.DiscreteLog setup to the rewinding adversary of the direct impersonator A.toDirect k Q, which simulates the Q n conversations, through the certificates isPPT_toDirect and isPPTOn_rewind. Where Theorem 19.5 has an exact equality, the strict-PPT simulator and key generator add the statistical term (2 * Q n + 1) / 2 ^ n (succProbability_schnorrEavesdropProbGame_le). The other differences from the source are those of negligible_schnorrDirectProbGame.

Schnorr identification satisfies IsProbEavesdropSecure under the discrete-logarithm assumption ([BS23], Theorems 19.1 and 19.5 combined): this is negligible_schnorrEavesdropProbGame for every polynomial-time conversation count and every uniform strict PPT eavesdropper.