Deterministic oracle reductions among Diffie–Hellman problems in a fixed group #
[BS23], Exercise 10.17 (p. 429), asks for deterministic polynomial-time equivalences
among four computational Diffie–Hellman problems in a cyclic group of prime order. This module
formalizes explicit deterministic OracleComp programs in a fixed ZMod q-module G, proofs of
correctness under OracleComp.evalPure against every solver that is correct on its domain, and
solver call counts under OracleComp.IsQueryBounded (and OracleComp.QueriesSatisfy where a
solver's domain excludes 0); group operations, scalar multiplications, and running time are
not counted. The correctness theorems are therefore steps toward Exercise 10.17, not the cited
result: the exercise's reductions are deterministic algorithms whose running time, apart from the
solver calls, is polynomial in the input length, and no such bound is proved here (#5293).
For a modulus q : ℕ and element g : G, written additively (α • g for g ^ α):
SolvesCDH: (a) CDH, computing(α * β) • gfrom(α • g, β • g).SolvesSqDH: (b) Square-DH, computing(α ^ 2) • gfromα • g.SolvesInvDH: (c) Inverse-DH, computingα⁻¹ • gfromα • gwhenα ≠ 0.SolvesDivDH: (d) Divisible-DH, computing(α * β⁻¹) • gfrom(α • g, β • g)whenβ ≠ 0.
Main definitions #
Cslib.Crypto.SolvesCDH,Cslib.Crypto.SolvesSqDH,Cslib.Crypto.SolvesInvDH,Cslib.Crypto.SolvesDivDH: domain-correctness predicates for solvers of problems (a)–(d).Cslib.Crypto.cdhFromSqProg: reduces CDH to Square-DH in at most2queries.Cslib.Crypto.sqFromCDHProg: reduces Square-DH to CDH in1query.Cslib.Crypto.sqFromInvProg: reduces Square-DH to Inverse-DH in at most3queries.Cslib.Crypto.invFromDivProg: reduces Inverse-DH to Divisible-DH in at most1query.Cslib.Crypto.invFromCDHStep,Cslib.Crypto.invFromCDHProg: reduces Inverse-DH to CDH by square-and-multiply forα ^ (q - 2)in at most2 * (q - 2).bits.lengthqueries.Cslib.Crypto.divFromCDHProg: reduces Divisible-DH to CDH in at most2 * (q - 2).bits.length + 1queries.
Main results #
Cslib.Crypto.solvesCDH_evalPure_cdhFromSqProg,Cslib.Crypto.isQueryBounded_cdhFromSqProg: correctness (for primeq) and query bound for(a) ≤ (b).Cslib.Crypto.solvesSqDH_evalPure_sqFromCDHProg,Cslib.Crypto.isQueryBounded_sqFromCDHProg: correctness and query bound for(b) ≤ (a).Cslib.Crypto.solvesSqDH_evalPure_sqFromInvProg,Cslib.Crypto.isQueryBounded_sqFromInvProg,Cslib.Crypto.queriesSatisfy_sqFromInvProg: correctness (for primeq), query bound, and nonzero-query invariant for(b) ≤ (c).Cslib.Crypto.solvesInvDH_evalPure_invFromDivProg,Cslib.Crypto.isQueryBounded_invFromDivProg,Cslib.Crypto.queriesSatisfy_invFromDivProg: correctness (for primeq), query bound, and nonzero-second-coordinate invariant for(c) ≤ (d).Cslib.Crypto.solvesInvDH_evalPure_invFromCDHProg,Cslib.Crypto.isQueryBounded_invFromCDHProg: correctness (for primeq) and query bound for(c) ≤ (a).Cslib.Crypto.solvesDivDH_evalPure_divFromCDHProg,Cslib.Crypto.isQueryBounded_divFromCDHProg: correctness (for primeq) and query bound for(d) ≤ (a).
References #
- [BS23], Chapter 10, Exercise 10.17, p. 429.
A deterministic solver solves (a) CDH with respect to g when on
(α • g, β • g) it returns (α * β) • g.
A deterministic solver solves (b) Square-DH with respect to g
when on α • g it returns (α ^ 2) • g.
A deterministic solver solves (c) Inverse-DH with respect to g
when on α • g with α ≠ 0 it returns α⁻¹ • g.
A deterministic solver solves (d) Divisible-DH with respect to g
when on (α • g, β • g) with β ≠ 0 it returns (α * β⁻¹) • g.
Deterministic oracle reduction (a) CDH ≤ (b) Square-DH: for q = 2, returns 0 if
u = 0 and v otherwise (since α, β ∈ {0, 1} gives α * β = β if α = 1, 0 if α = 0);
for odd prime q, evaluates (4 : ZMod q)⁻¹ • (sq (u + v) - sq (u - v)) in 2 queries.
cdhFromSqProg makes at most 2 oracle calls on every execution path.
Correctness of (a) CDH ≤ (b) Square-DH, a step toward [BS23], Exercise 10.17
(p. 429), not the cited result, which also bounds the reduction's running time (only solver calls
are counted, #5293): for prime q, any Square-DH solver sq turns cdhFromSqProg into a CDH
solver.
Deterministic oracle reduction (b) Square-DH ≤ (a) CDH: queries cdh (u, u) in 1 call.
sqFromCDHProg makes at most 1 oracle call.
Correctness of (b) Square-DH ≤ (a) CDH, a step toward [BS23], Exercise 10.17
(p. 429), not the cited result, which also bounds the reduction's running time (only solver calls
are counted, #5293): any CDH solver turns sqFromCDHProg into a Square-DH solver.
Deterministic oracle reduction (b) Square-DH ≤ (c) Inverse-DH: checks u ∈ {0, g, -g},
otherwise queries inv (u - g), inv (u + g), and inv (inv (u - g) - inv (u + g)) to compute
2 • ((α - 1)⁻¹ - (α + 1)⁻¹)⁻¹ • g + g = α^2 • g. Guards r₁ = r₂ so every query is nonzero on
every execution path against arbitrary oracle responses.
sqFromInvProg makes at most 3 oracle calls on every execution path.
Every query emitted by sqFromInvProg is nonzero, on every execution path against any
oracle responses.
Correctness of (b) Square-DH ≤ (c) Inverse-DH, a step toward [BS23],
Exercise 10.17 (p. 429), not the cited result, which also bounds the reduction's running time
(only solver calls are counted, #5293): for prime q, any Inverse-DH solver turns
sqFromInvProg into a Square-DH solver.
Deterministic oracle reduction (c) Inverse-DH ≤ (d) Divisible-DH: queries div (g, u) when
u ≠ 0 and returns 0 otherwise.
invFromDivProg makes at most 1 oracle call on every execution path.
Every query emitted by invFromDivProg has nonzero second coordinate.
Correctness of (c) Inverse-DH ≤ (d) Divisible-DH, a step toward [BS23],
Exercise 10.17 (p. 429), not the cited result, which also bounds the reduction's running time
(only solver calls are counted, #5293): for prime q, any Divisible-DH solver turns
invFromDivProg into an Inverse-DH solver.
One step of square-and-multiply in the exponent using a CDH oracle: squares acc, and if
bit = true multiplies by u.
Deterministic oracle reduction (c) Inverse-DH ≤ (a) CDH: computes α ^ (q - 2) • g by
square-and-multiply along (q - 2).bits.reverse using at most 2 * (q - 2).bits.length CDH
queries.
invFromCDHProg makes at most 2 * (q - 2).bits.length oracle calls.
Correctness of (c) Inverse-DH ≤ (a) CDH, a step toward [BS23], Exercise 10.17
(p. 429), not the cited result, which also bounds the reduction's running time (only solver calls
are counted, #5293): for prime q, any CDH solver turns invFromCDHProg into an Inverse-DH
solver.
Deterministic oracle reduction (d) Divisible-DH ≤ (a) CDH: inverts v with
invFromCDHProg and calls cdh (u, v⁻¹) in at most 2 * (q - 2).bits.length + 1 queries.
divFromCDHProg makes at most 2 * (q - 2).bits.length + 1 oracle calls.
Correctness of (d) Divisible-DH ≤ (a) CDH, a step toward [BS23], Exercise 10.17
(p. 429), not the cited result, which also bounds the reduction's running time (only solver calls
are counted, #5293): for prime q, any CDH solver turns divFromCDHProg into a Divisible-DH
solver.