Documentation

CslibFrontier.Crypto.Protocols.SigmaProtocol.Guessing

Guessing attacks on Sigma protocols #

This module formalizes the generic guessing impersonator against a Sigma protocol in [BS23], Section 19.1.1 and Exercise 19.7. A dishonest prover given an arbitrary transcript simulator simulate commits by sampling a simulated conversation (t, c₀, z) and sending t, then answers whatever verifier challenge arrives with z. Whenever simulate always produces accepting transcripts, this impersonator wins SigmaProtocol.directAttack with probability at least (Fintype.card C : ℝ≥0)⁻¹, without using a witness or any zero-knowledge indistinguishability property.

Main definitions #

Main results #

References #

noncomputable def Cslib.Crypto.Protocols.SigmaProtocol.guessingImpersonator {Y T C Z : Type} [Fintype C] [Nonempty C] (simulate : Y → C → PMF (T × Z)) :
Impersonator Y T C Z

The guessing impersonator ([BS23], Section 19.1.1 and Exercise 19.7): given a transcript simulator simulate : Y → C → PMF (T × Z), sample a simulated conversation (t, c₀, z), commit t, store z, and return z on any challenge.

theorem Cslib.Crypto.Protocols.SigmaProtocol.inv_card_le_succProbability_directAttack_guessingImpersonator {X Y T C Z : Type} [Fintype C] [Nonempty C] (P : SigmaProtocol X Y T C Z) {simulate : Y → C → PMF (T × Z)} (hsim : ∀ (y : Y) (c : C), ∀ tz ∈ (simulate y c).support, P.Accepts y tz.1 c tz.2) (keyGen : PMF (X × Y)) :

Generic guessing bound ([BS23], Exercise 19.7): if simulate y c always outputs accepting (t, z), then guessingImpersonator simulate wins P.directAttack keyGen with probability at least (Fintype.card C : ℝ≥0)⁻¹ (a lower bound where the exercise says "probability 1/|C|"). Neither a valid witness in keyGen nor simulator indistinguishability is required.

theorem Cslib.Crypto.Protocols.SigmaProtocol.SpecialHVZK.inv_card_le_succProbability_directAttack {X Y T C Z : Type} [Fintype C] [Nonempty C] {P : SigmaProtocol X Y T C Z} {R : X → Y → Prop} {simulate : Y → C → PMF (T × Z)} (h : P.SpecialHVZK R simulate) (keyGen : PMF (X × Y)) :

The form for special HVZK protocols, as Exercise 19.7 states it: the general guessing bound instantiated at the simulator of a SpecialHVZK Sigma protocol.