Documentation

CslibFrontier.Crypto.Computational.ElGamal.OneWay

Multiplicative ElGamal is one-way under CDH #

Section 12.6.2 of Boneh and Shoup ([BS23], printed pp. 499–500) notes that multiplicative ElGamal over a cyclic group 𝔾 of prime order q generated by g "is one-way under the CDH assumption": an adversary π’œ against Attack Game 12.6 "is easily converted to an adversary ℬ that breaks the CDH with same advantage". Given (u, v), ℬ "sets y ←R 𝔾, and gives π’œ the public key u and the ciphertext (v, y); when π’œ outputs x ∈ 𝔾, adversary ℬ outputs w ← y/x."

In a fixed ZMod q-module G, elGamalExplicitCoinPKE q g of CslibFrontier/Crypto/Computational/ElGamal/ExplicitCoin.lean writes this scheme additively, and elGamalOWToCDH sampleGroup A is the adversary ℬ, with y drawn from sampleGroup. When the message and y are both drawn as Ξ³ β€’ g for uniform Ξ³, the one-way experiment and the CDH experiment of ℬ have the same law (eval_owExperiment_elGamalExplicitCoinPKE), so the advantages are equal (owAdvantage_elGamalExplicitCoinPKE_eq_cdhAdvantage). This needs neither finiteness of G nor that g generates it. In the book g generates 𝔾, so Ξ³ β€’ g for uniform Ξ³ is the book's uniform draw from 𝔾.

For a prime-order group family, elGamalOWProbGame is Attack Game 12.6 on the fair-coin scheme elGamalProbExplicitCoinPKE n d (whose encoded key generator, encryption, and decryption are elGamalKeyGenProb, elGamalEncryptProb, and elGamalDecryptDet in CslibFrontier/Crypto/Computational/ElGamal/ProbComp.lean), with the challenge message drawn from the certified fair-coin sampler sampleGroupElem n d (isPPTOn_encode_sampleGroupElem). Under strict-PPT fair-coin sampling (unlike [BS23], Definition 2.8, p. 30, which allows a negligible runtime-overflow probability), each sampleExp draw is within statistical distance 1 / 2 ^ n of uniform on ZMod q:

Adversaries read and write group elements, as CDH adversaries of the family do; a word-level one-wayness predicate would need a decoder for group elements, which a general PrimeOrderGroupFamily does not provide.

Main definitions #

Main results #

Ideal-sampling steps #

References #

def Cslib.Crypto.elGamalOWToCDH {G : Type} [AddCommGroup G] (sampleGroup : ProbComp G) (A : G β†’ G Γ— G β†’ ProbComp G) :
G β†’ G β†’ ProbComp G

The adversary ℬ of [BS23], Section 12.6.2, p. 500, that turns a one-way adversary A against multiplicative ElGamal into a CDH adversary: on (u, v) draw y ← sampleGroup, run A on the public key u and the ciphertext (v, y), and output y - x for its answer x.

theorem Cslib.Crypto.eval_owExperiment_elGamalExplicitCoinPKE {G : Type} [AddCommGroup G] (q : β„•) [NeZero q] [Module (ZMod q) G] (g : G) [DecidableEq G] (A : G β†’ G Γ— G β†’ ProbComp G) :

The one-way experiment of multiplicative ElGamal is the CDH experiment of ℬ ([BS23], Section 12.6.2, p. 500), when the message and ℬ's y are both drawn as Ξ³ β€’ g for uniform Ξ³.

theorem Cslib.Crypto.owAdvantage_elGamalExplicitCoinPKE_eq_cdhAdvantage {G : Type} [AddCommGroup G] (q : β„•) [NeZero q] [Module (ZMod q) G] (g : G) [DecidableEq G] (A : G β†’ G Γ— G β†’ ProbComp G) :
(elGamalExplicitCoinPKE q g).toPKE.owAdvantage ((fun (Ξ³ : ZMod q) => Ξ³ β€’ g) <$> ProbComp.uniform (ZMod q)) A = cdhAdvantage q g (elGamalOWToCDH ((fun (Ξ³ : ZMod q) => Ξ³ β€’ g) <$> ProbComp.uniform (ZMod q)) A)

"Breaks the CDH with same advantage" ([BS23], Section 12.6.2, p. 500): in a fixed group, the one-way advantage against multiplicative ElGamal equals the CDH advantage of ℬ.

@[reducible, inline]

A typed one-way adversary against multiplicative ElGamal over a prime-order group family: it receives the security parameter, the group description, the public key and the ciphertext, and outputs a group element.

A typed one-way adversary is efficient when it is uniform strict PPT on the encoded input (1ⁿ, d, encode u, encode v, encode y) with the encoded output. The input is a DDHInput, whose fields carry the public key u (leftPublic) and the ciphertext (v, y) (rightPublic, candidateShared).

Fair-coin group-element sampler: draw c ← sampleExp n d and output (c : ZMod q) β€’ g, within statistical distance 1 / 2 ^ n of uniform on F.Carrier d.

The reduction ℬ for a prime-order group family ([BS23], Section 12.6.2, p. 500): elGamalOWToCDH in each group, with y drawn from sampleGroupElem n d.

elGamalOWToCDHAdversary A is an efficient CDH adversary whenever A is efficient. The subtraction y - x is computed as an ElGamal decryption with secret key 1.

Attack Game 12.6 for multiplicative ElGamal over a group family ([BS23], Section 12.6, p. 495, and Section 12.6.2): draw the group description from setup n and run PKE.owExperiment on its scheme, with the message drawn as Ξ³ β€’ g for uniform Ξ³. That law is uniform on the group, as the book's x ←R 𝔾 is, because Ξ³ ↦ Ξ³ β€’ g is a bijection (smul_generator_bijective).

The one-way game against multiplicative ElGamal and the CDH game of elGamalOWToCDHAdversary differ by at most 1 / 2 ^ n, the distance of sampleExp from uniform.

Ideal-sampling step toward CDH.elGamal_oneWay, not the cited result: if CDH holds for the family under setup, every efficient typed adversary wins Attack Game 12.6 against elGamalExplicitCoinPKE (whose key, challenge message, and encryption coins are drawn from exact uniform ZMod q) with negligible probability.

Attack Game 12.6 for fair-coin multiplicative ElGamal over a group family ([BS23], Section 12.6, p. 495, and Section 12.6.2, pp. 499–500): draw the group description from setup n and run PKE.owExperiment on (elGamalProbExplicitCoinPKE n d).toPKE with the challenge message drawn from sampleGroupElem n d.

Replacing the three sampleExp draws (secret key, challenge message, and encryption coins) in elGamalOWProbGame by exact uniform draws on ZMod q changes Game.advantage by at most 3 / 2 ^ n.

The fair-coin one-way game elGamalOWProbGame and the CDH game of elGamalOWToCDHAdversary differ by at most 4 / 2 ^ n (3 / 2 ^ n from the challenger's three sampleExp draws and 1 / 2 ^ n from the reduction's draw of y).

Multiplicative ElGamal is one-way under CDH ([BS23], Section 12.6.2, p. 500; Attack Game 12.6 and Definition 12.5, p. 495): if CDH holds for F under setup, every uniform strict-PPT typed adversary succeeds in Attack Game 12.6 (elGamalOWProbGame) against the fair-coin scheme elGamalProbExplicitCoinPKE with negligible probability. Relative to the book's exact advantage equality (under Definition 2.8's negligible runtime-overflow model, p. 30), fair-coin sampleExp sampling adds a 4 / 2 ^ n statistical loss (advantage_elGamalOWProbGame_cdhGame_le).