Documentation

CslibFrontier.Crypto.Computational.CramerShoup

The Cramer–Shoup public-key encryption scheme and 1CCA security under DDH #

This module completes the single-challenge adaptive chosen-ciphertext (1CCA / IND-CCA2 and 1CCA with associated data, Definition 12.2, printed p. 468, and Section 12.7, Definition 12.7, printed pp. 501–502) security proof for the Multiplicative Cramer–Shoup public-key encryption scheme ($\mathcal{E}_{\mathrm{MCS}}$, Boneh and Shoup, Exercise 12.27, printed pp. 521–522, over an arbitrary associated-data type AD : Type as well as the associated-data-free specialization) defined in CslibFrontier.Crypto.Computational.CramerShoup.Scheme over a PrimeOrderGroupFamily, in the standard model under:

  1. the Decisional Diffie–Hellman (DDH) assumption,
  2. collision resistance (CollisionResistantForOn) of the $\mathbb{Z}_q$-valued hash family $H'$ (cramerShoupHashMod) on its well-formed inputs, the encodings of $\mathbb{G}^3 \times \mathcal{D}$ (isCramerShoupHashInput), keyed by a hash key drawn at key generation in the native theorems, and
  3. a positive group-order lower bound $m(n) > 0$ with $m(n) \le q$ and negligible inverse order $1 / m(n)$,

following the Games 0–6 proof template of Boneh and Shoup, Section 12.5.3, Theorem 12.9 and Remark 12.3, printed pp. 488–493.

We first prove the concrete and asymptotic 1CCA bounds for the ideal exact-uniform PMF games (cramerShoupMsgCCA2Game, cramerShoupADGroupCCA2Game, cramerShoupADGroupIdealINDCCA2, cramerShoupGroupCCA2Game, cramerShoupGroupIdealINDCCA2, cramerShoupADCCA2Game, cramerShoupCCA2Game), in which key and challenge exponents are drawn from PMF.uniformOfFintype (ZMod (F.order d)) and the 42 / 2 ^ n dyadic loss arises solely from the sampleModNat exponent draws inside the strict-PPT DDH and CRHF reductions. These ideal-sampling results, the concrete bounds (advantage_cramerShoupMsgCCA2Game_le_ideal_of_honest_bounds, advantage_cramerShoupMsgCCA2Game_le_ideal and its four specializations) and the asymptotic DDH.cramerShoupMsgIdealINDCCA2 with its two group-element specializations, are steps, not the cited result. We then bridge these ideal games to the library's native strict-PPT PKE 1CCA notions (Encryption.cca2ADGameOn, Encryption.INDCCA2ADOn, Encryption.cca2GameOn, and Encryption.INDCCA2On) via advantage_cca2ADGameOn_cramerShoupADGroupCCA2Game_le and advantage_cca2GameOn_cramerShoupGroupCCA2Game_le (which account for the additional 8 / 2 ^ n per-bit sampleModNat approximation loss of cramerShoupKeyGenProb, cramerShoupADEncryptProb, and cramerShoupEncryptProb), yielding DDH.indcca2ADOn_cramerShoup_bitStringAD (associated data in $\{0,1\}^*$), DDH.indcca2On_cramerShoup, and (via INDCCA2On.indcca2MultiOn, the batch-challenge step toward Theorem 12.1) batch-challenge multi-challenge CCA security DDH.indcca2MultiOn_cramerShoup.

Source Statements ([BS23], Section 12.5.3 & Exercise 12.27) #

Verbatim from [BS23], Section 12.5.3 (printed pp. 489–492):

Theorem 12.9. If the DDH assumption holds in $\mathbb{G}$, $\mathcal{E}_s$ is 1CCA secure, $H$ is a secure KDF, and $H'$ is collision resistant, then $\mathcal{E}_{\mathrm{CS}}$ is CCA secure.

In particular, for every 1CCA adversary $\mathcal{A}$ that attacks $\mathcal{E}_{\mathrm{CS}}$ as in Definition 12.2, and makes at most $Q_d$ decryption queries, there exist a DDH adversary $\mathcal{B}_{\mathrm{ddh}}$ for $\mathbb{G}$ as in Attack Game 10.6, a 1CCA adversary $\mathcal{B}_s$ that attacks $\mathcal{E}_s$ as in Definition 9.6, a KDF adversary $\mathcal{B}_{\mathrm{kdf}}$ that attacks $H$ as in Attack Game 11.3, and a collision-finding adversary $\mathcal{B}_{\mathrm{cr}}$ that attacks $H'$ as in Attack Game 8.1, where $\mathcal{B}_{\mathrm{ddh}}, \mathcal{B}_s, \mathcal{B}_{\mathrm{kdf}}, \mathcal{B}_{\mathrm{cr}}$ are elementary wrappers around $\mathcal{A}$, such that $$\text{1CCAadv}[\mathcal{A}, \mathcal{E}_{\mathrm{CS}}] \le 2\left(\text{DDHadv}[\mathcal{B}_{\mathrm{ddh}}, \mathbb{G}] + \text{KDFadv}[\mathcal{B}_{\mathrm{kdf}}, H] + \text{CRadv}[\mathcal{B}_{\mathrm{cr}}, H'] + \frac{Q_d + 1}{q}\right) + \text{1CCAadv}[\mathcal{B}_s, \mathcal{E}_s]. \quad (12.19)$$ … Game 1. We replace the lines marked (2) and (3) in Fig. 12.3 as follows: $$(2) \qquad z \leftarrow f(v, w)$$ $$(3) \qquad z' \leftarrow f'(v, w, \rho)$$ Here, instead of using the auxiliary information that allows us to compute $f$ on $L_u$ and $f'$ on $L_u \times \mathbb{Z}_q$, we compute them directly, using the secret key $\mathit{sk}$. This does not change the result of the computation in any way. Therefore, $$\Pr[W_1] = \Pr[W_0]. \quad (12.21)$$ … Game 2. We replace the line marked (1) in Fig. 12.3 with $$(1) \qquad \gamma \xleftarrow{R} \mathbb{Z}_q$$ … It is easy to see that $$|\Pr[W_1] - \Pr[W_2]| \le \text{DDHadv}[\mathcal{B}_{\mathrm{ddh}}, \mathbb{G}] \quad (12.22)$$ for an efficient DDH adversary $\mathcal{B}_{\mathrm{ddh}}$ …

Game 3. We replace the line marked (1) in Fig. 12.3 with $$(1) \qquad \gamma \xleftarrow{R} \mathbb{Z}_q \setminus \{\alpha\beta\}$$ Since the statistical distance between the uniform distribution on all triples and the uniform distribution on all non-DH-triples is $1/q$ (see Exercise 10.7), it follows that: $$|\Pr[W_2] - \Pr[W_3]| \le \frac{1}{q}. \quad (12.23)$$

