Homomorphism of Multiplicative ElGamal and Equivalence of Semantic Security with DDH #
Multiplicative ElGamal ([BS23], Exercise 11.5, printed p. 459) encrypts a group element
m : F.Carrier d under public key u = α • g as (v, e) = (β • g, β • u + m) (written additively
on F.Carrier d, matching CslibFrontier/Crypto/Computational/ElGamal.lean) and decrypts (v, e)
to e - α • v. This module formalizes parts (b) and (c) of Exercise 11.5:
Homomorphic ciphertext combination ([BS23], Exercise 11.5(c), p. 459): Adding two algebraic ciphertexts on
F.Carrier d × F.Carrier dadds both their plaintexts and their randomness exponents (elGamalEncrypt_add), and decryption is a homomorphism (elGamalDecrypt_add). On encoded ciphertexts,elGamalAddCiphertextappliesF.addto the two framed components in polynomial time (computableInPolyTime_elGamalAddCiphertext). Because every canonical residue belowF.order (d n)lies in the support ofF.sampleExp n (d n), combining any two ciphertexts in the support ofelGamalEncryptProbunder an honest public key produces a ciphertext in the support ofelGamalEncryptProbform₁ + m₂(elGamalAddCiphertext_mem_support_elGamalEncryptProb) that decrypts toencode (m₁ + m₂)(elGamalDecryptDet_elGamalAddCiphertext).Semantic security implies DDH ([BS23], Exercise 11.5(b), p. 459): Given a word-level DDH distinguisher
Wand group scheduled : ℕ → F.Desc, the two-stage adversaryddhWordToElGamalAdversary d Wsamplesc ← F.sampleExp n (d n), submits the challenge pair(encode 0, encode (c • g))with saved statepk, and runsWon(d n, u, v, e). In worldfalse, the unused drawcdrops out and(u, v, e) = (α • g, β • g, (α * β) • g)reproducesddhRealGame(ddhRealGame_eq_elGamalGroupCPAGameOn_false). In worldtrue,e = (α * β) • g + c • gis within statistical distance1 / 2 ^ nof a uniform group element (ddhRandomGame,advantage_elGamalGroupCPAGameOn_true_ddhRandomGame_le), and within5 / 2 ^ nin the nativeEncryption.gameOnexperiment (advantage_ddhGame_le_gameOn, adding2 / 2 ^ nin each world forelGamalKeyGenProbandelGamalEncryptProb). Throughddh_iff_encoded, semantic security therefore impliesF.DDH(ddh_of_indcpaOn_elGamalGroupEncryptProb), yielding the two-sided characterizationindcpaOn_elGamalGroupEncryptProb_iff_ddhover aDecodablePrimeOrderGroupFamily. Here each public groupF.Carrier (d n)carries a constant effective-length function (§2.3.2, Definition 2.9 and Example 2.13(4), pp. 30–31; Attack Game 11.1 and Definition 11.3(2), pp. 436–438), soelGamalGroupValidadmits every encoded group-element pair—including(encode 0, encode (c • g))when serialized wire lengths differ—rather than requiring equal serialized bit lengths. The equivalence is asymptotic; the exact forward2εbound of Exercise 11.5(a) remains open. Callers obtain¬ DDH → ¬ INDCPAOnviamt(mt (F.indcpaOn_elGamalGroupEncryptProb_iff_ddh hd).mp).
Main definitions #
Cslib.Crypto.PrimeOrderGroupFamily.elGamalAddCiphertext: polynomial-time componentwise addition of encoded multiplicative ElGamal ciphertexts ([BS23], Exercise 11.5(c), p. 459).Cslib.Crypto.PrimeOrderGroupFamily.ddhWordToElGamalAdversary: chosen-plaintext adversary reducing word-level DDH to group-element multiplicative ElGamal IND-CPA ([BS23], Exercise 11.5(b), p. 459).
Main results #
Cslib.Crypto.PrimeOrderGroupFamily.elGamalEncrypt_add,Cslib.Crypto.PrimeOrderGroupFamily.elGamalDecrypt_add: algebraic homomorphisms of ElGamal encryption and decryption.Cslib.Crypto.PrimeOrderGroupFamily.computableInPolyTime_elGamalAddCiphertext,Cslib.Crypto.PrimeOrderGroupFamily.elGamalAddCiphertext_encodeElGamalEncrypt,Cslib.Crypto.PrimeOrderGroupFamily.elGamalAddCiphertext_mem_support_elGamalEncryptProb,Cslib.Crypto.PrimeOrderGroupFamily.elGamalDecryptDet_elGamalAddCiphertext: polynomial-time word-level homomorphism, support closure onelGamalEncryptProb, and decryption correctness ([BS23], Exercise 11.5(c), p. 459).Cslib.Crypto.PrimeOrderGroupFamily.isPPT_ddhWordToElGamalAdversary,Cslib.Crypto.PrimeOrderGroupFamily.advantage_ddhGame_le_gameOn,Cslib.Crypto.PrimeOrderGroupFamily.ddh_of_indcpaOn_elGamalGroupEncryptProb,Cslib.Crypto.DecodablePrimeOrderGroupFamily.indcpaOn_elGamalGroupEncryptProb_iff_ddh: uniform strict-PPT certificate, nativeEncryption.gameOnbound, and equivalence between nativeINDCPAOnsecurity and DDH ([BS23], Exercise 11.5(a)–(b), p. 459).
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Version 0.6, Exercise 11.5(a)–(c) (printed p. 459).
Algebraic homomorphism of multiplicative ElGamal encryption ([BS23],
Exercise 11.5(c), p. 459, written additively): componentwise addition of two ciphertexts under the
same public key u yields the encryption of m₁ + m₂ with randomness β₁ + β₂.
Algebraic homomorphism of multiplicative ElGamal decryption ([BS23], Exercise 11.5(c), p. 459, written additively): decrypting the sum of two ciphertexts equals the sum of their decryptions.
Word-level homomorphic ciphertext combination for multiplicative ElGamal ([BS23],
Exercise 11.5(c), p. 459): add both framed group-element components of ct₁ and ct₂ using
F.add.
On encoded group elements, elGamalAddCiphertext adds both ciphertext components in
F.Carrier d.
elGamalAddCiphertext is computable in polynomial time.
Word-level encryption homomorphism ([BS23], Exercise 11.5(c), p. 459): combining
two encodeElGamalEncrypt ciphertexts under encode u with exponents b₁, b₂ : ℕ yields the
encodeElGamalEncrypt ciphertext for m₁ + m₂ with exponent b₁ + b₂.
Homomorphic support closure on elGamalEncryptProb ([BS23], Exercise 11.5(c),
p. 459): for any honest key pair (pk, sk) in the support of elGamalKeyGenProb d n and any
ciphertexts ct₁, ct₂ in the supports of elGamalEncryptProb for encode m₁ and encode m₂,
elGamalAddCiphertext (d n) ct₁ ct₂ lies in the support of elGamalEncryptProb for
encode (m₁ + m₂).
Decryption of homomorphically combined elGamalEncryptProb ciphertexts
([BS23], Exercise 11.5(c), p. 459): for any honest key pair (pk, sk) and honest
encryptions ct₁, ct₂ of encode m₁, encode m₂, decrypting
elGamalAddCiphertext (d n) ct₁ ct₂ recovers encode (m₁ + m₂).
Chosen-plaintext adversary reducing word-level DDH to group-element multiplicative ElGamal
([BS23], Exercise 11.5(b), p. 459): for group schedule d : ℕ → F.Desc and word-level DDH
distinguisher W, choose samples c ← F.sampleExp n (d n) and submits
(encode 0, encode (c • g)) with saved state pk, and guess runs W on (d n, u, v, e) where
u = dropFrame pk, v = unframe ct, and e = dropFrame ct.
ddhWordToElGamalAdversary is uniform strict PPT whenever d is computable in polynomial time
and W is uniform strict PPT.
Quantitative reduction from word-level DDH to native Encryption.gameOn (after
[BS23], Exercise 11.5(b), p. 459; this step bounds DDH advantage with 5 / 2 ^ n
fair-coin sampling slack rather than stating the asymptotic contrapositive): on a parameterized
group family d : ℕ → F.Desc, DDH advantage is at most the native CPA advantage of
ddhWordToElGamalAdversary d W plus 5 / 2 ^ n.
Native INDCPAOn security of group-element multiplicative ElGamal implies DDH
([BS23], Exercise 11.5(b), p. 459): for a polynomial-time group description family
d : ℕ → F.Desc and any admissibility predicate valid admitting all pairs of encoded group
elements at d n, INDCPAOn valid encBits (F.elGamalKeyGenProb d) (F.elGamalEncryptProb (fun _ m => m) d) implies F.DDH (fun n => PMF.pure (d n)) (without needing a decoder for
F.encDesc or DecodablePrimeOrderGroupFamily). Admitting every encoded group-element pair—so
the reduction's (encode 0, encode (c • g)) is valid even when serialized wire lengths
differ—models Attack Game 11.1 and Definition 11.3(2) (pp. 436–438) under a constant
effective-length function on each public group F.Carrier (d n) (§2.3.2, Definition 2.9 and
Example 2.13(4), pp. 30–31), as opposed to equality of serialized bit lengths. Callers obtain
¬ DDH → ¬ INDCPAOn via mt.
Native Encryption.INDCPAOn security of group-element multiplicative ElGamal is equivalent
to DDH ([BS23], Exercise 11.5(a)–(b), p. 459): for any DecodablePrimeOrderGroupFamily
and polynomial-time group description family d : ℕ → F.Desc, (F.elGamalKeyGenProb d, F.elGamalEncryptProb (fun _ m => m) d) satisfies INDCPAOn (F.elGamalGroupValid d) encBits if and
only if F.toPrimeOrderGroupFamily.DDH (fun n => PMF.pure (d n)) holds. Here elGamalGroupValid
accepts every pair of encoded elements of F.Carrier (d n), modeling Attack Game 11.1 and
Definition 11.3(2) (pp. 436–438) under a constant effective-length function on each public group
(§2.3.2, Definition 2.9 and Example 2.13(4), pp. 30–31)—so (encode 0, encode (c • g)) is
admissible in the reverse reduction even when serialized wire lengths differ—rather than requiring
equal serialized bit lengths. This equivalence is asymptotic; the exact concrete forward bound 2ε
of Exercise 11.5(a) remains open. When DDH fails in d, multiplicative ElGamal is not semantically
secure (mt (F.indcpaOn_elGamalGroupEncryptProb_iff_ddh hd).mp).