Documentation

CslibFrontier.Crypto.Computational.CramerShoup.ProjectiveHash.Games

Standalone security games for universal and $\text{universal}_2$ projective hash functions #

Formalizes Attack Games 12.4 and 12.5, Lemmas 12.6 and 12.8 ([BS23], Sections 12.5.1–12.5.2, printed pp. 486 and 488), in the adaptive three-stage form of Exercise 12.26(a)–(b) (printed p. 521).

Nothing else on main uses these standalone games: the Cramer–Shoup security proof in CslibFrontier/Crypto/Computational/CramerShoup/Scheme.lean keeps its direct proofs for the two hybrid hops from uniform_projHash_fiber_add and uniform_projHash2_fiber_any_le.

Differences from printed statements #

Main definitions #

Main results #

References #

Attack Game 12.4, Lemma 12.6, and Exercise 12.26(a) #

@[reducible, inline]

Oracle specification for evaluation queries (ṽ, w̃) ↦ f_{σ,τ}(ṽ, w̃) in Attack Game 12.4 and Exercise 12.26(a) ([BS23], Section 12.5.1, printed p. 486, and Exercise 12.26(a), printed p. 521).

Adaptive three-stage adversary for Attack Game 12.4 / Exercise 12.26(a) ([BS23], Section 12.5.1, printed p. 486, and Exercise 12.26(a), printed p. 521). chooseU selects u ∈ G, chooseChallenge receives h and makes evaluation queries before choosing (v, w), and guess receives z_b and continues making evaluation queries before outputting a bit. Returning pure (v, w, st₁) with (v, w) independent of h (which may still be kept in st₁) recovers the non-adaptive Attack Game 12.4.

Admissibility for UniversalDistAdversary: for every (u, st₀) in chooseU's support, every evaluation query of chooseChallenge lies in L_u on every execution path regardless of replies, every supported output (v, w, st₁) of chooseChallenge on any honest (σ, τ) satisfies (v, w) ∉ L_u, and every evaluation query of guess lies in L_u on every execution path.

noncomputable def Cslib.Crypto.ProjectiveHash.universalDistExperiment (F : PrimeOrderGroupFamily) {State₀ State₁ : Type} (d : F.Desc) (A : UniversalDistAdversary F d State₀ State₁) (b : Bool) :

Experiment b of Attack Game 12.4 in the adaptive form of Exercise 12.26(a) ([BS23], Section 12.5.1, printed p. 486, and Exercise 12.26(a), printed p. 521). In Experiment false (b = 0), z = projHash F d σ τ v w; in Experiment true (b = 1), z is uniformly distributed in F.Carrier d (ζ • F.generator d).

Lemma 12.6 / Exercise 12.26(a) ([BS23], Section 12.5.1, printed p. 486, and Exercise 12.26(a), printed p. 521): for every admissible adversary, Experiment false and Experiment true of universalDistExperiment have the identical output distribution.

Attack Game 12.5, Lemma 12.8, and Exercise 12.26(b) #

@[reducible, inline]

Oracle specification for evaluation queries ((ṽ, w̃), ρ̃) ↦ f'_{σ₁,τ₁,σ₂,τ₂}(ṽ, w̃, ρ̃) in Attack Game 12.5 and Exercise 12.26(b) ([BS23], Section 12.5.2, printed p. 488, and Exercise 12.26(b), printed p. 521).

noncomputable def Cslib.Crypto.ProjectiveHash.universal2Wins (F : PrimeOrderGroupFamily) (d : F.Desc) (σ₁ τ₁ σ₂ τ₂ ρ : ZMod (F.order d)) (u : F.Carrier d) (guesses : List (F.Carrier d × F.Carrier d × F.Carrier d × ZMod (F.order d))) :

Winning predicate of Attack Game 12.5 and Exercise 12.26(b) ([BS23], Section 12.5.2, printed p. 488): some tuple (ẑ, v̂, ŵ, ρ̂) in the output list has (v̂, ŵ) ∉ L_u, ρ̂ ≠ ρ, and ẑ = f'_{σ₁,τ₁,σ₂,τ₂}(v̂, ŵ, ρ̂).

Adaptive three-stage adversary for Attack Game 12.5 / Exercise 12.26(b) ([BS23], Section 12.5.2, printed p. 488, and Exercise 12.26(b), printed p. 521). Returning pure (v, w, ρ, st₁) with (v, w, ρ) independent of (h₁, h₂) (which may still be kept in st₁) recovers the non-adaptive Attack Game 12.5.

Admissibility and Q-tuple output bound for Universal2GuessAdversary: for every supported (u, st₀), every evaluation query of chooseChallenge lies in L_u on every execution path; for every supported output (v, w, ρ, st₁) of chooseChallenge on honest keys and every z : F.Carrier d, every evaluation query of guess st₁ z lies in L_u on every path and every supported output list of guess st₁ z against every honest key has length at most Q. Notice (v, w) ∉ L_u is intentionally omitted (though printed in Attack Game 12.5) because the Q / q bound holds even when (v, w) ∈ L_u.

noncomputable def Cslib.Crypto.ProjectiveHash.universal2GuessGame (F : PrimeOrderGroupFamily) {State₀ State₁ : Type} (d : F.Desc) (A : Universal2GuessAdversary F d State₀ State₁) :

Attack Game 12.5 in the adaptive form of Exercise 12.26(b) ([BS23], Section 12.5.2, printed p. 488, and Exercise 12.26(b), printed p. 521).

theorem Cslib.Crypto.ProjectiveHash.succProbability_universal2GuessGame_le (F : PrimeOrderGroupFamily) {State₀ State₁ : Type} (d : F.Desc) (A : Universal2GuessAdversary F d State₀ State₁) {Q : ℕ} (hA : A.Admissible Q) :

Lemma 12.8 / Exercise 12.26(b) ([BS23], Section 12.5.2, printed p. 488, and Exercise 12.26(b), printed p. 521): in universal2GuessGame, every admissible adversary that outputs at most Q tuples wins with probability at most Q / q.