Multiplicative Cramer–Shoup Encryption Scheme and Adaptive Projective-Hash Rejection #
This module formalizes the Multiplicative Cramer–Shoup public-key encryption scheme
($\mathcal{E}_{\mathrm{MCS}}$, Boneh and Shoup, Section 12.5.3 and Exercise 12.27, printed
pp. 488–493, 521–522, specialized to associated data
$\mathcal{D} = \mathrm{Unit}$) over a PrimeOrderGroupFamily, proves its algebraic and word-level
decryption correctness and polynomial-time computability certificates, and establishes the
adaptive Lemma 12.8 projective-hash rejection bound and Lemma 12.6 one-time group-mask
challenge blindness (Games 3 $\to$ 3.5 $\to$ 4 $\to$ 5 of Theorem 12.9, printed pp. 492–493)
against an adaptive CCA2AdversaryOf Msg. Groups are written additively as
ZMod (F.order d)-modules (matching DiscreteLog, DiffieHellman, ElGamal, and
ProjectiveHash).
Source Statements ([BS23], Sections 12.5.1–12.5.3 & Exercise 12.27) #
Verbatim from [BS23], Sections 12.5.1–12.5.2 (Lemma 12.6 in §12.5.1, printed p. 486; Lemma 12.8 in §12.5.2, printed p. 488):
Lemma 12.6. In Attack Game 12.4, $\Pr[W_0] = \Pr[W_1]$ for all adversaries $\mathcal{A}$. … Lemma 12.8. In Attack Game 12.5, for any adversary $\mathcal{A}$ that outputs at most $Q$ tuples, the probability that it wins is at most $Q/q$.
Verbatim from [BS23], Section 12.5.3 (printed pp. 488–493):
- the key generation algorithm runs as follows: $$\begin{aligned} G() :=\quad & \alpha \xleftarrow{R} \mathbb{Z}_q,\; u \leftarrow g^\alpha,\; \sigma, \tau \xleftarrow{R} \mathbb{Z}_q,\; h \leftarrow g^\sigma u^\tau \\ & \sigma_1, \tau_1, \sigma_2, \tau_2 \xleftarrow{R} \mathbb{Z}_q,\; h_1 \leftarrow g^{\sigma_1} u^{\tau_1},\; h_2 \leftarrow g^{\sigma_2} u^{\tau_2} \\ & pk \leftarrow (u, h, h_1, h_2),\; sk \leftarrow (\sigma, \tau, \sigma_1, \tau_1, \sigma_2, \tau_2),\; \text{output } (pk, sk); \end{aligned}$$ … Game 5. We again widen the rejection rule at line (5), replacing it with: $$(5) \qquad \text{if } \hat{v}^\alpha \ne \hat{w} \text{ or } \mathit{Coll}_{u,v}(\hat{u}, \hat{v}) \text{ or } z' \ne f'(\hat{v}, \hat{w}, \hat{\rho})$$ So this rule will reject the ciphertext if $(\hat{v}, \hat{w}) \notin L_u$. Let $Z_5$ be the event that in Game 5, some decryption query, which would not have triggered the rejection rule of Game 4, does trigger the wider rejection rule in Game 5. Clearly, Games 4 and 5 proceed identically unless event $Z_5$ occurs. By the Difference Lemma, we have $$|\Pr[W_4] - \Pr[W_5]| \le \Pr[Z_5]. \quad (12.26)$$ We will argue that $\Pr[Z_5] \le Q_d / q$. $(12.27)$ … Game 6. Everything we did so far was leading to this point, which is the crux of the proof. We replace line (2) in Fig. 12.3 with $z \xleftarrow{R} \mathbb{G}$. We claim that $\Pr[W_6] = \Pr[W_5]$. $(12.28)$ This follows from Lemma 12.6, and the fact that in processing decryption queries in Game 5, we only need to evaluate $f(\hat{v}, \hat{w})$ at points $(\hat{v}, \hat{w}) \in L_u$. … Remark 12.3 (Group membership verification). For reasons similar to that discussed in Remark 12.1, it is essential that given a ciphertext $(v, w, z', c)$, the decryption algorithm for $\mathcal{E}_{\mathrm{CS}}$ verifies that $v$ and $w$ are in $\mathbb{G}$. It is not necessary to explicitly check that $z'$ is in $\mathbb{G}$, since the check that $v^{\sigma_1 + \rho \sigma_2} w^{\tau_1 + \rho \tau_2} = z'$ implies that $z'$ is in $\mathbb{G}$.
Verbatim from [BS23], Exercise 12.27 (printed pp. 521–522):
12.27 (Multiplicative Cramer-Shoup encryption). Consider the following multiplicative version of the Cramer-Shoup encryption scheme (presented in Section 12.5) that supports associated data (see Section 12.7) coming from a set $\mathcal{D}$. Let $\mathbb{G}$ be a cyclic group of prime order $q$ with generator $g \in \mathbb{G}$. Let $H' : \mathbb{G}^3 \times \mathcal{D} \to \mathbb{Z}_q$ be a hash function. The encryption scheme $\mathcal{E}_{\mathrm{MCS}} = (G, E, D)$ is defined over $(\mathbb{G}, \mathcal{D}, \mathbb{G}^4)$ as follows. Key generation is exactly as in $\mathcal{E}_{\mathrm{CS}}$. For a given public key $pk = (u, h, h_1, h_2) \in \mathbb{G}^4$ message $m \in \mathbb{G}$, and associated data $d \in \mathcal{D}$, the encryption algorithm runs as follows: $$E(pk, m, d) := \beta \xleftarrow{R} \mathbb{Z}_q,\; v \leftarrow g^\beta,\; w \leftarrow u^\beta,\; e \leftarrow h^\beta \cdot m,\; \rho \leftarrow H'(v, w, e, d),\; z' \leftarrow (h_1 h_2^\rho)^\beta,\; \text{output } (v, w, e, z').$$ For a given secret key $sk = (\sigma, \tau, \sigma_1, \tau_1, \sigma_2, \tau_2) \in \mathbb{Z}_q^6$ and a ciphertext $(v, w, e, z') \in \mathbb{G}^4$, and associated data $d \in \mathcal{D}$, the decryption algorithm runs as follows: $$D(sk, (v, w, e, z', d)) := \rho \leftarrow H'(v, w, e, d);\; \text{if } v^{\sigma_1 + \rho \sigma_2} w^{\tau_1 + \rho \tau_2} = z' \text{ then output } e / (v^\sigma w^\tau) \text{ else output reject}.$$ Show that $\mathcal{E}_{\mathrm{MCS}}$ is CCA secure, provided $H'$ is collision resistant and the DDH assumption holds for $\mathbb{G}$.
Existing Notions Considered #
Cslib.Crypto.PrimeOrderGroupFamily(DiffieHellman.lean) andElGamal(ElGamal.lean): reused for group descriptions, carriers, generators, encodings, and word-level group operations.Cslib.Crypto.ProjectiveHash(Complexity/Crypto/Computational/CramerShoup/ProjectiveHash.lean): reused forprojHash,projHashAux,projHash2,projHash2Aux, fiber identities,projHashFiberEquiv,projHash2QueryFiberEquiv, anduniform_projHash_fiber_add.Cslib.Crypto.Encryption.CCA2AdversaryOf(Complexity/Crypto/Computational/Encryption/CCA.lean) andCslib.Crypto.isCollisionFor(CollisionResistant.lean): reused for adaptive 1CCA adversaries and Phase 2 hash collisions inZMod (F.order d).Cslib.Crypto.Game(Game.lean,Complexity/Crypto/Game/UntilBad.lean): reused forrunStatelessOracle,advantage_runStatelessOracle_bind_le,bind_runStatelessOracle_comm,advantage_runStatelessOracle_le_of_support,advantage_bind_le_nnreal,advantage_bind_le_of_support,advantage_bind_comm, andadvantage_uniform_bind_of_eq_of_ne.
Main definitions and results #
cramerShoupHashMod,cramerShoupPublicKey,cramerShoupEncrypt,cramerShoupDecrypt,encodeCramerShoupPublicKey,encodeCramerShoupEncrypt,encodeCramerShoupChallenge,decodeCramerShoup: algebraic and word-level Multiplicative Cramer–Shoup operations.cramerShoupDecrypt_cramerShoupEncrypt,decodeCramerShoup_encode,decodeCramerShoup_cramerShoupEncrypt,computableInPolyTime_encodeCramerShoupPublicKey,computableInPolyTime_encodeCramerShoupEncrypt,computableInPolyTime_encodeCramerShoupChallenge,computableInPolyTime_decodeCramerShoup: decryption correctness and polynomial-time computability certificates.cramerShoupGame3,cramerShoupGame3Half,cramerShoupGame4,cramerShoupGame5,advantage_cramerShoupGame3_game3Half_le,advantage_cramerShoupGame3Half_game4_le,advantage_cramerShoupGame3_game4_le,cramerShoupGame5_false_eq_true,advantage_cramerShoupGame4_game5_le: the adaptive Lemma 12.8 projective-hash rejection bounds (Q₁ / m,Q₂ / m,(Q₁ + Q₂) / m) and Lemma 12.6 one-time group-mask bound (1 / m).
Framing for 3-tuples and 4-tuples of bit strings #
decodeBits4 is computable in polynomial time.
The $\mathbb{Z}_q$-valued hash family $H'_d(x) = (\mathrm{ofBits}(H(d, x)) : \mathbb{Z}_q)$
induced by a word-level hash function H : F.Desc × List Bool → List Bool
([BS23], Exercise 12.27, printed p. 521).
Instances For
Encode a triple of group elements (v, w, e) : F.Carrier d × F.Carrier d × F.Carrier d as a
framed bit string.
Instances For
Algebraic Cramer–Shoup public key pk = (u, h, h₁, h₂) ∈ G⁴ generated from secret exponents
(α, σ, τ, σ₁, τ₁, σ₂, τ₂) ([BS23], Section 12.5.3, printed p. 489).
Instances For
Algebraic Multiplicative Cramer–Shoup encryption $E(pk, m; \beta) = (v, w, e, z')$ ([BS23], Exercise 12.27, printed p. 521, with $\mathcal{D} = \mathrm{Unit}$).
Instances For
Under a genuine public key cramerShoupPublicKey d α σ τ σ₁ τ₁ σ₂ τ₂, the components of
cramerShoupEncrypt coincide with projective hash evaluation (Game 0 = Game 1,
[BS23], Section 12.5.3, equation (12.21), printed p. 490).
Algebraic Multiplicative Cramer–Shoup decryption $D(sk, (v, w, e, z'))$
([BS23], Exercise 12.27, printed p. 522): check
$f'_{\sigma_1,\tau_1,\sigma_2,\tau_2}(v, w, \rho) = z'$ where $\rho = H'(v, w, e)$, and if so
output some (e - f_{σ,τ}(v, w)).
Instances For
Algebraic Cramer–Shoup decryption correctness ([BS23], Section 12.5.3 &
Exercise 12.27, printed pp. 489, 521–522): decrypting an honest encryption under
cramerShoupPublicKey d α σ τ σ₁ τ₁ σ₂ τ₂ with ((σ, τ), ((σ₁, τ₁), (σ₂, τ₂))) recovers
some m.
Word-level polynomial-time Cramer–Shoup operations #
Encoded group negation -x = (q - 1) • x computed via F.smul (d, F.order d - 1, z).
Instances For
Word-level universal projective hash f_{s,t}(v, w) = s • v + t • w.
Instances For
Word-level public projection h = f_{s,t}(g, u) = s • g + t • u.
Instances For
Word-level $\text{universal}_2$ projective hash
f'_{s₁,t₁,s₂,t₂}(v, w, r) = f_{s₁,t₁}(v, w) + r • f_{s₂,t₂}(v, w).
Instances For
Encode a 4-tuple of group elements (u, h, h₁, h₂) together with d : F.Desc as the public
key word presented to a 1CCA adversary.
Instances For
Word-level Cramer–Shoup public key generation from d : F.Desc, an encoded
u = encode (α • g), and natural-number secret exponents
sk = ((s, t), ((s₁, t₁), (s₂, t₂))).
Instances For
Word-level Cramer–Shoup encryption from the public key (u, h, h₁, h₂), encoded message m,
and randomness b : ℕ.
Instances For
Word-level Game 1 challenge encryption from (v, w) (encoded group elements), secret key
sk, and encoded message m ([BS23], Section 12.5.3, Game 1, printed p. 490).
Instances For
Word-level Cramer–Shoup decryption ([BS23], Section 12.5.3, Remark 12.3, and
Exercise 12.27, printed pp. 489, 493, 522): given (d, sk, ct), unpack (v, w, e, z') := decodeBits4 ct, check canonical framing encBits4 (v, w, e, z') == ct, check group membership
isElem (d, v) && isElem (d, w) && isElem (d, e), and check
encodeProjHash2 d s₁ t₁ s₂ t₂ r v w == z'; if all pass, return
some (encode (e - f_{s,t}(v, w))), else none.
Instances For
Word-level Cramer–Shoup decryption matches algebraic cramerShoupDecrypt on encoded
ciphertexts.
Word-level Cramer–Shoup decryption of an honest encryption recovers
some (F.encode d m).
Polynomial-time certificates for word-level operations #
Word-level Cramer–Shoup public key generation is computable in polynomial time.
Word-level Cramer–Shoup secret-key challenge encryption encodeCramerShoupChallenge is
computable in polynomial time whenever H is.
Word-level Cramer–Shoup encryption is computable in polynomial time whenever H is.
Word-level Cramer–Shoup decryption is computable in polynomial time whenever H and
isElem are computable in polynomial time.
Collision detection and decryption oracle replies #
Test whether a Phase 2 ciphertext query req yields a cramerShoupHashMod H d collision with
the challenge ciphertext ct on their (v, w, e) prefixes.
Instances For
isCramerShoupCollision coincides with isCollisionFor (F.cramerShoupHashMod H) on the
extracted (v, w, e) triples.
Stateless Phase 2 decryption reply that rejects the challenge ciphertext ct and any query
req colliding with ct under cramerShoupHashMod H d.
Instances For
Canonical secret-key conversion and hybrid Games 3–5 #
Convert six ZMod (F.order d) exponents (σ, τ, σ₁, τ₁, σ₂, τ₂) into their canonical natural
number representatives ((σ.val, τ.val), ((σ₁.val, τ₁.val), (σ₂.val, τ₂.val))).
Instances For
Game 3 (corresponding to Game 4 of [BS23], Section 12.5.3, printed p. 492,
adapted to $\mathcal{E}_{\mathrm{MCS}}$): Phase 1 uses cramerShoupPhase1Reply and Phase 2 rejects
both ct and any ciphertext query req whose (v, w, e) prefix collides with ct under
cramerShoupHashMod H d (cramerShoupCollisionPhase2Reply).
Instances For
Projective-hash rejection (Games 3.5, 4, and 5) and concrete 1CCA bound #
Decryption helper for Game 4 ([BS23], Section 12.5.3, printed p. 492): on the fiber
σ = δ - α * τ, σ₁ = δ₁ - α * τ₁, σ₂ = δ₂ - α * τ₂, reject any ciphertext whose (v', w')
pair does not satisfy w' == F.smul (d, α.val, v'), and otherwise decrypt using
(δ, 0, δ₁, 0, δ₂, 0) (which agrees with (σ, τ, σ₁, τ₁, σ₂, τ₂) on all Diffie–Hellman queries
by projHash_fiber_eq and projHash2_fiber_dh).
Instances For
Stateless Phase 1 decryption reply for Game 3.5 and Game 4, rejecting non-DH queries.
Instances For
Stateless Phase 2 decryption reply for Game 4, rejecting ct, H'-collisions with ct, and
non-DH queries.
Instances For
Bad-event predicate for Game 3 $\to$ Game 4 ([BS23], Section 12.5.3, equations
(12.26)–(12.27), printed pp. 492–493): req = encBits4 (v', w', e', z') is a syntactically
well-formed non-DH ciphertext (w' != F.smul (d, α.val, v')) whose tag z' matches
encodeProjHash2.
Instances For
Phase 1 query bound on honest public keys at security parameter n.
Instances For
Phase 2 query bound on honest Phase 1 states and challenge ciphertexts at parameter n.
Instances For
Game 3.5 (intermediate hybrid between Game 3 and Game 4 of [BS23],
Section 12.5.3, printed pp. 491–492): under the fiber change of variables
σ = δ - α * τ, σ₁ = δ₁ - α * τ₁, σ₂ = δ₂ - α * τ₂, replace Phase 1's decryption oracle
cramerShoupPhase1Reply with cramerShoupDHPhase1Reply (rejecting non-DH queries in Phase 1).
Instances For
Game 3 $\to$ Game 3.5 bound: replacing cramerShoupPhase1Reply with
cramerShoupDHPhase1Reply changes the game advantage by at most Q₁ / m whenever Phase 1 makes at
most Q₁ queries on every honest public key.
Game 4 (corresponding to Game 5 of [BS23], Section 12.5.3, printed p. 492,
adapted to $\mathcal{E}_{\mathrm{MCS}}$): both Phase 1 and Phase 2 decryption oracles reject any
non-DH ciphertext query (w' != F.smul (d, α.val, v')) via decodeCramerShoupDH.
Instances For
Game 3.5 $\to$ Game 4 bound: replacing cramerShoupCollisionPhase2Reply with
cramerShoupDHPhase2Reply changes the game advantage by at most Q₂ / m whenever Phase 2 makes at
most Q₂ queries on every honest Phase 1 state and challenge ciphertext.
Game 3 $\to$ Game 4 bound ([BS23], Section 12.5.3, equations (12.26)–(12.27),
printed pp. 492–493, using Lemma 12.8, printed p. 488): replacing both Phase 1 and Phase 2
decryption oracles with their DH-restricted counterparts changes the game advantage by at most
(Q₁ + Q₂) / m.
Game 5 (corresponding to Game 6 of [BS23], Section 12.5.3, printed p. 493, adapted
to $\mathcal{E}_{\mathrm{MCS}}$): replace the masked challenge component
e = projHash F d (δ - α * τ) τ v w + m by a uniform independent group element ζ • g, making the
entire experiment independent of the challenge bit bit.
Instances For
In cramerShoupGame5, the challenge bit is unused, so the false and true experiments are
identical.
Game 4 $\to$ Game 5 bound ([BS23], Section 12.5.3, equations (12.23) and (12.28),
printed pp. 492–493, using Lemma 12.6, printed p. 486):
whenever γ ≠ α * β, projHash F d (δ - α * τ) τ (β • g) (γ • g) + m is uniformly distributed
over F.Carrier d by uniform_projHash_fiber_add (Lemma 12.6), so cramerShoupGame4 and
cramerShoupGame5 differ only on the event γ = α * β of probability 1 / F.order d ≤ 1 / m.