Documentation

CslibFrontier.Crypto.Computational.Encryption.OneWay

One-way public-key encryption #

Attack Game 12.6 of Boneh and Shoup ([BS23], Section 12.6, printed p. 495): "The challenger computes (pk, sk) ←R G_a(), x ←R 𝒳, r ←R ℛ, y ← E_a(pk, x; r), and sends (pk, y) to the adversary. The adversary outputs x̂". It wins "if x̂ = x", and its advantage OWadv[𝒜, ℰ_a] is "the probability that 𝒜 wins the game".

PKE.owExperiment E sampleMsg A is this game for a scheme E : PKE PK SK M C, with the message drawn from sampleMsg; PKE.owAdvantage is the adversary's success probability. The book draws x uniformly from the message space; a sampler lets a client choose the message law, for example the uniform law on a cyclic group through a generator. The book's x̂ ∈ ℛ is read as x̂ ∈ 𝒳. Definition 12.5 (one way: negligible advantage for every efficient adversary) is not stated here as a predicate; CDH.elGamal_oneWay states it for the fair-coin scheme elGamalProbExplicitCoinPKE and typed adversaries (with CDH.elGamal_oneWay_ideal as the ideal-sampling step using exactly uniform exponents).

Main definitions #

References #

def Cslib.Crypto.PKE.owExperiment {PK SK M C : Type} [DecidableEq M] (E : PKE PK SK M C) (sampleMsg : ProbComp M) (A : PK → C → ProbComp M) :

Attack Game 12.6 (one-way encryption, [BS23], Section 12.6, p. 495): draw a key pair, a message x ← sampleMsg and a ciphertext y ← E.encrypt pk x, give (pk, y) to the adversary, and accept when it outputs x.

noncomputable def Cslib.Crypto.PKE.owAdvantage {PK SK M C : Type} [DecidableEq M] (E : PKE PK SK M C) (sampleMsg : ProbComp M) (A : PK → C → ProbComp M) :

The advantage OWadv[A, E] of Attack Game 12.6: the probability that A recovers the message.