Gap-CDH and the random-oracle Diffie–Hellman KEM #
Over a group of prime order q with generator g from a PrimeOrderGroupFamily, the gap
computational Diffie–Hellman (gap-CDH) experiment ([KL20], §12.4.4, p. 434) draws
uniform exponents a, b, gives the adversary (a • g, b • g) together with a decisional
Diffie–Hellman oracle O_b answering a query (U, V) with true exactly when V = b • U, and
accepts when the adversary outputs (a * b) • g.
The random-oracle KEM of [KL20], Construction 12.19 (p. 431), has public key
h = x • g for a uniform exponent x; encapsulation draws a uniform y and outputs the
ciphertext y • g with key H (y • h), and decapsulation of c returns H (x • c). The
CCA experiment ([KL20], Definition 12.13, p. 425) gives the adversary the public key,
the challenge ciphertext and either the real key or an independent key, together with the random
oracle H and a decapsulation oracle that refuses the challenge ciphertext.
We prove the concrete per-group step of [KL20], Theorem 12.22 (p. 435); the
asymptotic theorem is Cslib.Crypto.DecodablePrimeOrderGroupFamily.GapCDH.dhKEMROMINDCCA in
CslibFrontier.Crypto.Computational.DiffieHellman.GapCDH.Decodable. The distinguishing
advantage of every CCA adversary against the KEM is at most the success probability of an
explicit gap-CDH adversary dhKEMToGapCDH (advantage_dhKEMCCAGame_le_ideal). Its exponents are
drawn exactly uniformly, so it is an ideal-sampling step toward the cited theorem. The reduction
runs the KEM adversary, answering hash and decapsulation queries consistently from a table of past
queries by asking the DDH oracle whether a hash point z and a ciphertext c satisfy
z = x • c; it then outputs the first hash point z with z = x • c⋆ for the challenge
ciphertext c⋆.
Main definitions #
Cslib.Crypto.PrimeOrderGroupFamily.ddhOracle,Cslib.Crypto.PrimeOrderGroupFamily.runDDH: the oracleO_band the execution of a program against it.Cslib.Crypto.PrimeOrderGroupFamily.gapCDHGame: the gap-CDH experiment.Cslib.Crypto.PrimeOrderGroupFamily.dhKEMEncaps,Cslib.Crypto.PrimeOrderGroupFamily.dhKEMDecaps: Construction 12.19 for a fixed hash function.Cslib.Crypto.PrimeOrderGroupFamily.dhKEMCCAGame: the CCA experiment in the random-oracle model.Cslib.Crypto.PrimeOrderGroupFamily.dhKEMToGapCDH: the concrete per-group reduction step.
Main results #
Cslib.Crypto.PrimeOrderGroupFamily.dhKEMDecaps_encaps: decapsulation recovers the key.
Implementation notes #
The statement is concrete for one group of the family. KEM adversaries are deterministic oracle
programs; a randomized adversary reduces to these by fixing its coins, since the bound holds for
every coin sequence. The key distribution is an arbitrary finite sampler, which covers the
uniform ℓ-bit keys of Construction 12.19. Unlike the textbook proof, the reduction outputs 0
when the public key is 0, which is then the correct answer, so the bound has no additive term.
The proof replaces the eagerly sampled random function by a lazily sampled one
(Cslib.RandomOracle.interpret_eq_lazy), programs the real key at the point x • c⋆, and
compares the real and ideal runs until the random oracle is first evaluated at x • c⋆. The
reduction's tables represent the lazy random-oracle cache exactly, and an evaluation at
x • c⋆ leaves a hash entry the reduction extracts.
References #
- J. Katz, Y. Lindell, Introduction to Modern Cryptography, 3rd edition, Construction 12.19, §12.4.4, Theorem 12.22 and Definition 12.13
The queries of a CCA adversary against the Diffie–Hellman KEM: random-oracle evaluations and decapsulations.
- hash {G : Type} (point : G) : DHKEMQuery G
Evaluate the random oracle at a group element.
- decaps {G : Type} (ciphertext : G) : DHKEMQuery G
Decapsulate a ciphertext.
Hash queries return keys; decapsulation queries return a key, or none on the challenge.
The interface of a DDH oracle: a query (U, V) is answered by a bit.
A gap-CDH adversary maps (a • g, b • g) to a guess, with fresh coins and the oracle O_b.
Encapsulation of Construction 12.19 with hash function H, public key h and exponent y:
the ciphertext y • g and the key H (y • h).
Decapsulation of Construction 12.19 with hash function H and secret key x.
Decapsulating an encapsulation under the matching secret key recovers its key.
A CCA adversary against the KEM maps (public key, challenge ciphertext, key) to a guess,
querying the random oracle and the decapsulation oracle.
The reduction's table of answered queries: hash points (inl) and decapsulated ciphertexts
(inr), each with the key returned for it.
Run a program with fresh uniform coins and the DDH oracle O_y.
The gap-CDH experiment ([KL20], §12.4.4): on (a • g, b • g) and with the oracle
O_b, the adversary must output (a * b) • g.
The honest answer to a KEM query, for hash function H, secret key x and challenge
ciphertext challenge.
The CCA experiment for Construction 12.19 in the random-oracle model
([KL20], Definition 12.13): H is a random function with keys drawn by sampleKey,
and the adversary receives the real key when bit is true and an independent key otherwise.
The reduction's answers to KEM queries: consistent keys from its table, and no answer to the challenge ciphertext.
The first hash point z of a table with z = x • challenge, or 0 if there is none.
The gap-CDH adversary of the concrete per-group step of [KL20], Theorem 12.22: on
(c⋆, h) it runs the KEM adversary on public key h, challenge ciphertext c⋆ and a fresh key,
answers its queries with simHandler, and outputs the hash point x • c⋆ if the adversary asked
for it.
Executing the reduction against the DDH oracle #
A stateful handler over the DDH interface, with every call executed against O_y.
Executing a stateful handler against the DDH oracle executes each of its calls.
The reduction's tables represent a lazy random-oracle cache #
PMF law of simHandler on .hash z against O_y.
PMF law of simHandler on .decaps c against O_y.
Programming the random oracle at one point #
The CCA experiment with a lazily sampled random oracle #
The reduction #
Concrete per-group step of Theorem 12.22 #
Concrete per-group ideal-sampling step of [KL20], Theorem 12.22 (p. 435), not the
cited result (exponents are drawn from PMF.uniformOfFintype (ZMod (F.order d))); the asymptotic
fair-coin theorem is Cslib.Crypto.DecodablePrimeOrderGroupFamily.GapCDH.dhKEMROMINDCCA
(CslibFrontier/Crypto/Computational/DiffieHellman/GapCDH/Decodable.lean).
The CCA advantage of every adversary against dhKEMCCAGame is at most the success probability of
the gap-CDH adversary dhKEMToGapCDH built from it.