Certified PPT Reductions and Probabilistic Operations for Cramer–Shoup #
This module constructs the uniform strict-PPT (IsPPTOn) operations and security reductions for the
Multiplicative Cramer–Shoup public-key encryption scheme ($\mathcal{E}_{\mathrm{MCS}}$,
Boneh and Shoup, Exercise 12.27, printed pp. 521–522, with associated data
$\mathcal{D}$ as in Section 12.7, Definition 12.7, printed pp. 501–502) over a
PrimeOrderGroupFamily, following the Games 0–4 reduction structure of Boneh and Shoup,
Section 12.5.3, Theorem 12.9, printed pp. 488–493:
- Approximate exponent sampling via
sampleModNat:sampleExp,sampleCramerShoupPair,sampleCramerShoupTripleExponents, andsampleCramerShoupSK, together with theirIsPPTOncertificates andGame.advantagebounds (1 / 2 ^ nper exponent draw) relative to exact uniform sampling onZMod (F.order d). - Phase 1/2 and collision-tracking decryption oracle handlers:
cramerShoupPhase1Oracle,cramerShoupPhase2Reply,cramerShoupPhase2Oracle, andcramerShoupCollisionPhase2Oracle. - Certified strict-PPT DDH distinguishers (
Game 1 → Game 2, eq. (12.22), printed p. 492):cramerShoupMsgToDDHDistinguisher,cramerShoupADToDDHDistinguisher, andcramerShoupToDDHDistinguisher, withDDHDistinguisher.IsPPTcertificatesisPPT_cramerShoupMsgToDDHDistinguisher,isPPT_cramerShoupADToDDHDistinguisher, andisPPT_cramerShoupToDDHDistinguisher. - Certified strict-PPT CRHF collision finders (
Game 3 → Game 4, eqs. (12.24)–(12.25), printed p. 492):cramerShoupMsgToCollisionFinder,cramerShoupADToCollisionFinder, andcramerShoupToCollisionFinder, withIsPPTOncertificatesisPPTOn_cramerShoupMsgToCollisionFinder,isPPTOn_cramerShoupADToCollisionFinder, andisPPTOn_cramerShoupToCollisionFinder. - Certified strict-PPT
Encryption.cca2ADGameOnandEncryption.cca2GameOnoperations with a keyed hash:cramerShoupValid,cramerShoupKeyGenProb,cramerShoupADEncryptProb,cramerShoupEncryptProb,cramerShoupADDecryptOpt, andcramerShoupDecryptOpt, together with theirComputableInPolyTimeandIsPPTOncertificates. Key generation draws a uniformkeyLen n-bit hash keyhkand publishes it in the public key ([CS03], Section 6.1, Figure 1); the algorithms run the word-level scheme over the parameters(d n, hk)ofF.withKey, and the hashHreads both the group and the key.isElemWithKeyandcramerShoupPkHashKeyread the group and the key back.
Approximate exponent sampling via sampleModNat #
Sample a pair of approximate exponents modulo F.order d.
Sample a 3-tuple of approximate exponents ⟨a, b, c⟩ modulo F.order d.
Sample a 6-exponent secret key ⟨s, t, s₁, t₁, s₂, t₂⟩ of approximate exponents modulo
F.order d.
Replacing sampleCramerShoupPair n d by two independent uniform draws on ZMod (F.order d)
changes Game.advantage by at most 2 / 2 ^ n.
Replacing sampleCramerShoupTripleExponents n d by three independent uniform draws on
ZMod (F.order d) changes Game.advantage by at most 3 / 2 ^ n.
Replacing sampleCramerShoupSK n d by six independent uniform draws on ZMod (F.order d)
changes Game.advantage by at most 6 / 2 ^ n.
Phase 1 decryption oracle handler for Cramer–Shoup (hasAD = true for cca2ADPhase1Oracle,
hasAD = false for cca2Phase1Oracle).
Stateless Phase 2 decryption reply for Cramer–Shoup, rejecting the challenge (ct, ad)
with [].
Phase 2 decryption oracle handler for Cramer–Shoup, rejecting the challenge (ct, ad).
Phase 2 collision-tracking oracle handler for cramerShoupMsgToCollisionFinder: replies with
cramerShoupCollisionPhase2Reply and records the hashed tuple
some (extractCramerShoupTuple q.1 q.2) of a query q = splitCramerShoupQuery hasAD req whenever
that tuple collides with the challenge's (isCramerShoupCollision H d q.1 q.2 ct ad) and is a
well-formed hash input (isCramerShoupHashInput hasAD isElem d). Queries whose tuple is not
well-formed are rejected by decryption anyway, so recording only well-formed collisions loses
nothing ([BS23], Section 12.5.3, Fig. 12.3, printed p. 491, takes decryption queries in
$\mathbb{G}^3 \times \mathcal{C}$).
The DDH distinguisher constructed from an ADCCA2AdversaryOf Msg AD with message-to-group-word
encoding encodeMsg : F.Desc × Msg → List Bool and associated-data encoding
encodeAD : F.Desc × AD → List Bool ([BS23], proof of Theorem 12.9, Game 1 $\to$ Game 2,
equation (12.22), printed pp. 490, 492, adapted to $\mathcal{E}_{\mathrm{MCS}}$ with associated
data). It encodes the DDH elements (u, v, w) of group d and runs the word-level game on
them.
The DDH distinguisher constructed from a group-message 1CCA adversary with associated data
(Msg = List Bool, encodeMsg = Prod.snd, encodeAD = fun p => encAD p.2).
The DDH distinguisher constructed from an associated-data-free group-message 1CCA adversary
(Msg = List Bool, encodeMsg = Prod.snd, ad = []).
cramerShoupMsgToDDHDistinguisher is uniform strict PPT whenever encodeMsg, encodeAD, H,
and isElem are computable in polynomial time and adversary is a strict oracle PPT 1CCA
adversary with associated data.
cramerShoupADToDDHDistinguisher is uniform strict PPT whenever H and isElem are
computable in polynomial time and adversary is a strict oracle PPT 1CCA adversary with associated
data.
cramerShoupToDDHDistinguisher is uniform strict PPT whenever H and isElem are computable
in polynomial time and adversary is a strict oracle PPT 1CCA adversary.
The setup-parameterized collision finder constructed from an ADCCA2AdversaryOf Msg AD with
message-to-group-word encoding encodeMsg : F.Desc × Msg → List Bool and associated-data encoding
encodeAD : F.Desc × AD → List Bool ([BS23], proof of Theorem 12.9, Game 4, equations
(12.24)–(12.25), printed p. 492, adapted to $\mathcal{E}_{\mathrm{MCS}}$ with associated data). It
plays Game 3 and outputs the challenge's hashed tuple together with the last Phase 2 query tuple
that cramerShoupCollisionPhase2Oracle recorded, a well-formed hash input that collides with it,
or the challenge's tuple twice if there is none.
The setup-parameterized collision finder constructed from a group-message 1CCA adversary with
associated data (Msg = List Bool, encodeMsg = Prod.snd, encodeAD = fun p => encAD p.2).
The setup-parameterized collision finder constructed from an associated-data-free group-message
1CCA adversary (Msg = List Bool, encodeMsg = Prod.snd, ad = []).
cramerShoupMsgToCollisionFinder is uniform strict PPT whenever encodeMsg, encodeAD, H,
and isElem are computable in polynomial time and adversary is a strict oracle PPT 1CCA
adversary with associated data.
cramerShoupADToCollisionFinder is uniform strict PPT whenever H and isElem are computable
in polynomial time and adversary is a strict oracle PPT 1CCA adversary with associated data.
cramerShoupToCollisionFinder is uniform strict PPT whenever H and isElem are computable
in polynomial time and adversary is a strict oracle PPT 1CCA adversary.
encodeCramerShoupPublicKey depends on sk only through its residues modulo F.order d.
encodeCramerShoupChallenge depends on sk only through its residues modulo F.order d.
decodeCramerShoup depends on sk only through its residues modulo F.order d.
cramerShoupPhase1Oracle depends on sk only through its residues modulo F.order d.
cramerShoupPhase2Oracle depends on sk only through its residues modulo F.order d.
cramerShoupCollisionPhase2Oracle depends on sk only through its residues modulo
F.order d.
Word-level public-key encryption under cramerShoupPublicKey d α σ τ σ₁ τ₁ σ₂ τ₂ coincides with
encodeCramerShoupChallenge on (v, w) = (β • g, (α * β) • g) ([BS23], Section 12.5.3,
Game 0 $\to$ Game 1, equation (12.21), printed p. 490).
Encryption.cca2ADGameOn and Encryption.cca2GameOn instantiation #
Unpack a canonically framed 6-exponent secret key CramerShoupSK ℕ.
decodeCramerShoupSK left-inverts encCramerShoupSK.
Native keyed scheme #
[CS03] (Section 6.1, Figure 1) draws the key hk of the hash function at key
generation and puts it in the public key; [CS98] (Section 3) likewise chooses the hash
function from a family when it generates keys. The native scheme below does the same over the
group family F.withKey, whose parameters (d, hk) attach a key to the group d. The group at
parameter n is the fixed description d n, the key hk is a uniform keyLen n-bit word, the
public key word starts with the encoded parameters (d n, hk), and the secret key word starts
with hk. The hash H reads both.
isElemWithKey isElem recognizes the group words of F.withKey whenever isElem recognizes
those of F.
isElemWithKey isElem is computable in polynomial time whenever isElem is.
The hash key in a public key word of cramerShoupKeyGenProb: the key attached to the group
parameters at the front of the word.
Challenge-pair group-membership admissibility predicate for Encryption.cca2ADGameOn and
Encryption.cca2GameOn ([BS23], Section 12.5.3 & Exercise 12.27): both challenge words
m₀ and m₁ must belong to the group F.Carrier (d n).
Probabilistic polynomial-time Cramer–Shoup key generation with a hash key, for a group family
d : ℕ → F.Desc and key length keyLen ([CS03], Section 6.1, Figure 1): draw a
uniform keyLen n-bit hash key hk, then generate a key pair over the parameters (d n, hk) of
F.withKey, sampling approximate uniform exponents via sampleModNat. The public key word
encodes (d n, hk) and the four group elements; the secret key word is hk framed, followed by
the six secret exponents.
Probabilistic polynomial-time Cramer–Shoup encryption with associated data, for a group family
d : ℕ → F.Desc and a keyed hash H ([CS03], Section 6.1, Figure 1): read the hash
key from the public key and encrypt over the parameters (d n, hk), sampling the encryption
exponent via sampleModNat.
Probabilistic polynomial-time Cramer–Shoup encryption with a keyed hash (associated-data-free
specialization ad = []).
Deterministic polynomial-time Cramer–Shoup decryption with associated data and a keyed hash,
for Encryption.cca2ADGameOn: read the hash key from the secret key and decrypt over the
parameters (d n, hk).
Deterministic polynomial-time Cramer–Shoup decryption with a keyed hash, for
Encryption.cca2GameOn (associated-data-free specialization ad = []).
cramerShoupValid is computable in polynomial time whenever isElem and d are.
cramerShoupKeyGenProb is uniformly strict PPT whenever d and keyLen are computable in
polynomial time.
cramerShoupADEncryptProb is uniformly strict PPT whenever H and d are computable in
polynomial time.
cramerShoupEncryptProb is uniformly strict PPT whenever H and d are computable in
polynomial time.
cramerShoupADDecryptOpt is computable in polynomial time whenever H, isElem, and d
are.
cramerShoupDecryptOpt is computable in polynomial time whenever H, isElem, and d
are.
cca2ADPhase1Oracle for cramerShoupADDecryptOpt on a generated secret key word agrees with
cramerShoupPhase1Oracle true over the parameters (d n, hk).
cca2ADPhase2Oracle for cramerShoupADDecryptOpt on a generated secret key word agrees with
cramerShoupPhase2Oracle true over the parameters (d n, hk).
cca2Phase1Oracle for cramerShoupDecryptOpt on a generated secret key word agrees with
cramerShoupPhase1Oracle false over the parameters (d n, hk).
cca2Phase2Oracle for cramerShoupDecryptOpt on a generated secret key word agrees with
cramerShoupPhase2Oracle false over the parameters (d n, hk).
Extracting the 4-component public-key word record from encodeCramerShoupPublicKey.
encodeCramerShoupEncrypt on the public-key words generated by skNatOfZMod agrees with
cramerShoupPublicKey.