Documentation

CslibFrontier.Crypto.Computational.ElGamal.ExplicitCoin

Multiplicative ElGamal over a fixed group #

Section 12.6.2 of Boneh and Shoup ([BS23], printed pp. 499–500) defines multiplicative ElGamal over a cyclic group 𝔾 of prime order q generated by g: G_a() draws α ←R ℤ_q and outputs (g^α, α), E_a(u, x; β) outputs (g^β, u^β x), and D_a(α, (v, y)) outputs y / v^α.

elGamalExplicitCoinPKEWith q g sample is this scheme in additive notation over a ZMod q-module G, parameterized by the exponent sampler sample : ProbComp (ZMod q), and elGamalExplicitCoinPKE q g specializes sample to the exact uniform distribution $ᵗ ZMod q (for q ≠ 0). The definition and its correctness (elGamalExplicitCoinPKEWith_correct) need neither q ≠ 0, that q is prime, nor that g generates G. The module imports no group family: the fair-coin instantiation with PrimeOrderGroupFamily.sampleExp is in CslibFrontier/Crypto/Computational/ElGamal/ProbComp.lean, and the reduction to CDH is in CslibFrontier/Crypto/Computational/ElGamal/OneWay.lean.

Main definitions #

Main results #

References #

def Cslib.Crypto.elGamalExplicitCoinPKEWith {G : Type} [AddCommGroup G] (q : ℕ) [Module (ZMod q) G] (g : G) (sample : ProbComp (ZMod q)) :

Multiplicative ElGamal ([BS23], Section 12.6.2, pp. 499–500) in additive notation over the group generated by g, drawing both the secret key α and the encryption coins β from sample : ProbComp (ZMod q): the public key is α • g, a message x is encrypted with coins β as (β • g, β • u + x), and a ciphertext (v, y) decrypts to y - α • v.

@[reducible, inline]
noncomputable abbrev Cslib.Crypto.elGamalExplicitCoinPKE {G : Type} [AddCommGroup G] (q : ℕ) [Module (ZMod q) G] (g : G) [NeZero q] :

Multiplicative ElGamal ([BS23], Section 12.6.2, pp. 499–500) in additive notation over the group generated by g, with exact uniform exponents $ᵗ ZMod q.

Multiplicative ElGamal decrypts every honest encryption correctly, for any exponent sampler.