Documentation

CslibFrontier.Crypto.Computational.GenericGroup.DiffieHellman

Computational Diffie–Hellman in the generic group model #

A lower bound for computational Diffie–Hellman (CDH) in the generic group model of [BS23], Section 16.3: part (a) of Exercise 16.5 (p. 708), which asks to adapt the proof of Theorem 16.3 to CDH. The bound is not stated in the book: the exercise states none, and the one below is what the adapted proof gives. For prime q, an adversary that makes at most T queries to the group oracle outputs the label of α β with probability at most ((3T + 4)² / 2 + 2) / q.

cdhGame A draws a uniform injective labeling L : ZMod q ↪ S and uniform α β : ZMod q, gives the adversary L 1, L α and L β, runs it against the group oracle of L (runLabeled), and wins when it outputs L (α * β). As for Cslib.Crypto.GenericGroup.dlogGame, the budget is ProbOracleComp.IsQueryBounded: at most T labeling and group-operation queries on every path, whatever the adversary's private coins. Since the adversary outputs a label, the game compares elements of S and takes DecidableEq S, which dlogGame does not need.

This is a query bound in an idealized model: it assumes no computational hardness, says nothing about CDH in any specific group, and applies to adversaries that are otherwise unbounded.

The proof is an instance of Cslib.Crypto.GenericGroup.succProbability_linearGame_le, the bound for games with linear inputs, with two unknowns α and β, one output label, and the test that the output is the label of α β. It differs from the bound of Theorem 16.3 in two places.

  1. The table of linear forms holds at most 3T + 4 forms, not 3T + 2: one more for the second challenge L β, and one for the output, whose form the challenger looks up because the output is a label, where a discrete-logarithm adversary outputs an exponent.
  2. The guess term is 2 / q, not 1 / q: the output is a fixed linear form a X + b Y + c, and X Y = a X + b Y + c holds at no more than 2q - 1 of the q² points when q is prime, where a guess of the discrete logarithm is right at one point in q.

q is prime, as in Theorem 16.3; the proof uses it twice, for collisions between two distinct linear forms and for the count of solutions of X Y = a X + b Y + c. The bound is not claimed for composite q, and it fails there: for q = 2¹⁰, recovering α bit by bit and then asking for the label of α β wins with probability one using 12 queries, where the sharp form gives 391 / 512. That attack was checked by computation and is not formalized. Part (b) of the exercise, the interactive CDH (ICDH) problem of Definition 12.4, is not formalized here.

Main definitions #

Main results #

References #

noncomputable def Cslib.Crypto.GenericGroup.cdhGame {q : ℕ} {S : Type} [NeZero q] [Fintype S] [DecidableEq S] [Nonempty (ZMod q ↪ S)] (A : S → S → S → ProbOracleComp (GroupOracleSpec q S) S) :

The CDH game in the generic group model ([BS23], Exercise 16.5(a)): a uniform injective labeling L and uniform α and β; the adversary gets L 1, L α and L β, runs against the group oracle of L, and wins when it outputs L (α * β).

theorem Cslib.Crypto.GenericGroup.succProbability_cdhGame_le_choose {q : ℕ} {S : Type} [NeZero q] [Fintype S] [DecidableEq S] [Nonempty (ZMod q ↪ S)] (hq : Nat.Prime q) {T : ℕ} {A : S → S → S → ProbOracleComp (GroupOracleSpec q S) S} (hA : ∀ (g u v : S), (A g u v).IsQueryBounded T) :
(cdhGame A).succProbability ≤ ↑((3 * T + 4).choose 2 + 2) / ↑q

CDH in the generic group model, sharp form ([BS23], Exercise 16.5(a)). For prime q and an adversary that makes at most T queries to the group oracle on every path, the CDH game in the generic group model is won with probability at most ((3T + 4).choose 2 + 2) / q.

theorem Cslib.Crypto.GenericGroup.succProbability_cdhGame_le {q : ℕ} {S : Type} [NeZero q] [Fintype S] [DecidableEq S] [Nonempty (ZMod q ↪ S)] (hq : Nat.Prime q) {T : ℕ} {A : S → S → S → ProbOracleComp (GroupOracleSpec q S) S} (hA : ∀ (g u v : S), (A g u v).IsQueryBounded T) :
(cdhGame A).succProbability ≤ ((3 * ↑T + 4) ^ 2 / 2 + 2) / ↑q

CDH in the generic group model ([BS23], Exercise 16.5(a), in the form of (16.6)). For prime q and an adversary that makes at most T queries to the group oracle on every path, the CDH game in the generic group model is won with probability at most ((3T + 4)² / 2 + 2) / q.

theorem Cslib.Crypto.GenericGroup.le_of_half_le_succProbability_cdhGame {q : ℕ} {S : Type} [NeZero q] [Fintype S] [DecidableEq S] [Nonempty (ZMod q ↪ S)] (hq : Nat.Prime q) {T : ℕ} {A : S → S → S → ProbOracleComp (GroupOracleSpec q S) S} (hA : ∀ (g u v : S), (A g u v).IsQueryBounded T) (h : 1 / 2 ≤ (cdhGame A).succProbability) :
q ≤ (3 * T + 4) ^ 2 + 4

Success probability one half ([BS23], Exercise 16.5(a)). For prime q, an adversary that makes at most T queries to the group oracle on every path and wins the CDH game with probability at least 1 / 2 has q ≤ (3T + 4)² + 4: T is at least about √q / 3.