Discrete-logarithm and Diffie–Hellman experiments in a fixed group #
Fix an additive commutative group G that is a ZMod q-module, and an element g : G. Groups
are written additively, so the textbook element g^a is a • g and g^(ab) is (a * b) • g.
This module states the discrete-logarithm (DL), Computational Diffie–Hellman (CDH) and Decisional
Diffie–Hellman (DDH) experiments of [BS23], Attack Games 10.4, 10.5 and 10.6, for this
one group. Adversaries receive and return group elements and exponents; there are no encodings,
security parameter or setup. Each experiment is an Experiment, a program read as the
challenger's steps, and is evaluated only where its advantage is defined.
The definitions place no hypothesis on G, q or g. Results that use them state what they
need, for example that g generates G. The asymptotic assumptions over a family of prime-order
groups are in CslibFrontier/Crypto/Computational/DiscreteLog.lean and
CslibFrontier/Crypto/Computational/DiffieHellman.lean.
Main definitions #
Cslib.Crypto.dlExperiment,Cslib.Crypto.dlAdvantage: Attack Game 10.4 and its success probability.Cslib.Crypto.cdhExperiment,Cslib.Crypto.cdhAdvantage: Attack Game 10.5 and its success probability.Cslib.Crypto.ddhRealExperiment,Cslib.Crypto.ddhRandomExperiment,Cslib.Crypto.ddhAdvantage: the two worlds of Attack Game 10.6 and their distinguishing advantage.Cslib.Crypto.dlToCDH,Cslib.Crypto.cdhToDDH: the elementary reductions from DL to CDH and from CDH to DDH.
Main results #
Cslib.Crypto.uniformOfFintype_bind_smul_add: when every element ofGis a multiple ofg, masking by a uniformc • ghides any fixed element (the one-time group mask).Cslib.Crypto.uniformOfFintype_bind_smul: whenc ↦ c • gis a bijectionZMod q → G, the elementc • gfor uniformcis uniform onG.Cslib.Crypto.dlAdvantage_le_cdhAdvantage_dlToCDH: DL advantage is at most the CDH advantage ofdlToCDH, with no hypothesis on the group.Cslib.Crypto.cdhAdvantage_le_ddhAdvantage_cdhToDDH_add: whenc ↦ c • gis injective onZMod q(that is,ghas orderq), CDH advantage is at most the DDH advantage ofcdhToDDHplus1 / q. Its two one-sided parts,ddhRealExperiment_cdhToDDHandprobability_ddhRandomExperiment_cdhToDDH_le, average over a setup law separately.
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Section 10.5, Attack Games 10.4, 10.5 and 10.6.
Discrete logarithm #
The discrete-logarithm experiment ([BS23], Attack Game 10.4) in the group generated
by g: the challenger draws a uniform exponent a and gives the adversary a • g (the textbook
g^a); the adversary wins when it outputs a.
The discrete-logarithm advantage of A: its success probability in dlExperiment.
Computational Diffie–Hellman #
The Computational Diffie–Hellman experiment ([BS23], Attack Game 10.5) in the group
generated by g: the challenger draws uniform exponents a and b and gives the adversary
a • g and b • g (the textbook g^a and g^b); the adversary wins when it outputs
(a * b) • g.
The CDH advantage of A: its success probability in cdhExperiment.
Decisional Diffie–Hellman #
The real world of the Decisional Diffie–Hellman experiment ([BS23], Attack Game
10.6, Experiment 0) in the group generated by g: the challenger draws uniform exponents a and
b and gives the distinguisher a • g, b • g and (a * b) • g. The book's challenger also
draws the unused γ; omitting it does not change the distribution.
The random world of the Decisional Diffie–Hellman experiment ([BS23], Attack Game
10.6, Experiment 1) in the group generated by g: the challenger draws independent uniform
exponents a, b and c and gives the distinguisher a • g, b • g and c • g.
The DDH advantage of D: its distinguishing advantage between ddhRealExperiment and
ddhRandomExperiment.
The law of ddhRealExperiment: uniform exponents a and b sampled at the PMF level.
The law of ddhRandomExperiment: uniform exponents a, b and c sampled at the PMF
level.
Reductions #
The discrete-logarithm-to-CDH reduction: given (u, v), ask the discrete-logarithm adversary
A for the exponent of u, and multiply v by its answer. When A returns a with u = a • g
and v = b • g, the output is (a * b) • g.
The CDH-to-DDH reduction: given (u, v, w), ask the CDH adversary A for the shared element
of u and v, and answer whether it is w.
Uniform masks #
One-time group mask: when every element of G is a multiple of g, adding a fixed m to
c • g for uniform c : ZMod q leaves the distribution of c • g unchanged.
When c ↦ c • g is a bijection ZMod q → G (that is, g generates G and G has q
elements), the element c • g for uniform c : ZMod q is uniform on G.
Concrete bounds #
DL is at least as hard as CDH: whenever A finds a from a • g, dlToCDH A outputs
a • (b • g) = (a * b) • g. No hypothesis on G, q or g is needed.
In the real DDH world, cdhToDDH A runs the CDH experiment for A.
In the random DDH world, cdhToDDH A accepts with probability at most 1 / q when g has
order q: the independent c • g equals the adversary's output for at most one c. Injectivity
of c ↦ c • g holds when g generates G and Nat.card G = q, and, for prime q, when
g ≠ 0 (smul_left_injective).
CDH is at least as hard as DDH, up to 1 / q ([BS23], Section 10.5): when g
has order q, the CDH advantage of A is at most the DDH advantage of cdhToDDH A plus
1 / q.