Documentation

CslibFrontier.Crypto.Computational.ElGamal.Decodable

Decodable group-element ElGamal games and INDCPAOn without valid stand-ins #

In CslibFrontier/Crypto/Computational/ElGamal.lean, elGamalGroupCPAGameOn and elGamalMsgCPAGameOn parameterize the adversary's challenge check by a predicate valid : ℕ → List Bool → Msg → Msg → Bool paired with AdmitsGroupElements, because a general PrimeOrderGroupFamily has no efficient group-element membership test or decoder. Over a DecodablePrimeOrderGroupFamily:

The more general parameterized forms elGamalMsgCPAGameOn / elGamalGroupCPAGameOn, GeneralCipher.hashedElGamalCipherCPAGameOn, and DDH.indcpaOn_elGamalEncryptProb remain for arbitrary typed-message encoders (encodeBit), additional client-side challenge constraints such as equal bit-length (equalLengthWords), and generic PrimeOrderGroupFamily statements where F.encDesc need not have a decoder to recover d from pk : List Bool.

Main definitions #

Main results #

Ideal-sampling step #

elGamalGroupCPAGame draws exponents exactly uniformly at the PMF level, so the results about it are a step toward DDH.indcpaOn_elGamalGroupEncryptProb, not the cited result. They hold for an arbitrary setup law, while the native theorem fixes the group description at each security parameter.

@[reducible, inline]

Group-element ElGamal CPA experiment ([BS23], Exercise 11.5(a), p. 459) over a DecodablePrimeOrderGroupFamily, validating challenge messages directly with F.isElem (d, m₀) && F.isElem (d, m₁) without an external valid predicate.

Ideal-sampling step toward DDH.indcpaOn_elGamalGroupEncryptProb, not the cited result: in elGamalGroupCPAGame, whose key and challenge exponents are drawn exactly uniformly at the PMF level and whose challenge membership is enforced directly by F.isElem, the IND-CPA distinguishing advantage of adversary is bounded by the sum of the DDH advantages of elGamalGroupToDDHDistinguisher adversary false and elGamalGroupToDDHDistinguisher adversary true.

theorem Cslib.Crypto.DecodablePrimeOrderGroupFamily.DDH.negligible_elGamalGroupCPAGame_ideal {F : DecodablePrimeOrderGroupFamily} {setup : ℕ → PMF F.Desc} (hDDH : F.DDH setup) {adversary : Encryption.WordAdversary} (hA : adversary.IsPPT) :
Negligible fun (n : ℕ) => (F.elGamalGroupCPAGame setup adversary false n).advantage (F.elGamalGroupCPAGame setup adversary true n)

Ideal-sampling step toward DDH.indcpaOn_elGamalGroupEncryptProb, not the cited result: under DDH for any setup law, every uniform strict PPT Encryption.WordAdversary has negligible advantage in elGamalGroupCPAGame, whose key and challenge exponents are drawn exactly uniformly at the PMF level and whose challenge membership is enforced directly by F.isElem.

@[reducible, inline]

Challenge-pair admissibility predicate for native Encryption.INDCPAOn of multiplicative ElGamal over a parameterized group description family d : ℕ → F.Desc, testing whether both candidate words represent group elements in F.Carrier (d n).

On the point-mass setup fun n => PMF.pure (d n), elGamalGroupValid d admits only group elements under the identity word message encoding.

Group-element multiplicative ElGamal satisfies Encryption.INDCPAOn under DDH for any DecodablePrimeOrderGroupFamily and polynomial-time group description family d : ℕ → F.Desc, with admissibility defined directly by F.elGamalGroupValid d (no external valid, hvalid, or AdmitsGroupElements arguments).