Game 4. We now play our “CR card”. Let us define $\mathit{Coll}_{u,v}(\hat{v}, \hat{w})$ to be true if $(\hat{v}, \hat{w}) \ne (v, w)$ and $H'(\hat{v}, \hat{w}) = H'(v, w)$, and to be false, otherwise. In this game, we “widen” the rejection rule at line (5), replacing it with $$(5) \qquad \text{if } \mathit{Coll}_{u,v}(\hat{u}, \hat{v}) \text{ or } z' \ne f'(\hat{v}, \hat{w}, \hat{\rho})$$ Let $Z_4$ be the event that in Game 4, some decryption query, which would not have triggered the rejection rule of Game 3, does trigger the wider rejection rule in Game 4. Clearly, Games 3 and 4 proceed identically unless event $Z_4$ occurs. By the Difference Lemma, we have $$|\Pr[W_3] - \Pr[W_4]| \le \Pr[Z_4]. \quad (12.24)$$ It should be clear that $$\Pr[Z_4] \le \text{CRadv}[\mathcal{B}_{\mathrm{cr}}, H']. \quad (12.25)$$ for an efficient collision-finding adversary $\mathcal{B}_{\mathrm{cr}}$. Indeed, adversary $\mathcal{B}_{\mathrm{cr}}$ just plays Game 4 and waits for the event $Z_4$ to happen.

Verbatim from [BS23], Exercise 12.27 (printed pp. 521–522):

… Show that $\mathcal{E}_{\mathrm{MCS}}$ is CCA secure, provided $H'$ is collision resistant and the DDH assumption holds for $\mathbb{G}$.

Scope and Quantitative Adaptation #

noncomputable def Cslib.Crypto.PrimeOrderGroupFamily.cramerShoupMsgCCA2Game (F : PrimeOrderGroupFamily) (hasAD : Bool) {Msg AD : Type} (encodeMsg : F.Desc × Msg → List Bool) (encodeAD : F.Desc × AD → List Bool) (setup : ℕ → PMF F.Desc) (H : F.Desc × List Bool → List Bool) (isElem : F.Desc × List Bool → Bool) (adversary : Encryption.ADCCA2AdversaryOf Msg AD) (bit : Bool) (n : ℕ) :

The ideal exact-uniform PMF single-challenge 1CCA experiment for Multiplicative Cramer–Shoup parameterized by hasAD : Bool, a message-to-group-word encoding encodeMsg : F.Desc × Msg → List Bool, and an associated-data encoding encodeAD : F.Desc × AD → List Bool ([BS23], Section 12.1, Attack Game 12.1 and Definition 12.2, printed pp. 467–468; Section 12.7, Definition 12.7, printed pp. 501–502; and Exercise 12.27, printed pp. 521–522; Game 0 of Section 12.5.3, printed pp. 490–491). Key and challenge exponents are sampled from the exact uniform distribution PMF.uniformOfFintype (ZMod (F.order d)).

@[reducible, inline]
noncomputable abbrev Cslib.Crypto.PrimeOrderGroupFamily.cramerShoupADGroupCCA2Game (F : PrimeOrderGroupFamily) {AD : Type} (encAD : AD ↪ List Bool) (setup : ℕ → PMF F.Desc) (H : F.Desc × List Bool → List Bool) (isElem : F.Desc × List Bool → Bool) (adversary : Encryption.WordADCCA2Adversary AD) (bit : Bool) (n : ℕ) :

The ideal exact-uniform PMF single-challenge 1CCA experiment with associated data for Multiplicative Cramer–Shoup over encoded group-element messages (Msg = List Bool, encodeMsg = Prod.snd) and associated-data type AD encoded via encAD : AD ↪ List Bool.

Ideal exact-uniform PMF single-challenge 1CCA security with associated data of Multiplicative Cramer–Shoup over encoded group-element messages (WordADCCA2Adversary AD).

@[reducible, inline]
noncomputable abbrev Cslib.Crypto.PrimeOrderGroupFamily.cramerShoupGroupCCA2Game (F : PrimeOrderGroupFamily) (setup : ℕ → PMF F.Desc) (H : F.Desc × List Bool → List Bool) (isElem : F.Desc × List Bool → Bool) (adversary : Encryption.WordCCA2Adversary) (bit : Bool) (n : ℕ) :

The ideal exact-uniform PMF single-challenge 1CCA experiment for Multiplicative Cramer–Shoup over encoded group-element messages (Msg = List Bool, encodeMsg = Prod.snd, associated-data-free specialization ad = []), enforcing the group-membership challenge admissibility check isElem (d, m₀) && isElem (d, m₁).

Ideal exact-uniform PMF single-challenge 1CCA security of Multiplicative Cramer–Shoup over encoded group-element messages (WordCCA2Adversary).

@[reducible, inline]
noncomputable abbrev Cslib.Crypto.PrimeOrderGroupFamily.cramerShoupADCCA2Game (F : PrimeOrderGroupFamily) {AD : Type} (encAD : AD ↪ List Bool) (setup : ℕ → PMF F.Desc) (H : F.Desc × List Bool → List Bool) (isElem : F.Desc × List Bool → Bool) (adversary : Encryption.ADCCA2Adversary AD) (bit : Bool) (n : ℕ) :

The ideal exact-uniform PMF single-challenge 1CCA experiment with associated data for Multiplicative Cramer–Shoup over single-bit messages (Msg = Bool, embedded into F.Carrier d via F.encodeBit) and associated-data type AD encoded via encAD : AD ↪ List Bool.

@[reducible, inline]
noncomputable abbrev Cslib.Crypto.PrimeOrderGroupFamily.cramerShoupCCA2Game (F : PrimeOrderGroupFamily) (setup : ℕ → PMF F.Desc) (H : F.Desc × List Bool → List Bool) (isElem : F.Desc × List Bool → Bool) (adversary : Encryption.CCA2Adversary) (bit : Bool) (n : ℕ) :

The ideal exact-uniform PMF single-challenge 1CCA experiment for Multiplicative Cramer–Shoup over single-bit messages (Msg = Bool, embedded into F.Carrier d via F.encodeBit, associated-data-free specialization ad = []).

noncomputable def Cslib.Crypto.PrimeOrderGroupFamily.cramerShoupChallengeGame (F : PrimeOrderGroupFamily) (hasAD : Bool) {Msg AD : Type} (encodeMsg : F.Desc × Msg → List Bool) (encodeAD : F.Desc × AD → List Bool) (H : F.Desc × List Bool → List Bool) (isElem : F.Desc × List Bool → Bool) (adversary : Encryption.ADCCA2AdversaryOf Msg AD) (bit : Bool) (n : ℕ) (d : F.Desc) (α β γ : ZMod (F.order d)) :

Shared challenge experiment for Games 1 and 2 ([BS23], Section 12.5.3, printed p. 490) at fixed group d and triple exponents (α, β, γ): sample the six secret-key exponents uniformly from ZMod (F.order d) and compute the challenge ciphertext from (u, v, w) = (α • g, β • g, γ • g) using the secret key via encodeCramerShoupChallenge.

noncomputable def Cslib.Crypto.PrimeOrderGroupFamily.cramerShoupGame1 (F : PrimeOrderGroupFamily) (hasAD : Bool) {Msg AD : Type} (encodeMsg : F.Desc × Msg → List Bool) (encodeAD : F.Desc × AD → List Bool) (setup : ℕ → PMF F.Desc) (H : F.Desc × List Bool → List Bool) (isElem : F.Desc × List Bool → Bool) (adversary : Encryption.ADCCA2AdversaryOf Msg AD) (bit : Bool) (n : ℕ) :

Game 1 ([BS23], Section 12.5.3, printed p. 490, adapted to $\mathcal{E}_{\mathrm{MCS}}$ with associated data): draw (α, β) and sk uniformly from ZMod q, and compute the challenge ciphertext from (v, w) = (β • g, (α * β) • g) using the secret key via encodeCramerShoupChallenge.

theorem Cslib.Crypto.PrimeOrderGroupFamily.cramerShoupMsgCCA2Game_eq_game1 (F : PrimeOrderGroupFamily) (hasAD : Bool) {Msg AD : Type} (encodeMsg : F.Desc × Msg → List Bool) (encodeAD : F.Desc × AD → List Bool) (setup : ℕ → PMF F.Desc) (H : F.Desc × List Bool → List Bool) (isElem : F.Desc × List Bool → Bool) (adversary : Encryption.ADCCA2AdversaryOf Msg AD) (bit : Bool) (n : ℕ) :
F.cramerShoupMsgCCA2Game hasAD encodeMsg encodeAD setup H isElem adversary bit n = F.cramerShoupGame1 hasAD encodeMsg encodeAD setup H isElem adversary bit n

Game 0 = Game 1 ([BS23], Section 12.5.3, equation (12.21), printed p. 490): computing the challenge ciphertext from (v, w) = (β • g, (α * β) • g) using the secret key produces the exact same distribution as public-key encryption.

noncomputable def Cslib.Crypto.PrimeOrderGroupFamily.cramerShoupGame2 (F : PrimeOrderGroupFamily) (hasAD : Bool) {Msg AD : Type} (encodeMsg : F.Desc × Msg → List Bool) (encodeAD : F.Desc × AD → List Bool) (setup : ℕ → PMF F.Desc) (H : F.Desc × List Bool → List Bool) (isElem : F.Desc × List Bool → Bool) (adversary : Encryption.ADCCA2AdversaryOf Msg AD) (bit : Bool) (n : ℕ) :

Game 2 ([BS23], Section 12.5.3, printed p. 490, adapted to $\mathcal{E}_{\mathrm{MCS}}$ with associated data): replace the Diffie–Hellman challenge pair (v, w) = (β • g, (α * β) • g) by an independent random pair (v, w) = (β • g, γ • g) with uniform γ : ZMod (F.order d).

theorem Cslib.Crypto.PrimeOrderGroupFamily.advantage_cramerShoupGame1_game2_le (F : PrimeOrderGroupFamily) (hasAD : Bool) {Msg AD : Type} (encodeMsg : F.Desc × Msg → List Bool) (encodeAD : F.Desc × AD → List Bool) (setup : ℕ → PMF F.Desc) (H : F.Desc × List Bool → List Bool) (isElem : F.Desc × List Bool → Bool) (hmem : ∀ (d : F.Desc) (x : List Bool), isElem (d, x) = true ↔ x ∈ Set.range (F.encode d)) (adversary : Encryption.ADCCA2AdversaryOf Msg AD) (bit : Bool) (n : ℕ) :
(F.cramerShoupGame1 hasAD encodeMsg encodeAD setup H isElem adversary bit n).advantage (F.cramerShoupGame2 hasAD encodeMsg encodeAD setup H isElem adversary bit n) ≤ (F.ddhRealGame setup (F.cramerShoupMsgToDDHDistinguisher hasAD encodeMsg encodeAD H isElem adversary bit) n).advantage (F.ddhRandomGame setup (F.cramerShoupMsgToDDHDistinguisher hasAD encodeMsg encodeAD H isElem adversary bit) n) + 12 / 2 ^ n

Game 1 $\to$ Game 2 bound ([BS23], Section 12.5.3, equation (12.22), printed p. 492): the distinguishing advantage between cramerShoupGame1 and cramerShoupGame2 is at most the DDH advantage of cramerShoupMsgToDDHDistinguisher plus 12 / 2 ^ n (six approximate sampleModNat secret-key exponent draws in ddhRealGame and six in ddhRandomGame).

theorem Cslib.Crypto.PrimeOrderGroupFamily.advantage_cramerShoupGame2_game3_le (F : PrimeOrderGroupFamily) (hasAD : Bool) {Msg AD : Type} (encodeMsg : F.Desc × Msg → List Bool) (encodeAD : F.Desc × AD → List Bool) (setup : ℕ → PMF F.Desc) (H : F.Desc × List Bool → List Bool) (isElem : F.Desc × List Bool → Bool) (hmem : ∀ (d : F.Desc) (x : List Bool), isElem (d, x) = true ↔ x ∈ Set.range (F.encode d)) (hAD : ∀ (p : F.Desc × AD), hasAD = true ∨ encodeAD p = []) (adversary : Encryption.ADCCA2AdversaryOf Msg AD) (bit : Bool) (n : ℕ) :
(F.cramerShoupGame2 hasAD encodeMsg encodeAD setup H isElem adversary bit n).advantage (F.cramerShoupGame3 hasAD encodeMsg encodeAD setup H isElem adversary bit n) ≤ (collisionGameFor setup (F.cramerShoupHashMod H) (fun (x : ℕ) => F.isCramerShoupHashInput hasAD isElem) (F.cramerShoupMsgToCollisionFinder hasAD encodeMsg encodeAD H isElem adversary bit) n).succProbability + 9 / 2 ^ n

Game 2 $\to$ Game 3 bound (the collision-rejection hop into Game 4 of [BS23], Section 12.5.3, equations (12.24)–(12.25), printed p. 492, adapted to $\mathcal{E}_{\mathrm{MCS}}$ with associated data): if isElem accepts exactly the encodings of group elements and the challenge's associated data is [] when hasAD = false, the distinguishing advantage between cramerShoupGame2 and cramerShoupGame3 is bounded by the success probability of cramerShoupMsgToCollisionFinder in finding a collision between well-formed hash inputs (isCramerShoupHashInput hasAD isElem) plus 9 / 2 ^ n (from the nine approximate sampleModNat exponent draws in cramerShoupMsgToCollisionFinder).

Concrete ideal-game 1CCA bounds (steps toward [BS23], Theorem 12.9 & Ex. 12.27) #

theorem Cslib.Crypto.PrimeOrderGroupFamily.advantage_cramerShoupMsgCCA2Game_game5_le (F : PrimeOrderGroupFamily) (hasAD : Bool) {Msg AD : Type} (encodeMsg : F.Desc × Msg → List Bool) (encodeAD : F.Desc × AD → List Bool) (setup : ℕ → PMF F.Desc) (H : F.Desc × List Bool → List Bool) (isElem : F.Desc × List Bool → Bool) (hmem : ∀ (d : F.Desc) (x : List Bool), isElem (d, x) = true ↔ x ∈ Set.range (F.encode d)) (hAD : ∀ (p : F.Desc × AD), hasAD = true ∨ encodeAD p = []) (adversary : Encryption.ADCCA2AdversaryOf Msg AD) (bit : Bool) (n Q₁ Q₂ m : ℕ) (hm0 : 0 < m) (hm : ∀ d ∈ (setup n).support, m ≤ F.order d) (hQ₁ : F.HonestPhase1QueryBound setup adversary n Q₁) (hQ₂ : F.HonestPhase2QueryBound hasAD encodeAD setup H isElem adversary n Q₂) :
(F.cramerShoupMsgCCA2Game hasAD encodeMsg encodeAD setup H isElem adversary bit n).advantage (F.cramerShoupGame5 hasAD encodeMsg encodeAD setup H isElem adversary bit n) ≤ (F.ddhRealGame setup (F.cramerShoupMsgToDDHDistinguisher hasAD encodeMsg encodeAD H isElem adversary bit) n).advantage (F.ddhRandomGame setup (F.cramerShoupMsgToDDHDistinguisher hasAD encodeMsg encodeAD H isElem adversary bit) n) + (collisionGameFor setup (F.cramerShoupHashMod H) (fun (x : ℕ) => F.isCramerShoupHashInput hasAD isElem) (F.cramerShoupMsgToCollisionFinder hasAD encodeMsg encodeAD H isElem adversary bit) n).succProbability + ↑(Q₁ + Q₂ + 1) / ↑m + 21 / 2 ^ n

Combined Game 0 $\to$ Game 5 bound for a single challenge bit: under honest query bounds (Q₁, Q₂), the distinguishing advantage between cramerShoupMsgCCA2Game and cramerShoupGame5 is at most the DDH advantage of cramerShoupMsgToDDHDistinguisher plus the collision-finding success probability of cramerShoupMsgToCollisionFinder plus (Q₁ + Q₂ + 1) / m + 21 / 2 ^ n.

@[reducible, inline]
noncomputable abbrev Cslib.Crypto.PrimeOrderGroupFamily.cramerShoupCCA2Bound (F : PrimeOrderGroupFamily) (hasAD : Bool) {Msg AD : Type} (encodeMsg : F.Desc × Msg → List Bool) (encodeAD : F.Desc × AD → List Bool) (setup : ℕ → PMF F.Desc) (H : F.Desc × List Bool → List Bool) (isElem : F.Desc × List Bool → Bool) (adversary : Encryption.ADCCA2AdversaryOf Msg AD) (n Q₁ Q₂ m : ℕ) :

Concrete upper-bound expression for the two-run single-bit Theorem 12.9 / Exercise 12.27 1CCA reduction ([BS23], equation (12.19), printed p. 490): the DDH advantages of cramerShoupMsgToDDHDistinguisher at false and true, the success probabilities of cramerShoupMsgToCollisionFinder at false and true in finding collisions between well-formed hash inputs (isCramerShoupHashInput hasAD isElem), and (2 * Q₁ + 2 * Q₂ + 2) / m + 42 / 2 ^ n.

theorem Cslib.Crypto.PrimeOrderGroupFamily.advantage_cramerShoupMsgCCA2Game_le_ideal_of_honest_bounds (F : PrimeOrderGroupFamily) (hasAD : Bool) {Msg AD : Type} (encodeMsg : F.Desc × Msg → List Bool) (encodeAD : F.Desc × AD → List Bool) (setup : ℕ → PMF F.Desc) (H : F.Desc × List Bool → List Bool) (isElem : F.Desc × List Bool → Bool) (hmem : ∀ (d : F.Desc) (x : List Bool), isElem (d, x) = true ↔ x ∈ Set.range (F.encode d)) (hAD : ∀ (p : F.Desc × AD), hasAD = true ∨ encodeAD p = []) (adversary : Encryption.ADCCA2AdversaryOf Msg AD) (n Q₁ Q₂ m : ℕ) (hm0 : 0 < m) (hm : ∀ d ∈ (setup n).support, m ≤ F.order d) (hQ₁ : F.HonestPhase1QueryBound setup adversary n Q₁) (hQ₂ : F.HonestPhase2QueryBound hasAD encodeAD setup H isElem adversary n Q₂) :
(F.cramerShoupMsgCCA2Game hasAD encodeMsg encodeAD setup H isElem adversary false n).advantage (F.cramerShoupMsgCCA2Game hasAD encodeMsg encodeAD setup H isElem adversary true n) ≤ F.cramerShoupCCA2Bound hasAD encodeMsg encodeAD setup H isElem adversary n Q₁ Q₂ m

Ideal-sampling step toward [BS23], Theorem 12.9 and Exercise 12.27, not the cited result: under honest query bounds (Q₁, Q₂), the 1CCA advantage in cramerShoupMsgCCA2Game, whose key and challenge exponents are drawn exactly uniformly at the PMF level, is at most cramerShoupCCA2Bound, combining the Game 0 $\to$ Game 5 bounds for bit = false and bit = true via cramerShoupGame5_false_eq_true (where 42 / 2 ^ n is the reduction loss from the sampleModNat exponent draws inside the reductions).

theorem Cslib.Crypto.PrimeOrderGroupFamily.advantage_cramerShoupMsgCCA2Game_le_ideal (F : PrimeOrderGroupFamily) (hasAD : Bool) {Msg AD : Type} (encodeMsg : F.Desc × Msg → List Bool) (encodeAD : F.Desc × AD → List Bool) (setup : ℕ → PMF F.Desc) (H : F.Desc × List Bool → List Bool) (isElem : F.Desc × List Bool → Bool) (hmem : ∀ (d : F.Desc) (x : List Bool), isElem (d, x) = true ↔ x ∈ Set.range (F.encode d)) (hAD : ∀ (p : F.Desc × AD), hasAD = true ∨ encodeAD p = []) (adversary : Encryption.ADCCA2AdversaryOf Msg AD) (Q₁ Q₂ : ℕ → ℕ) (hQ : adversary.IsQueryBounded Q₁ Q₂) (n m : ℕ) (hm0 : 0 < m) (hm : ∀ d ∈ (setup n).support, m ≤ F.order d) :
(F.cramerShoupMsgCCA2Game hasAD encodeMsg encodeAD setup H isElem adversary false n).advantage (F.cramerShoupMsgCCA2Game hasAD encodeMsg encodeAD setup H isElem adversary true n) ≤ F.cramerShoupCCA2Bound hasAD encodeMsg encodeAD setup H isElem adversary n (Q₁ n) (Q₂ n) m

Ideal-sampling step toward [BS23], Theorem 12.9 and Exercise 12.27, not the cited result: for any adversary with decryption-query bounds (Q₁ n, Q₂ n), the 1CCA advantage at parameter n in cramerShoupMsgCCA2Game, whose key and challenge exponents are drawn exactly uniformly at the PMF level, is bounded by the DDH advantages of cramerShoupMsgToDDHDistinguisher (false and true), the collision-finding success probabilities of cramerShoupMsgToCollisionFinder (false and true), plus (2 * Q₁ n + 2 * Q₂ n + 2) / m + 42 / 2 ^ n. The cited result for the strict-PPT scheme with group-element messages is DDH.indcca2ADOn_cramerShoup_bitStringAD (with associated data in $\{0,1\}^*$) and DDH.indcca2On_cramerShoup.

theorem Cslib.Crypto.PrimeOrderGroupFamily.advantage_cramerShoupADGroupCCA2Game_le_ideal (F : PrimeOrderGroupFamily) {AD : Type} (encAD : AD ↪ List Bool) (setup : ℕ → PMF F.Desc) (H : F.Desc × List Bool → List Bool) (isElem : F.Desc × List Bool → Bool) (hmem : ∀ (d : F.Desc) (x : List Bool), isElem (d, x) = true ↔ x ∈ Set.range (F.encode d)) (adversary : Encryption.WordADCCA2Adversary AD) (Q₁ Q₂ : ℕ → ℕ) (hQ : Encryption.ADCCA2AdversaryOf.IsQueryBounded adversary Q₁ Q₂) (n m : ℕ) (hm0 : 0 < m) (hm : ∀ d ∈ (setup n).support, m ≤ F.order d) :
(F.cramerShoupADGroupCCA2Game encAD setup H isElem adversary false n).advantage (F.cramerShoupADGroupCCA2Game encAD setup H isElem adversary true n) ≤ F.cramerShoupCCA2Bound true Prod.snd (fun (p : F.Desc × AD) => encAD p.2) setup H isElem adversary n (Q₁ n) (Q₂ n) m

Ideal-sampling step toward [BS23], Theorem 12.9 and Exercise 12.27, not the cited result (after Section 12.5.3, Theorem 12.9 and Remark 12.3, printed pp. 488–493, Section 12.7, printed pp. 501–502, and Exercise 12.27, printed pp. 521–522): an adaptation of the concrete bound (12.19) to the ideal exact-uniform PMF 1CCA game cramerShoupADGroupCCA2Game for Multiplicative Cramer–Shoup $\mathcal{E}_{\mathrm{MCS}}$ with associated data and group-element messages, in the two-run single-bit reduction style (with 42 / 2 ^ n from the approximate sampleModNat exponent draws in the reductions). The cited result for the strict-PPT scheme, with associated data in $\{0,1\}^*$ (encAD = encBits), is DDH.indcca2ADOn_cramerShoup_bitStringAD, which reaches this game through advantage_cca2ADGameOn_cramerShoupADGroupCCA2Game_le.

theorem Cslib.Crypto.PrimeOrderGroupFamily.advantage_cramerShoupGroupCCA2Game_le_ideal (F : PrimeOrderGroupFamily) (setup : ℕ → PMF F.Desc) (H : F.Desc × List Bool → List Bool) (isElem : F.Desc × List Bool → Bool) (hmem : ∀ (d : F.Desc) (x : List Bool), isElem (d, x) = true ↔ x ∈ Set.range (F.encode d)) (adversary : Encryption.WordCCA2Adversary) (Q₁ Q₂ : ℕ → ℕ) (hQ : Encryption.CCA2AdversaryOf.IsQueryBounded adversary Q₁ Q₂) (n m : ℕ) (hm0 : 0 < m) (hm : ∀ d ∈ (setup n).support, m ≤ F.order d) :
(F.cramerShoupGroupCCA2Game setup H isElem adversary false n).advantage (F.cramerShoupGroupCCA2Game setup H isElem adversary true n) ≤ F.cramerShoupCCA2Bound false Prod.snd (fun (x : F.Desc × Unit) => []) setup H isElem (Encryption.CCA2AdversaryOf.toADUnit adversary) n (Q₁ n) (Q₂ n) m

Ideal-sampling step toward [BS23], Theorem 12.9 and Exercise 12.27, not the cited result (after Section 12.5.3, Theorem 12.9 and Remark 12.3, printed pp. 488–493, and Exercise 12.27, printed pp. 521–522): an original adaptation of the concrete bound (12.19) to the ideal exact-uniform PMF 1CCA game cramerShoupGroupCCA2Game for Multiplicative Cramer–Shoup $\mathcal{E}_{\mathrm{MCS}}$ with group-element messages, in the two-run single-bit reduction style (with 42 / 2 ^ n from the approximate sampleModNat exponent draws in the reductions). The cited result for the strict-PPT scheme is DDH.indcca2On_cramerShoup, which reaches this game through advantage_cca2GameOn_cramerShoupGroupCCA2Game_le.

theorem Cslib.Crypto.PrimeOrderGroupFamily.advantage_cramerShoupADCCA2Game_le_ideal (F : PrimeOrderGroupFamily) {AD : Type} (encAD : AD ↪ List Bool) (setup : ℕ → PMF F.Desc) (H : F.Desc × List Bool → List Bool) (isElem : F.Desc × List Bool → Bool) (hmem : ∀ (d : F.Desc) (x : List Bool), isElem (d, x) = true ↔ x ∈ Set.range (F.encode d)) (adversary : Encryption.ADCCA2Adversary AD) (Q₁ Q₂ : ℕ → ℕ) (hQ : Encryption.ADCCA2AdversaryOf.IsQueryBounded adversary Q₁ Q₂) (n m : ℕ) (hm0 : 0 < m) (hm : ∀ d ∈ (setup n).support, m ≤ F.order d) :
(F.cramerShoupADCCA2Game encAD setup H isElem adversary false n).advantage (F.cramerShoupADCCA2Game encAD setup H isElem adversary true n) ≤ F.cramerShoupCCA2Bound true (fun (p : F.Desc × Bool) => F.encodeBit p.1 p.2) (fun (p : F.Desc × AD) => encAD p.2) setup H isElem adversary n (Q₁ n) (Q₂ n) m

Ideal-sampling step toward [BS23], Theorem 12.9 and Exercise 12.27, not the cited result: the bound of advantage_cramerShoupMsgCCA2Game_le_ideal for single-bit messages with associated data, in the ideal exact-uniform PMF game cramerShoupADCCA2Game.

theorem Cslib.Crypto.PrimeOrderGroupFamily.advantage_cramerShoupCCA2Game_le_ideal (F : PrimeOrderGroupFamily) (setup : ℕ → PMF F.Desc) (H : F.Desc × List Bool → List Bool) (isElem : F.Desc × List Bool → Bool) (hmem : ∀ (d : F.Desc) (x : List Bool), isElem (d, x) = true ↔ x ∈ Set.range (F.encode d)) (adversary : Encryption.CCA2Adversary) (Q₁ Q₂ : ℕ → ℕ) (hQ : Encryption.CCA2AdversaryOf.IsQueryBounded adversary Q₁ Q₂) (n m : ℕ) (hm0 : 0 < m) (hm : ∀ d ∈ (setup n).support, m ≤ F.order d) :
(F.cramerShoupCCA2Game setup H isElem adversary false n).advantage (F.cramerShoupCCA2Game setup H isElem adversary true n) ≤ F.cramerShoupCCA2Bound false (fun (p : F.Desc × Bool) => F.encodeBit p.1 p.2) (fun (x : F.Desc × Unit) => []) setup H isElem (Encryption.CCA2AdversaryOf.toADUnit adversary) n (Q₁ n) (Q₂ n) m

Ideal-sampling step toward [BS23], Theorem 12.9 and Exercise 12.27, not the cited result: the bound of advantage_cramerShoupMsgCCA2Game_le_ideal for single-bit messages, in the ideal exact-uniform PMF game cramerShoupCCA2Game.

Polynomial length bounds and asymptotic 1CCA security #

theorem Cslib.Crypto.PrimeOrderGroupFamily.DDH.cramerShoupMsgIdealINDCCA2 {F : PrimeOrderGroupFamily} (hasAD : Bool) {Msg AD : Type} {encMsg : Msg ↪ List Bool} {encAD : AD ↪ List Bool} {encodeMsg : F.Desc × Msg → List Bool} {encodeAD : F.Desc × AD → List Bool} (hencMsg : Turing.MultiTapeTM.ComputableInPolyTime encodeMsg (Turing.MultiTapeTM.encPair F.encDesc encMsg) Turing.MultiTapeTM.encBits) (hencAD : Turing.MultiTapeTM.ComputableInPolyTime encodeAD (Turing.MultiTapeTM.encPair F.encDesc encAD) Turing.MultiTapeTM.encBits) {setup : ℕ → PMF F.Desc} {H : F.Desc × List Bool → List Bool} {isElem : F.Desc × List Bool → Bool} (hH : Turing.MultiTapeTM.ComputableInPolyTime H (Turing.MultiTapeTM.encPair F.encDesc Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBits) (hisElem : Turing.MultiTapeTM.ComputableInPolyTime isElem (Turing.MultiTapeTM.encPair F.encDesc Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBool) (hmem : ∀ (d : F.Desc) (x : List Bool), isElem (d, x) = true ↔ x ∈ Set.range (F.encode d)) (hAD : ∀ (p : F.Desc × AD), hasAD = true ∨ encodeAD p = []) (hDDH : F.DDH setup) (hCR : CollisionResistantForOn F.encDesc setup (F.cramerShoupHashMod H) fun (x : ℕ) => F.isCramerShoupHashInput hasAD isElem) {m : ℕ → ℕ} (hm0 : ∀ (n : ℕ), 0 < m n) (hm : ∀ (n : ℕ), ∀ d ∈ (setup n).support, m n ≤ F.order d) (hinv : Negligible fun (n : ℕ) => 1 / ↑(m n)) (hdesc : ∃ (c : ℕ) (k : ℕ), ∀ (n : ℕ), ∀ d ∈ (setup n).support, (F.encDesc d).length ≤ c * (n + 1) ^ k) :
Game.Indistinguishable (fun (adversary : Encryption.ADCCA2AdversaryOf Msg AD) (n : ℕ) => F.cramerShoupMsgCCA2Game hasAD encodeMsg encodeAD setup H isElem adversary false n) (fun (adversary : Encryption.ADCCA2AdversaryOf Msg AD) (n : ℕ) => F.cramerShoupMsgCCA2Game hasAD encodeMsg encodeAD setup H isElem adversary true n) (Encryption.ADCCA2AdversaryOf.IsPPT encMsg encAD)

Ideal-sampling step toward DDH.indcca2ADOn_cramerShoup_bitStringAD and DDH.indcca2On_cramerShoup, not the cited result: asymptotic 1CCA security of Multiplicative Cramer–Shoup for general message and associated-data encodings in the ideal exact-uniform PMF game (after [BS23], Theorem 12.9, Section 12.7 & Exercise 12.27, printed pp. 488–493, 501–502, 521–522). If DDH holds for an arbitrary setup law setup, cramerShoupHashMod H is collision-resistant for setup on its well-formed inputs isCramerShoupHashInput hasAD isElem, every supported group at parameter n has order at least m n > 0 with 1 / m n negligible, and supported group descriptions have polynomially bounded bit-length, then cramerShoupMsgCCA2Game, whose exponents are drawn exactly uniformly, is indistinguishable between bit = false and bit = true against all strict oracle PPT adversaries. The premise hAD says that without associated data (hasAD = false) the challenge's associated-data word is [], as in every specialization, so that the challenge's hashed tuple is well-formed.

theorem Cslib.Crypto.PrimeOrderGroupFamily.DDH.cramerShoupADGroupIdealINDCCA2 {F : PrimeOrderGroupFamily} {AD : Type} (encAD : AD ↪ List Bool) {setup : ℕ → PMF F.Desc} {H : F.Desc × List Bool → List Bool} {isElem : F.Desc × List Bool → Bool} (hH : Turing.MultiTapeTM.ComputableInPolyTime H (Turing.MultiTapeTM.encPair F.encDesc Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBits) (hisElem : Turing.MultiTapeTM.ComputableInPolyTime isElem (Turing.MultiTapeTM.encPair F.encDesc Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBool) (hmem : ∀ (d : F.Desc) (x : List Bool), isElem (d, x) = true ↔ x ∈ Set.range (F.encode d)) (hDDH : F.DDH setup) (hCR : CollisionResistantForOn F.encDesc setup (F.cramerShoupHashMod H) fun (x : ℕ) => F.isCramerShoupHashInput true isElem) {m : ℕ → ℕ} (hm0 : ∀ (n : ℕ), 0 < m n) (hm : ∀ (n : ℕ), ∀ d ∈ (setup n).support, m n ≤ F.order d) (hinv : Negligible fun (n : ℕ) => 1 / ↑(m n)) (hdesc : ∃ (c : ℕ) (k : ℕ), ∀ (n : ℕ), ∀ d ∈ (setup n).support, (F.encDesc d).length ≤ c * (n + 1) ^ k) :
F.cramerShoupADGroupIdealINDCCA2 encAD setup H isElem

Ideal-sampling step toward DDH.indcca2ADOn_cramerShoup_bitStringAD, not the cited result (after [BS23], Theorem 12.9 & Exercise 12.27): for group-element messages with associated data AD, Multiplicative Cramer–Shoup satisfies the ideal exact-uniform PMF 1CCA notion cramerShoupADGroupIdealINDCCA2 under DDH, collision resistance of cramerShoupHashMod H on isCramerShoupHashInput true isElem, a positive group-order lower bound m n > 0 with 1 / m n negligible, and polynomially bounded group description bit-length, for an arbitrary setup law. The hash premise covers every associated-data word, not only those in the range of encAD, because decryption hashes any associated-data word; it is the exercise's premise only when encAD is onto, as encBits is.

theorem Cslib.Crypto.PrimeOrderGroupFamily.DDH.cramerShoupGroupIdealINDCCA2 {F : PrimeOrderGroupFamily} {setup : ℕ → PMF F.Desc} {H : F.Desc × List Bool → List Bool} {isElem : F.Desc × List Bool → Bool} (hH : Turing.MultiTapeTM.ComputableInPolyTime H (Turing.MultiTapeTM.encPair F.encDesc Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBits) (hisElem : Turing.MultiTapeTM.ComputableInPolyTime isElem (Turing.MultiTapeTM.encPair F.encDesc Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBool) (hmem : ∀ (d : F.Desc) (x : List Bool), isElem (d, x) = true ↔ x ∈ Set.range (F.encode d)) (hDDH : F.DDH setup) (hCR : CollisionResistantForOn F.encDesc setup (F.cramerShoupHashMod H) fun (x : ℕ) => F.isCramerShoupHashInput false isElem) {m : ℕ → ℕ} (hm0 : ∀ (n : ℕ), 0 < m n) (hm : ∀ (n : ℕ), ∀ d ∈ (setup n).support, m n ≤ F.order d) (hinv : Negligible fun (n : ℕ) => 1 / ↑(m n)) (hdesc : ∃ (c : ℕ) (k : ℕ), ∀ (n : ℕ), ∀ d ∈ (setup n).support, (F.encDesc d).length ≤ c * (n + 1) ^ k) :

Ideal-sampling step toward DDH.indcca2On_cramerShoup, not the cited result (after [BS23], Theorem 12.9 & Exercise 12.27): for group-element messages, Multiplicative Cramer–Shoup satisfies the ideal exact-uniform PMF 1CCA notion cramerShoupGroupIdealINDCCA2 under DDH, collision resistance of cramerShoupHashMod H on its well-formed inputs isCramerShoupHashInput false isElem, a positive group-order lower bound m n > 0 with 1 / m n negligible, and polynomially bounded group description bit-length, for an arbitrary setup law.

Encryption.cca2ADGameOn, Encryption.INDCCA2ADOn, Encryption.cca2GameOn, and #

Encryption.INDCCA2On instantiations

theorem Cslib.Crypto.PrimeOrderGroupFamily.advantage_cca2ADGameOn_cramerShoupADGroupCCA2Game_le (F : PrimeOrderGroupFamily) {AD : Type} (encAD : AD ↪ List Bool) (H : F.withKey.Desc × List Bool → List Bool) (isElem : F.Desc × List Bool → Bool) (hmem : ∀ (d : F.Desc) (x : List Bool), isElem (d, x) = true ↔ x ∈ Set.range (F.encode d)) (d : ℕ → F.Desc) (keyLen : ℕ → ℕ) (adversary : Encryption.WordADCCA2Adversary AD) (bit : Bool) (n : ℕ) :
Game.advantage (Encryption.cca2ADGameOn (F.cramerShoupValid isElem d) encAD Turing.MultiTapeTM.encBits (F.cramerShoupKeyGenProb d keyLen) (F.cramerShoupADEncryptProb encAD H d) (F.cramerShoupADDecryptOpt H isElem d) adversary bit n).eval (F.withKey.cramerShoupADGroupCCA2Game encAD (F.withKeySetup (fun (n : ℕ) => PMF.pure (d n)) keyLen) H (F.isElemWithKey isElem) adversary bit n) ≤ 8 / 2 ^ n

The native Encryption.cca2ADGameOn experiment for (cramerShoupValid, cramerShoupKeyGenProb, cramerShoupADEncryptProb, cramerShoupADDecryptOpt) with a keyed hash is within statistical distance 8 / 2 ^ n of the ideal exact-uniform PMF game cramerShoupADGroupCCA2Game over F.withKey and the setup withKeySetup (fun n => PMF.pure (d n)) keyLen (accounting for the eight sampleModNat exponent draws in cramerShoupKeyGenProb and cramerShoupADEncryptProb; both games draw the same uniform hash key).

theorem Cslib.Crypto.PrimeOrderGroupFamily.DDH.indcca2ADOn_cramerShoup_bitStringAD {F : PrimeOrderGroupFamily} {H : F.withKey.Desc × List Bool → List Bool} {isElem : F.Desc × List Bool → Bool} {d : ℕ → F.Desc} {keyLen : ℕ → ℕ} (hH : Turing.MultiTapeTM.ComputableInPolyTime H (Turing.MultiTapeTM.encPair F.withKey.encDesc Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBits) (hisElem : Turing.MultiTapeTM.ComputableInPolyTime isElem (Turing.MultiTapeTM.encPair F.encDesc Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBool) (hd : Turing.MultiTapeTM.ComputableInPolyTime d Turing.MultiTapeTM.encUnary F.encDesc) (hkeyLen : Turing.MultiTapeTM.ComputableInPolyTime keyLen Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encUnary) (hmem : ∀ (d : F.Desc) (x : List Bool), isElem (d, x) = true ↔ x ∈ Set.range (F.encode d)) (hDDH : F.DDH fun (n : ℕ) => PMF.pure (d n)) (hCR : CollisionResistantForOn F.withKey.encDesc (F.withKeySetup (fun (n : ℕ) => PMF.pure (d n)) keyLen) (F.withKey.cramerShoupHashMod H) fun (x : ℕ) => F.withKey.isCramerShoupHashInput true (F.isElemWithKey isElem)) {m : ℕ → ℕ} (hm0 : ∀ (n : ℕ), 0 < m n) (hm : ∀ (n : ℕ), m n ≤ F.order (d n)) (hinv : Negligible fun (n : ℕ) => 1 / ↑(m n)) :

Multiplicative Cramer–Shoup with associated data in $\mathcal{D} = \{0,1\}^*$ is 1CCA secure ([BS23], Exercise 12.27, printed pp. 521–522, by the method of Theorem 12.9, printed pp. 489–493) under DDH and collision resistance of $H'$ on $\mathbb{G}^3 \times \{0,1\}^*$. The associated-data space is all words because decryption hashes whatever associated-data word it is given: cca2ADPhase1Oracle and cca2ADPhase2Oracle pass any word to cramerShoupADDecryptOpt. A general space $\mathcal{D}$, with collision resistance assumed only on $\mathbb{G}^3 \times \mathcal{D}$, is open (#5293); it needs decryption to reject associated data outside $\mathcal{D}$.

In detail: for any polynomial-time group description family d : ℕ → F.Desc, polynomial-time key length keyLen, and polynomial-time H and isElem such that isElem accepts exactly the encodings of group elements, the probabilistic polynomial-time scheme (cramerShoupKeyGenProb d keyLen, cramerShoupADEncryptProb encBits H d, cramerShoupADDecryptOpt H isElem d), with associated data the bit strings themselves (encBits is the identity embedding), satisfies the native single-challenge Encryption.INDCCA2ADOn notion with respect to cramerShoupValid isElem d. The premises are DDH for the point-mass setup fun n => PMF.pure (d n); collision resistance of the keyed hash family F.withKey.cramerShoupHashMod H, whose system parameter is the group d n together with a uniform keyLen n-bit key, on the words that isCramerShoupHashInput true accepts (encoded group-element triples with any associated-data word); and a positive lower bound m n ≤ F.order (d n) with 1 / m n negligible. Key generation draws the hash key and publishes it in the public key, as in [CS03], Section 6.1, Figure 1. The group at parameter n is the fixed description d n; it is not sampled. [CS03], Theorem 1, assumes only target collision resistance of the keyed hash.

theorem Cslib.Crypto.PrimeOrderGroupFamily.advantage_cca2GameOn_cramerShoupGroupCCA2Game_le (F : PrimeOrderGroupFamily) (H : F.withKey.Desc × List Bool → List Bool) (isElem : F.Desc × List Bool → Bool) (hmem : ∀ (d : F.Desc) (x : List Bool), isElem (d, x) = true ↔ x ∈ Set.range (F.encode d)) (d : ℕ → F.Desc) (keyLen : ℕ → ℕ) (adversary : Encryption.WordCCA2Adversary) (bit : Bool) (n : ℕ) :
Game.advantage (Encryption.cca2GameOn (F.cramerShoupValid isElem d) Turing.MultiTapeTM.encBits (F.cramerShoupKeyGenProb d keyLen) (F.cramerShoupEncryptProb H d) (F.cramerShoupDecryptOpt H isElem d) adversary bit n).eval (F.withKey.cramerShoupGroupCCA2Game (F.withKeySetup (fun (n : ℕ) => PMF.pure (d n)) keyLen) H (F.isElemWithKey isElem) adversary bit n) ≤ 8 / 2 ^ n

The native Encryption.cca2GameOn experiment for (cramerShoupValid, cramerShoupKeyGenProb, cramerShoupEncryptProb, cramerShoupDecryptOpt) with a keyed hash is within statistical distance 8 / 2 ^ n of the ideal exact-uniform PMF game cramerShoupGroupCCA2Game over F.withKey and the setup withKeySetup (fun n => PMF.pure (d n)) keyLen (accounting for the eight sampleModNat exponent draws in cramerShoupKeyGenProb and cramerShoupEncryptProb; both games draw the same uniform hash key).

Multiplicative Cramer–Shoup is 1CCA secure ([BS23], Exercise 12.27, printed pp. 521–522, without associated data, proved by the method of Theorem 12.9, printed pp. 489–493) under DDH and collision resistance of $H'$ on its well-formed inputs $\mathbb{G}^3 \times \mathcal{D}$, here with $\mathcal{D} = \{[]\}$. For any polynomial-time group description family d : ℕ → F.Desc, polynomial-time key length keyLen, and polynomial-time H and isElem such that isElem accepts exactly the encodings of group elements, the probabilistic polynomial-time scheme (cramerShoupKeyGenProb d keyLen, cramerShoupEncryptProb H d, cramerShoupDecryptOpt H isElem d) satisfies the native single-challenge Encryption.INDCCA2On notion with respect to cramerShoupValid isElem d. The premises are DDH for the point-mass setup fun n => PMF.pure (d n); collision resistance of the keyed hash family F.withKey.cramerShoupHashMod H, whose system parameter is the group d n together with a uniform keyLen n-bit key, on the words that isCramerShoupHashInput false accepts (encoded group-element triples with empty associated data); and a positive lower bound m n ≤ F.order (d n) with 1 / m n negligible. Key generation draws the hash key and publishes it in the public key, as in [CS03], Section 6.1, Figure 1. The group at parameter n is the fixed description d n; it is not sampled. [CS03], Theorem 1, assumes only target collision resistance of the keyed hash.

Multiplicative Cramer–Shoup is CCA secure in the batch-challenge game ([BS23], Exercise 12.27, printed pp. 521–522, proved by the method of Theorem 12.9, printed pp. 489–493, and the batch-challenge specialization of Theorem 12.1, printed p. 468) under DDH and collision resistance of $H'$ on its well-formed inputs $\mathbb{G}^3 \times \mathcal{D}$, here with $\mathcal{D} = \{[]\}$. Under the hypotheses of DDH.indcca2On_cramerShoup, the scheme (cramerShoupKeyGenProb d keyLen, cramerShoupEncryptProb H d, cramerShoupDecryptOpt H isElem d) satisfies the two-phase batch-challenge multi-challenge Encryption.INDCCA2MultiOn notion with respect to cramerShoupValid isElem d. The hash key is drawn at key generation and published in the public key.