The Computational and Decisional Diffie–Hellman assumptions #
Over a PrimeOrderGroupFamily, the Computational Diffie–Hellman (CDH) experiment
([BS23], Attack Game 10.5) draws a group description d from a setup law and two
independent uniform exponents α, β : ZMod (F.order d), gives the adversary (d, encode (α • g), encode (β • g)), and accepts when the adversary outputs encode ((α * β) • g).
The Decisional Diffie–Hellman (DDH) experiment ([BS23], Attack Game 10.6) compares the
real tuple (d, encode (α • g), encode (β • g), encode ((α * β) • g)) against the ideal tuple
(d, encode (α • g), encode (β • g), encode (γ • g)) with an independent uniform γ.
We prove the implications DDH ⇒ CDH ⇒ DiscreteLog between the assumptions, the distributional
rerandomisation lemma underlying the random self-reducibility of DDH ([BS23],
Section 10.11, Exercises 10.8–10.9, pp. 425–426; ddhRerandomizeLaw_real and
ddhRerandomizeLaw_ideal), its word-level and game-level consequences
(encodeDDHRerandomize, ddhRerandomizeGame, ddhRerandomizeGame_real,
ddhRerandomizeGame_ideal, advantage_ddhRerandomizeGame_eq, DDH.ddhRerandomizeGame), an
original single-invocation worst-case-to-average-case DDH distinguishing reduction using
ProbComp.sampleModNat (ddhSampleModExponents, ddhSelfReduceDistinguisher,
ddhWorstCaseGame, advantage_ddhRerandomizeGame_ddhWorstCaseGame_le,
advantage_ddhRealGame_le_ddhWorstCaseGame, ddh_of_worstCase), and the worst-case DDH decider
of [BS23], Section 10.11, Exercise 10.10 (p. 426; ddhRealRefTuple, ddhIdealRefTuple,
ddhAmplifiedDecider, isPPTOn_ddhAmplifiedDecider, ddhAmplifiedDecider_error_le_pow,
negligible_ddhAmplifiedDecider_error), which amplifies an average-case distinguisher with
inverse-polynomial advantage via repeated random self-reduction trials and a Chernoff/Hoeffding
tail bound (ProbComp.countTrue_average_deviation_pow) so that it correctly decides every input
tuple (α • g, β • g, γ • g) except with negligible error probability. The Diffie–Hellman
assumptions are hypotheses, not theorems.
Main definitions #
Cslib.Crypto.PrimeOrderGroupFamily.cdhGame,Cslib.Crypto.PrimeOrderGroupFamily.CDH: the Computational Diffie–Hellman experiment and assumption.Cslib.Crypto.PrimeOrderGroupFamily.dlToCDHAdversary: the reduction from discrete logarithm to CDH.Cslib.Crypto.PrimeOrderGroupFamily.ddhRealGame,Cslib.Crypto.PrimeOrderGroupFamily.ddhIdealGame,Cslib.Crypto.PrimeOrderGroupFamily.DDH: the real and ideal Decisional Diffie–Hellman experiments and assumption.Cslib.Crypto.PrimeOrderGroupFamily.cdhToDDHDistinguisher: the reduction from CDH to DDH.Cslib.Crypto.PrimeOrderGroupFamily.ddhRerandomize,Cslib.Crypto.PrimeOrderGroupFamily.ddhRerandomizeLaw,Cslib.Crypto.PrimeOrderGroupFamily.encodeDDHRerandomize,Cslib.Crypto.PrimeOrderGroupFamily.ddhRerandomizeGame: algebraic, word-level, and game-level DDH rerandomisation ([BS23], Exercises 10.8–10.9, pp. 425–426).Cslib.Crypto.PrimeOrderGroupFamily.sampleExp: approximate uniform exponent sampling moduloF.order dviaProbComp.sampleModNatwith statistical distance at most1 / 2 ^ n.Cslib.Crypto.PrimeOrderGroupFamily.ddhSampleModExponents,Cslib.Crypto.PrimeOrderGroupFamily.sampleModZModLaw,Cslib.Crypto.PrimeOrderGroupFamily.ddhSelfReduceDistinguisher,Cslib.Crypto.PrimeOrderGroupFamily.ddhWorstCaseGame: original single-invocation worst-case-to-average-case DDH distinguishing reduction.Cslib.Crypto.PrimeOrderGroupFamily.ddhRealRefTuple,Cslib.Crypto.PrimeOrderGroupFamily.ddhIdealRefTuple,Cslib.Crypto.PrimeOrderGroupFamily.ddhAmplifiedDecider: reference DDH / non-DDH tuples and the Chernoff-amplified worst-case DDH decider ([BS23], Exercise 10.10, p. 426).
Main results #
Cslib.Crypto.PrimeOrderGroupFamily.succProbability_discreteLogGame_le_cdhGame,Cslib.Crypto.PrimeOrderGroupFamily.CDH.discreteLog:CDHimpliesDiscreteLog.Cslib.Crypto.PrimeOrderGroupFamily.succProbability_cdhGame_le_advantage_ddh_add,Cslib.Crypto.PrimeOrderGroupFamily.DDH.cdh,Cslib.Crypto.PrimeOrderGroupFamily.DDH.discreteLog:DDHimpliesCDHandDiscreteLogwhen1 / qis negligible.Cslib.Crypto.PrimeOrderGroupFamily.ddhRerandomizeLaw_real,Cslib.Crypto.PrimeOrderGroupFamily.ddhRerandomizeLaw_ideal: the distributional rerandomisation lemma for DDH tuples ([BS23], Exercises 10.8–10.9, pp. 425–426).Cslib.Crypto.PrimeOrderGroupFamily.encodeDDHRerandomize_encode,Cslib.Crypto.PrimeOrderGroupFamily.encodeDDHRerandomize_val,Cslib.Crypto.PrimeOrderGroupFamily.computableInPolyTime_encodeDDHRerandomize,Cslib.Crypto.PrimeOrderGroupFamily.ddhRerandomizeGame_real,Cslib.Crypto.PrimeOrderGroupFamily.ddhRerandomizeGame_ideal,Cslib.Crypto.PrimeOrderGroupFamily.advantage_ddhRerandomizeGame_eq,Cslib.Crypto.PrimeOrderGroupFamily.DDH.ddhRerandomizeGame: word-level and game-level consequences of Exercises 10.8–10.9 (pp. 425–426).Cslib.Crypto.PrimeOrderGroupFamily.isPPTOn_sampleExp,Cslib.Crypto.PrimeOrderGroupFamily.advantage_bind_sampleExp_le,Cslib.Crypto.PrimeOrderGroupFamily.isPPTOn_ddhSampleModExponents,Cslib.Crypto.PrimeOrderGroupFamily.dist_sampleModZModLaw_le,Cslib.Crypto.PrimeOrderGroupFamily.isPPTOn_ddhSelfReduceDistinguisher,Cslib.Crypto.PrimeOrderGroupFamily.advantage_ddhRerandomizeGame_ddhWorstCaseGame_le,Cslib.Crypto.PrimeOrderGroupFamily.advantage_ddhRealGame_le_ddhWorstCaseGame,Cslib.Crypto.PrimeOrderGroupFamily.ddh_of_worstCase: original single-invocation worst-case-to-average-case DDH distinguishing reduction.Cslib.Crypto.PrimeOrderGroupFamily.isPPTOn_ddhAmplifiedDecider,Cslib.Crypto.PrimeOrderGroupFamily.ddhAmplifiedDecider_error_le_pow,Cslib.Crypto.PrimeOrderGroupFamily.ddhAmplifiedDecider_correct_ge_one_sub_pow,Cslib.Crypto.PrimeOrderGroupFamily.negligible_ddhAmplifiedDecider_error: worst-case DDH decision with negligible error from an average-case distinguisher with inverse-polynomial advantage ([BS23], Exercise 10.10, p. 426).
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Version 0.6, Section 10.5 (Attack Games 10.5–10.6, pp. 409–410) and Section 10.11 (Exercises 10.7–10.10, pp. 425–426).
Computational Diffie–Hellman (CDH) #
The Computational Diffie–Hellman experiment ([BS23], Attack Game 10.5): draw a
description d and independent uniform α, β : ZMod (F.order d), give the adversary the
description and the encodings of α • g and β • g, and accept when it outputs the encoding of
(α * β) • g.
Instances For
The Computational Diffie–Hellman assumption for a family and a setup law: every uniform strict
PPT adversary computes encode ((α * β) • g) from (d, encode (α • g), encode (β • g)) with
negligible probability.
Instances For
Turn a discrete-logarithm adversary into a CDH adversary by running it on (d, encode (α • g))
to obtain a candidate exponent a and multiplying encode (β • g) by a.
Instances For
Whenever the discrete-logarithm adversary recovers α, dlToCDHAdversary outputs the valid
Diffie–Hellman shared element encode ((α * β) • g).
The discrete-logarithm-to-CDH reduction is uniform strict PPT when the discrete-logarithm adversary is.
CDH implies the discrete-logarithm assumption.
Decisional Diffie–Hellman (DDH) #
The real Decisional Diffie–Hellman experiment ([BS23], Attack Game 10.6): draw d
and independent uniform α, β : ZMod (F.order d), and give the distinguisher
(d, encode (α • g), encode (β • g), encode ((α * β) • g)).
Instances For
The ideal Decisional Diffie–Hellman experiment ([BS23], Attack Game 10.6): draw d
and independent uniform α, β, γ : ZMod (F.order d), and give the distinguisher
(d, encode (α • g), encode (β • g), encode (γ • g)).
Instances For
The Decisional Diffie–Hellman assumption for a family and a setup law: every uniform strict PPT
distinguisher has negligible advantage between ddhRealGame and ddhIdealGame.
Instances For
Turn a CDH adversary into a DDH distinguisher by testing whether its candidate shared element equals the challenge third element.
Instances For
In the ideal DDH game, cdhToDDHDistinguisher succeeds with probability at most 1 / m
whenever every supported group order is at least m.
Quantitative reduction from CDH to DDH: when every supported group at parameter n has
order at least m > 0, any CDH adversary's success probability is at most the DDH distinguishing
advantage of cdhToDDHDistinguisher plus 1 / m.
The CDH-to-DDH reduction is uniform strict PPT when the CDH adversary is.
DDH implies CDH when every supported group at parameter n has order at least m n > 0
and 1 / m n is negligible.
DDH implies the discrete-logarithm assumption when every supported group at parameter n
has order at least m n > 0 and 1 / m n is negligible.
Random self-reducibility of DDH #
Re-randomize a candidate DDH triple (u, v, w) in F.Carrier d using exponents
r, s₁, s₂ : ZMod (F.order d).
Instances For
Algebraic action of ddhRerandomize on multiples of the generator: a tuple error
γ - α * β is scaled by r and added to the new Diffie–Hellman product
(r * α + s₁) * (β + s₂).
The re-randomized triple distribution obtained by drawing r, s₁, s₂ : ZMod (F.order d)
independently and uniformly.
Instances For
The real DDH tuple distribution on F.Carrier d.
Instances For
The ideal DDH tuple distribution on F.Carrier d.
Instances For
Random self-reducibility of DDH (real case): re-randomizing any fixed real DDH tuple
(α • g, β • g, (α * β) • g) yields the exact uniform real DDH tuple distribution.
Random self-reducibility of DDH (ideal case): re-randomizing any fixed non-DDH tuple
(α • g, β • g, γ • g) with γ ≠ α * β yields the exact uniform ideal DDH tuple distribution.
Efficient word-level DDH random self-reduction #
Word-level DDH tuple re-randomization ([BS23], Exercises 10.8–10.9, pp. 425–426):
given (d, (u, v, w), r, s₁, s₂) on encoded group elements u, v, w : List Bool and
natural-number exponents r, s₁, s₂ : ℕ, evaluate the encoded tuple corresponding to
ddhRerandomize.
Instances For
encodeDDHRerandomize evaluates ddhRerandomize on encoded group elements.
Evaluating encodeDDHRerandomize at .val of exponents in ZMod (F.order d) agrees with
ddhRerandomize.
Word-level DDH tuple re-randomization is computable in polynomial time.
Sample one approximate uniform exponent modulo F.order d using n + |encNat (F.order d)|
fair coins via ProbComp.sampleModNat, within statistical distance 1 / 2 ^ n of exact uniform on
ZMod (F.order d).
Instances For
sampleExp is uniform strict PPT whenever n and d are computable in polynomial time.
Replacing one sampleExp n d draw by an exact uniform draw on ZMod (F.order d)
changes Game.advantage by at most 1 / 2 ^ n.
Sample three independent nearly-uniform exponents modulo F.order d at statistical distance
at most 1 / 2 ^ n each using ProbComp.sampleModNat ((F.order d).size + n) (F.order d)
(original).
Instances For
ddhSampleModExponents is uniform strict PPT (original).
Distribution of a single modular exponent sampled via ProbComp.sampleModNat at parameter n
and group description d, projected to ZMod (F.order d) (original).
Instances For
Each modular exponent sampled by ProbComp.sampleModNat ((F.order d).size + n) (F.order d)
is within statistical distance 1 / 2 ^ n of PMF.uniformOfFintype (ZMod (F.order d))
(original).
The single-invocation DDH random self-reduction distinguisher (original): given a DDH
distinguisher distinguisher, re-randomize an input tuple (d, u, v, w) by sampling
(r, s₁, s₂) ← F.ddhSampleModExponents n d, computing
(u', v', w') = F.encodeDDHRerandomize (d, (u, v, w), r, s₁, s₂), and running distinguisher on
(d, u', v', w').
Instances For
ddhSelfReduceDistinguisher is uniform strict PPT whenever distinguisher is (original).
Game-level DDH tuple re-randomization experiment ([BS23], Exercises 10.8–10.9,
pp. 425–426): draw d ← setup n and independent uniform r, s₁, s₂ : ZMod (F.order d),
re-randomize the encoded tuple tuple d using encodeDDHRerandomize, and run distinguisher.
Instances For
Re-randomizing any family of real DDH tuples (α d • g, β d • g, (α d * β d) • g) with
encodeDDHRerandomize produces the exact average-case ddhRealGame
([BS23], Exercises 10.8–10.9, pp. 425–426).
Re-randomizing any family of non-DDH tuples (α d • g, β d • g, γ d • g) with
γ d ≠ α d * β d on the support of setup n using encodeDDHRerandomize produces the exact
average-case ddhIdealGame ([BS23], Exercises 10.8–10.9, pp. 425–426).
DDH rerandomization advantage identity ([BS23], Exercises 10.8–10.9,
pp. 425–426): for any real DDH tuple family (α d, β d) and any non-DDH tuple family
(α' d, β' d, γ' d) with γ' d ≠ α' d * β' d on the support of setup n, the distinguishing
advantage after encodeDDHRerandomize equals the average-case DDH advantage.
DDH rerandomization indistinguishability ([BS23], Exercises 10.8–10.9,
pp. 425–426): under the average-case DDH assumption, no uniform strict PPT distinguisher can
distinguish the exact re-randomization of any real DDH tuple family from the exact re-randomization
of any non-DDH tuple family.
The worst-case DDH experiment on a fixed tuple family tuple (original): draw d ← setup n
and give the encoded tuple (d, encode (tuple d).1, encode (tuple d).2.1, encode (tuple d).2.2)
directly to distinguisher.
Instances For
Statistical distance bound for ddhSelfReduceDistinguisher (original): replacing the three
exact uniform ZMod (F.order d) exponents in ddhRerandomizeGame with
ddhSampleModExponents n d changes the game output distribution by at most 3 / 2 ^ n.
Quantitative single-invocation worst-case-to-average-case DDH reduction (original): the
average-case DDH advantage of distinguisher is at most the worst-case DDH advantage of
ddhSelfReduceDistinguisher distinguisher plus 6 / 2 ^ n.
Average-case DDH from worst-case DDH via ddhSelfReduceDistinguisher (original): if a
worst-case real DDH tuple family is indistinguishable from a worst-case non-DDH tuple family for
all uniform strict PPT distinguishers, then F.DDH setup holds.
Canonical encoded real DDH tuple (0 • g, 0 • g, (0 * 0) • g) for group description d,
computed in polynomial time via F.smul (d, 0, F.encode d (F.generator d))
([BS23], Section 10.11, Exercise 10.10, p. 426).
Instances For
Canonical encoded non-DDH tuple (0 • g, 0 • g, 1 • g) for group description d
(since 1 ≠ 0 * 0 in ZMod (F.order d) for prime F.order d;
[BS23], Section 10.11, Exercise 10.10, p. 426).
Instances For
ddhRealRefTuple equals the encoded tuple ((0 : ZMod q) • g, (0 : ZMod q) • g, ((0 : ZMod q) * 0) • g).
ddhIdealRefTuple equals the encoded tuple ((0 : ZMod q) • g, (0 : ZMod q) • g, (1 : ZMod q) • g).
ddhRealRefTuple is computable in polynomial time.
ddhIdealRefTuple is computable in polynomial time.
On a deterministic group setup fun _ => PMF.pure d, ddhWorstCaseGame evaluates
distinguisher directly on (d, encode (tuple d)).
Single-trial real DDH proximity: on any fixed group d and any real DDH triple
(α • g, β • g, (α * β) • g), the acceptance probability of ddhSelfReduceDistinguisher differs
from the average-case ddhRealGame (fun _ => PMF.pure d) acceptance probability by at most
3 / 2 ^ n.
Single-trial non-DDH proximity: on any fixed group d and any non-DDH triple
(α • g, β • g, γ • g) with γ ≠ α * β, the acceptance probability of
ddhSelfReduceDistinguisher differs from the average-case ddhIdealGame (fun _ => PMF.pure d)
acceptance probability by at most 3 / 2 ^ n.
Chernoff-amplified worst-case DDH decider ([BS23], Section 10.11, Exercise 10.10,
p. 426): given an average-case DDH distinguisher distinguisher and an inverse-advantage bound
invEps : ℕ → ℕ, perform N = (n + 3) * (7 * invEps n) ^ 2 independent trials of
ddhSelfReduceDistinguisher on the input tuple (d, u, v, w), on the reference DH tuple
ddhRealRefTuple d, and on the reference non-DH tuple ddhIdealRefTuple d, and accept iff the
empirical count cIn is at least as close to cReal as to cIdeal.
Instances For
ddhAmplifiedDecider is uniform strict PPT whenever distinguisher is uniform strict PPT and
invEps is computable in polynomial time in unary ([BS23], Exercise 10.10, p. 426).
Quantitative worst-case DDH decision bound ([BS23], Section 10.11, Exercise 10.10,
p. 426): if distinguisher n has average-case DDH advantage at least 1 / invEps n on group d
and the modular-sampling bias satisfies 3 / 2 ^ n ≤ 1 / (12 * invEps n), then for every
triple (α • g, β • g, γ • g) over d, ddhAmplifiedDecider outputs an answer different from
decide (γ = α * β) with probability at most (1 / 2) ^ n.
Directional correctness of ddhAmplifiedDecider ([BS23], Section 10.11,
Exercise 10.10, p. 426): under the hypotheses of ddhAmplifiedDecider_error_le_pow, on every
triple (α • g, β • g, γ • g) over d, ddhAmplifiedDecider outputs the correct decision
decide (γ = α * β) with probability at least 1 - (1 / 2) ^ n.
Boneh–Shoup Exercise 10.10 (Worst-case DDH decider with negligible error, p. 426):
if invEps is computable in polynomial time in unary and distinguisher has average-case DDH
advantage at least 1 / invEps n on d n eventually, then for every worst-case sequence of
input tuples (d n, α n, β n, γ n), ddhAmplifiedDecider decides whether γ n = α n * β n with
negligible error probability.