Word-level random-oracle DH-KEM and certified Gap-CDH reduction #
Over a DecodablePrimeOrderGroupFamily, this module states the fair-coin word-level random-oracle
Diffie–Hellman key-encapsulation mechanism ([KL20], Construction 12.19, p. 431) and its
word-level ROM IND-CCA security notion ([KL20], Definition 12.13, p. 425), together with
the explicit word-level Gap-CDH reduction dhKEMToGapCDHWord of Theorem 12.22 (p. 435) and its
uniform strict oracle-PPT certificate isOraclePPTOn_dhKEMToGapCDHWord.
Honest key generation dhKEMKeyGenWordProb and encapsulation dhKEMEncapsWordProb sample their
exponents in uniform strict (oracle) PPT over fair coins via PrimeOrderGroupFamily.sampleExp
(within statistical distance 1 / 2 ^ n of uniform on ZMod (F.order d)), and
dhKEMDecapsWordOracle validates canonical group membership via F.isElem before evaluating the
random oracle, rejecting words outside Set.range (F.encode d) with none following the
ciphertext-validation remark of [KL20], Construction 12.23 (pp. 435–436). In
dhKEMCCAWordGame, the random oracle H : F.Carrier d → BitString (keyLen n) is drawn uniformly,
key generation, challenge encapsulation, and non-challenge decapsulation queries execute
dhKEMKeyGenWordProb, dhKEMEncapsWordProb, and dhKEMDecapsWordOracle against dhKEMROAnswer,
hash queries outside Set.range (F.encode d) return [], and decapsulation refuses c = cStar
with [].
dhKEMToGapCDHWord mirrors PrimeOrderGroupFamily.dhKEMToGapCDH on words: when the public key
word equals F.encode d 0 it outputs F.encode d 0; otherwise it samples a uniform keyLen n-bit
challenge key, answers the KEM adversary's hash and decaps queries from a list of
DHKEMSimEntry records using F.isElem and queryDDHWord, and extracts the first hash entry z
satisfying queryDDHWord cStar z. Its oracle-PPT certificate uses only IsOraclePPT encBool A and
ComputableInPolyTime keyLen encUnary encUnary.
Main definitions #
Cslib.Crypto.DHKEMOp,Cslib.Crypto.DHKEMChallenge,Cslib.Crypto.encDHKEMChallenge: oracle operations and encoded challenge input(d, h, c⋆, k̂)of a word-level ROM IND-CCA adversary.Cslib.Crypto.DHKEMSimEntry,Cslib.Crypto.encDHKEMSimEntry: query-table entry record and encoding for the word reduction'sList.findSomeM?scans.Cslib.Crypto.DecodablePrimeOrderGroupFamily.DHKEMKeyPair,Cslib.Crypto.DecodablePrimeOrderGroupFamily.encDHKEMKeyPair,Cslib.Crypto.DecodablePrimeOrderGroupFamily.DHKEMEncapsOutput,Cslib.Crypto.DecodablePrimeOrderGroupFamily.encDHKEMEncapsOutput: key-pair and encapsulation output records and their encodings.Cslib.Crypto.DecodablePrimeOrderGroupFamily.dhKEMEncapsWord,Cslib.Crypto.DecodablePrimeOrderGroupFamily.dhKEMDecapsWord: fixed-oracle word-level encapsulation and subgroup-validating decapsulation specifications.Cslib.Crypto.DecodablePrimeOrderGroupFamily.dhKEMKeyGenWordProb,Cslib.Crypto.DecodablePrimeOrderGroupFamily.dhKEMEncapsWordProb,Cslib.Crypto.DecodablePrimeOrderGroupFamily.dhKEMDecapsWordOracle: fair-coin honest word-level key generation, ROM encapsulation, and subgroup-validating ROM decapsulation of Construction 12.19.Cslib.Crypto.DecodablePrimeOrderGroupFamily.dhKEMROAnswer,Cslib.Crypto.DecodablePrimeOrderGroupFamily.dhKEMCCAWordAnswer,Cslib.Crypto.DecodablePrimeOrderGroupFamily.dhKEMCCAWordGame,Cslib.Crypto.DecodablePrimeOrderGroupFamily.DHKEMROMINDCCA: word-level ROM IND-CCA oracles, fair-coin experiment and security definition.Cslib.Crypto.DecodablePrimeOrderGroupFamily.simWordHandler,Cslib.Crypto.DecodablePrimeOrderGroupFamily.extractDHWord,Cslib.Crypto.DecodablePrimeOrderGroupFamily.dhKEMToGapCDHWord: word-level query simulator, table extractor, and Gap-CDH reduction.
Main results #
Cslib.Crypto.DecodablePrimeOrderGroupFamily.dhKEMDecapsWord_encapsWord,Cslib.Crypto.DecodablePrimeOrderGroupFamily.dhKEMDecapsWord_of_not_isElem,Cslib.Crypto.DecodablePrimeOrderGroupFamily.run_dhKEMDecapsWordOracle_of_mem_support: decapsulation recovers honest keys and rejects malformed ciphertexts.Cslib.Crypto.DecodablePrimeOrderGroupFamily.isPPTOn_dhKEMKeyGenWordProb,Cslib.Crypto.DecodablePrimeOrderGroupFamily.isOraclePPTOn_dhKEMEncapsWordProb,Cslib.Crypto.DecodablePrimeOrderGroupFamily.isOraclePPTOn_dhKEMDecapsWordOracle: uniform strict-(oracle-)PPT certificates for the honest algorithms of Construction 12.19.Cslib.Crypto.DecodablePrimeOrderGroupFamily.isOraclePPTOn_dhKEMToGapCDHWord: uniform strict oracle-PPT certificate fordhKEMToGapCDHWord.
References #
- J. Katz, Y. Lindell, Introduction to Modern Cryptography, 3rd edition, Definition 12.13 (p. 425), Construction 12.19 (p. 431), §12.4.4 (p. 434), Theorem 12.22 (p. 435), and Construction 12.23 (pp. 435–436).
Oracle operations of a word-level ROM IND-CCA adversary against Construction 12.19: random-
oracle hash queries (hash) and decapsulation queries (decaps).
- hash : DHKEMOp
Evaluate the random oracle
Hat a candidate group-element word. - decaps : DHKEMOp
Decapsulate a candidate ciphertext word.
Instances For
Challenge input (d, h, c⋆, k̂) of a word-level ROM IND-CCA adversary against Construction
12.19 ([KL20], Definition 12.13, p. 425, and Construction 12.19, p. 431).
- groupParameters : F.Desc
Public parameters selecting the group, its prime order, and its generator.
Encoded public key element (
F.encode d (x • g)in the experiment).Encoded challenge ciphertext (
F.encode d (y • g)in the experiment).Challenge symmetric key word (
kRealor uniformkRandof lengthkeyLen n).
Encoding of DHKEMChallenge F as the framed tuple of its four fields.
One entry in the word-level reduction's query table: isDecaps = false records a random-oracle
query elem = z, and isDecaps = true records a decapsulation query elem = c, paired with the
sampled key returned for it.
- isDecaps : Bool
falsefor a hash entry (.inl z),truefor a decapsulation entry (.inr c). Encoded group element (
zorc).Key word returned for this entry.
Encoding of DHKEMSimEntry as the framed triple (isDecaps, elem, key).
Match a table entry against a hash query z: hash entries compare e.elem == z, while
decapsulation entries ask the external DDH oracle whether z = x • e.elem.
Match a table entry against a decapsulation query c: decapsulation entries compare
e.elem == c, while hash entries ask the external DDH oracle whether e.elem = x • c.
Return the key of the first matching entry in table, or sample a fresh uniform m-bit key
and prepend ⟨isDecaps, elem, key⟩.
Test whether a table entry is a hash entry z satisfying z = x • cStar.
Output of fair-coin word-level DH-KEM key generation: encoded public key element paired with
the sampled secret exponent residue secretKey < F.order d.
Encoding of DHKEMKeyPair as the framed pair (publicKey, secretKey) with binary
secretKey.
The tuple of the fields of encDHKEMKeyPair.
Output of word-level DH-KEM encapsulation: encoded group-element ciphertext and key word.
Encoded ciphertext
F.encode d (y • g).Encapsulated symmetric key word
List.ofFn (H (y • h)).
Encoding of DHKEMEncapsOutput as the framed pair (ciphertext, key).
Canonical Fintype instance on F.Carrier d induced by the bijection
α ↦ α • F.generator d from ZMod (F.order d).
Word-level encapsulation of [KL20], Construction 12.19 (p. 431), for random oracle
H, public key element h, and ephemeral exponent y: outputs the encoded ciphertext
F.encode d (y • g) and the key word List.ofFn (H (y • h)).
Word-level decapsulation of [KL20], Construction 12.19 (p. 431), with explicit group
membership validation ([KL20], Construction 12.23, pp. 435–436): decodes ciphertext via
F.decode d and returns some (List.ofFn (H (x • c))) on valid group encodings, or none when
¬ F.isElem (d, ciphertext).
Decapsulating an honestly generated encapsulation under the matching secret key recovers its symmetric key word.
Decapsulation rejects any candidate ciphertext word outside Set.range (F.encode d).
Fair-coin word-level key generation of [KL20], Construction 12.19 (p. 431), at
security parameter n and group d: samples x ← F.toPrimeOrderGroupFamily.sampleExp n d
(within statistical distance 1 / 2 ^ n of uniform on ZMod (F.order d)) and outputs the encoded
public key F.smul (d, x, F.encode d (F.generator d)) paired with x.
Fair-coin word-level random-oracle encapsulation of [KL20], Construction 12.19
(p. 431), at security parameter n, group d, and symmetric key length keyLen: samples
y ← F.toPrimeOrderGroupFamily.sampleExp n d, computes the ciphertext word
F.smul (d, y, F.encode d (F.generator d)) and shared Diffie–Hellman word
F.smul (d, y, publicKey), and reads keyLen n bits from the random-oracle reply at that shared
word.
Word-level random-oracle decapsulation of [KL20], Construction 12.19 (p. 431), with
explicit subgroup validation ([KL20], Construction 12.23, pp. 435–436): rejects words
failing F.isElem (d, ciphertext) with none, and otherwise computes
F.smul (d, secretKey, ciphertext) and reads keyLen n bits from the random-oracle reply.
Word-level random-oracle reply for H : F.Carrier d → BitString m: evaluates H on canonical
group encodings (F.decode d w = some z) and returns [] outside Set.range (F.encode d).
Running dhKEMEncapsWordProb on an encoded group element F.encode d h against
dhKEMROAnswer d H evaluates dhKEMEncapsWord d H h at the sampled exponent
y ← F.toPrimeOrderGroupFamily.sampleExp n d.
Running dhKEMDecapsWordOracle against dhKEMROAnswer d H computes
F.dhKEMDecapsWord d H (secretKey : ZMod (F.order d)) ciphertext on every candidate word,
including malformed ciphertexts outside Set.range (F.encode d).
Decapsulation correctness for the fair-coin word-level DH-KEM: for every key pair keys
generated by dhKEMKeyGenWordProb n d and every encapsulation out produced by
dhKEMEncapsWordProb keyLen n d keys.publicKey against dhKEMROAnswer d H, running
dhKEMDecapsWordOracle keyLen n d keys.secretKey out.ciphertext against the same random oracle
returns pure (some out.key).
Word-level ROM IND-CCA oracle answer for Construction 12.19: .hash w replies via
F.dhKEMROAnswer d H w; .decaps c refuses c = cStar with [] (encOption encBits none) and
otherwise encodes F.dhKEMDecapsWord d H x c via encOption encBits.
Fixed-group fair-coin word-level ROM IND-CCA game for Construction 12.19 at security parameter
n and group d: draws the random oracle H : F.Carrier d → BitString (keyLen n) uniformly, runs
the fair-coin key generator dhKEMKeyGenWordProb n d and challenge encapsulator
dhKEMEncapsWordProb keyLen n d against dhKEMROAnswer d H, supplies the real encapsulated key
when bit = true (b = 0 in [KL20], Definition 12.13, p. 425) and an independent
uniform keyLen n-bit key when bit = false (b = 1), and answers random-oracle and
non-challenge decapsulation queries via dhKEMROAnswer and dhKEMDecapsWordOracle.
Fair-coin word-level ROM IND-CCA game for Construction 12.19 ([KL20], Definition
12.13, p. 425, and Construction 12.19, p. 431) over setup and symmetric key length keyLen.
Random-oracle IND-CCA security of the fair-coin word-level DH-KEM (Construction 12.19, with
subgroup-validating decapsulation as in Construction 12.23) with key length keyLen: every uniform
strict oracle-PPT adversary has negligible distinguishing advantage between the real-key
(bit = true) and random-key (bit = false) worlds of dhKEMCCAWordGame.
Encapsulation, decapsulation and the adversary share one random function in this game.
The generic Cslib.Crypto.KEM.cpaExperiment runs closed honest algorithms and gives the
distinguisher a single challenge.
Stateful query simulator of dhKEMToGapCDHWord at parameter n, group d, and challenge
ciphertext word cStar: answers valid .hash z and non-challenge valid .decaps c queries
consistently from its DHKEMSimEntry table via queryDDHWord, and answers out-of-group or
challenge-decapsulation queries with [] without modifying the table.
Extract the first hash entry z in table satisfying queryDDHWord cStar z, falling back to
F.encode d 0 when none matches.
Word-level Gap-CDH reduction of [KL20], Theorem 12.22 (p. 435), mirroring
PrimeOrderGroupFamily.dhKEMToGapCDH: on input = ⟨n, d, cStar, h⟩, outputs F.encode d 0 when
h == F.encode d 0; otherwise samples a uniform keyLen n-bit challenge key, runs adversary n
against simWordHandler, and extracts the first hash query matching x • cStar via
extractDHWord.
Uniform strict oracle-PPT certificate for dhKEMToGapCDHWord #
Uniform strict oracle-PPT certificate for dhKEMToGapCDHWord, derived solely from
IsOraclePPT encBool adversary and ComputableInPolyTime keyLen encUnary encUnary.
Specialization of isOraclePPTOn_dhKEMToGapCDHWord to keyLen = id.
Uniform strict-(oracle-)PPT certificates for honest Construction 12.19 algorithms #
dhKEMKeyGenWordProb is uniform strict PPT whenever n and d are computable in polynomial
time.
dhKEMEncapsWordProb is uniform strict oracle-PPT whenever keyLen, n, d, and
publicKey are computable in polynomial time.
dhKEMDecapsWordOracle is uniform strict oracle-PPT whenever keyLen, n, d, secretKey,
and ciphertext are computable in polynomial time.