Documentation

CslibFrontier.Crypto.Computational.DiffieHellman.Order

The expected inverse group order is negligible under CDH and DDH #

If a prime-order group family satisfies CDH or DDH for a setup distribution, then the expected inverse group order n ↦ ∑' d, setup n d * (F.order d)⁻¹ is negligible, with no separate lower-bound hypothesis on the group orders. Under CDH, the adversary always outputs the identity element 0 and succeeds whenever a = 0 or b = 0 (so at least when a = 0, which occurs with probability 1 / q). Under DDH, the distinguisher tests whether the candidate shared element is the identity: it succeeds with probability 1 / q + (q - 1) / q² on real triples and 1 / q on random ones, so the expected inverse order is at most twice its advantage. The DDH bound is not derived from the CDH bound, because DDH.cdh, which turns DDH into CDH, itself needs a negligible inverse-order bound as a hypothesis.

Clients can use these bounds without importing Naor–Reingold or ElGamal.

Main results #

References #

theorem Cslib.Crypto.PrimeOrderGroupFamily.DDH.negligible_expected_inv_order {F : PrimeOrderGroupFamily} {setup : ℕ → PMF F.Desc} (hDDH : F.DDH setup) :
Negligible fun (n : ℕ) => (∑' (d : F.Desc), (setup n) d * (↑(F.order d))⁻¹).toNNReal

Expected inverse group order is negligible under DDH (original): if F.DDH setup holds, then n ↦ (∑' d, setup n d * (F.order d)⁻¹).toNNReal is negligible.

theorem Cslib.Crypto.PrimeOrderGroupFamily.CDH.negligible_expected_inv_order {F : PrimeOrderGroupFamily} {setup : ℕ → PMF F.Desc} (hCDH : F.CDH setup) :
Negligible fun (n : ℕ) => (∑' (d : F.Desc), (setup n) d * (↑(F.order d))⁻¹).toNNReal

Expected inverse group order is negligible under CDH (original): if F.CDH setup holds, then n ↦ (∑' d, setup n d * (F.order d)⁻¹).toNNReal is negligible.

theorem Cslib.Crypto.PrimeOrderGroupFamily.CDH.negligible_inv_order {F : PrimeOrderGroupFamily} {d : ℕ → F.Desc} (hCDH : F.CDH fun (n : ℕ) => PMF.pure (d n)) :
Negligible fun (n : ℕ) => (↑(F.order (d n)))⁻¹

Along a deterministic group-parameter schedule d : ℕ → F.Desc, F.CDH at fun n => PMF.pure (d n) implies that (F.order (d n) : ℝ≥0)⁻¹ is negligible ([BS23], §12.6.2, p. 500).

theorem Cslib.Crypto.PrimeOrderGroupFamily.advantage_bind_le_expected_inv_order (F : PrimeOrderGroupFamily) (setup : PMF F.Desc) (f g : F.Desc → Game) (h : ∀ (d : F.Desc), (f d).advantage (g d) ≤ (↑(F.order d))⁻¹) :
Game.advantage (setup.bind f) (setup.bind g) ≤ (∑' (d : F.Desc), setup d * (↑(F.order d))⁻¹).toNNReal

If Game.advantage (f d) (g d) ≤ (F.order d)⁻¹ for every group description d, then averaging over setup yields advantage at most (∑' d, setup d * (F.order d)⁻¹).toNNReal.