Fully adaptive interleaved-query multi-challenge CCA security (Attack Game 12.1) #
Cslib.Crypto.Encryption.CCA2AdversaryOf and Cslib.Crypto.Encryption.MultiCCA2AdversaryOf in
CslibFrontier.Crypto.Computational.Encryption.CCA formalize the single-challenge (1CCA,
Definition 12.2) and two-phase batch-challenge (Phased Multi-CCA2) chosen-ciphertext security
experiments. In full generality, Boneh and Shoup, Section 12.1, Attack Game 12.1, Definition 12.1,
and Theorem 12.1, printed pp. 467–469 (see also Katz and Lindell, Section
12.2) allow the adversary to adaptively interleave encryption (challenge)
queries and decryption queries in arbitrary order:
- The challenger generates
(pk, sk) ← keyGen n, fixes the secret challenge bitbit : Bool, and initializes the forbidden challenge-ciphertext listS = []. - In each adaptive round, the adversary (given
pk, its saved state, and the previous oracle response, and with adaptive access to the current decryption oracle rejecting ciphertexts inS) submits a combined queryq : CCAQuery Msg (List Bool)tointerleavedCcaOracle:- Encryption / challenge query (
.challenge m₀ m₁): ifvalid n pk m₀ m₁holds, the challenger encryptsif bit then m₁ else m₀(ct ← encrypt n pk (if bit then m₁ else m₀)), prependsctto the forbidden setS, and returnsSum.inl (some ct)(encoded asencOption encBits (some ct) = true :: ct); otherwise it returnsSum.inl none([]) withSunchanged. - Decryption query (
.decrypt c): ifc ∈ S(whereSis the list of challenge ciphertexts produced so far), the challenger rejects withSum.inr none([]); otherwise it returnsSum.inr (decrypt n sk c)(encoded asencOption encOut (decrypt n sk c)) withSunchanged. Crucially, a ciphertextcqueried to.decrypt cbeforechappens to be produced by a later.challengequery is decrypted normally, whereas any.decrypt cquery aftercwas returned by.challengeis rejected.
- Encryption / challenge query (
- After
adversary.numRounds nadaptive rounds, the adversary runs a final guessing stagefinish(with access to the decryption oracle rejectingS) and outputs a bitBool.
Main definitions #
Cslib.Crypto.Encryption.CCAQuery,Cslib.Crypto.Encryption.CCAResponse,Cslib.Crypto.Encryption.encCCAQuery,Cslib.Crypto.Encryption.encodeCCAResponseWord: sum-like query and response types for the combined encryption-and-decryption CCA oracle, the injective bit-string encoding of queries, and the bit-word encoding of response payloads, which drops theSumtag and is not injective.Cslib.Crypto.Encryption.interleavedCcaOracle,Cslib.Crypto.Encryption.interleavedCcaWordOracle: stateful interleaved CCA oracle tracking the listS : List (List Bool)of challenge ciphertexts generated so far.Cslib.Crypto.Encryption.InterleavedCCA2AdversaryOf,Cslib.Crypto.Encryption.InterleavedCCA2Adversary,Cslib.Crypto.Encryption.WordInterleavedCCA2Adversary,Cslib.Crypto.Encryption.InterleavedCCA2AdversaryOf.IsPPT,Cslib.Crypto.Encryption.InterleavedCCA2AdversaryOf.IsQueryBounded: adaptive interleaved-query multi-challenge CCA adversaries, uniform strict PPT certificates, and per-stage query bounds.Cslib.Crypto.Encryption.interleavedCca2GameOn,Cslib.Crypto.Encryption.interleavedCca2Game: the interleaved-query multi-challenge CCA experiment andGame.Cslib.Crypto.Encryption.INDCCA2InterleavedOn,Cslib.Crypto.Encryption.INDCCA2InterleavedOf,Cslib.Crypto.Encryption.INDCCA2Interleaved,Cslib.Crypto.Encryption.WordINDCCA2Interleaved: interleaved multi-challenge CCA security predicates.Cslib.Crypto.Encryption.CCA2AdversaryOf.toInterleaved,Cslib.Crypto.Encryption.interleavedHybridGameOn,Cslib.Crypto.Encryption.interleavedToSingleAt,Cslib.Crypto.Encryption.interleavedToSingle: the direct embedding of single-challenge 1CCA adversaries into 1-round interleaved adversaries, thesplit-hybrid game, and the Boneh–Shoup Theorem 12.1 hybrid reduction to single-challenge 1CCA.
Main results #
Cslib.Crypto.Encryption.eval_interleavedCca2GameOn_toInterleaved,Cslib.Crypto.Encryption.INDCCA2InterleavedOn.indcca2On,Cslib.Crypto.Encryption.INDCCA2InterleavedOn.indcca2MultiOn: interleaved multi-challenge CCA security implies single-challenge 1CCA security (by embedding 1CCA adversaries as 1-round interleaved adversaries) and, whenevervalid,keyGen,encrypt, anddecryptare polynomial-time / strict PPT, phased batch-challenge multi-challenge CCA security (through 1CCA security and the hybrid reductionINDCCA2On.indcca2MultiOn).Cslib.Crypto.Encryption.interleavedHybridGameOn_step_gap,Cslib.Crypto.Encryption.interleavedCca2GameOn_gap,Cslib.Crypto.Encryption.advantage_interleavedCca2GameOn,Cslib.Crypto.Encryption.INDCCA2On.indcca2InterleavedOn,Cslib.Crypto.Encryption.indcca2InterleavedOn_iff_indcca2On,Cslib.Crypto.Encryption.indcca2InterleavedOn_iff_indcca2MultiOn: single-challenge 1CCA security implies fully adaptive interleaved-query multi-challenge CCA security ([BS23], Theorem 12.1), with exact hybrid advantage scalingdyadicSize (Q n).
The Multiplicative Cramer–Shoup instance
Cslib.Crypto.PrimeOrderGroupFamily.DDH.indcca2InterleavedOn_cramerShoup is in
CslibFrontier.Crypto.Computational.CramerShoup.Interleaved.
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Version 0.6, Section 12.1 (Attack Game 12.1, Definitions 12.1–12.2, and Theorem 12.1, printed pp. 467–469) and Section 12.5 (Theorem 12.9, printed pp. 490–491).
- J. Katz, Y. Lindell, Introduction to Modern Cryptography, 3rd ed., Section 12.2.
Combined encryption-and-decryption CCA queries and responses #
A single query to the combined interleaved CCA challenger ([BS23], Section 12.1,
Attack Game 12.1, printed pp. 467–468): either an encryption / challenge query
.challenge m₀ m₁ on a pair of candidate plaintexts, or a decryption query .decrypt c on a
candidate ciphertext.
- challenge {Plaintext Ciphertext : Type} (m₀ m₁ : Plaintext) : CCAQuery Plaintext Ciphertext
Submit a challenge plaintext pair
(m₀, m₁)to the left-or-right encryption oracle. - decrypt {Plaintext Ciphertext : Type} (c : Ciphertext) : CCAQuery Plaintext Ciphertext
Submit a candidate ciphertext
cto the decryption oracle.
Instances For
Encode the payload of a CCAResponse Out (List Bool) as an optional bit word
(encOption encBits on encryption responses and encOption encOut on decryption responses).
CCAQuery.toOptionPair is computable in plain polynomial time.
Constructing .challenge m₀ m₁ from (m₀, m₁) is computable in plain polynomial time.
CCAQuery.isChallenge is computable in plain polynomial time.
CCAQuery.challengePair is computable in plain polynomial time when [Inhabited Msg].
CCAQuery.decryptCiphertext is computable in plain polynomial time.
Stateful interleaved CCA oracle (interleavedCcaOracle) #
On the empty challenge-ciphertext list [], cca2MultiPhase2Oracle coincides with the
unrestricted Phase 1 decryption oracle cca2Phase1Oracle.
Stateful combined encryption-and-decryption oracle for the interleaved multi-challenge CCA
experiment ([BS23], Section 12.1, Attack Game 12.1, printed pp. 467–468), tracking the
list S : List (List Bool) of challenge ciphertexts produced so far:
- On
.challenge m₀ m₁: ifvalid n pk m₀ m₁holds, encryptif bit then m₁ else m₀underpk, prepend the resulting challenge ciphertextcttoS, and returnSum.inl (some ct); otherwise returnSum.inl nonewithSunchanged. - On
.decrypt c: ifc ∈ S(among challenge ciphertexts generated so far), reject withSum.inr noneand leaveSunchanged; otherwise returnSum.inr (decrypt n sk c)withSunchanged.
Word-encoded response wrapper around interleavedCcaOracle, returning the bit-encoded reply
encodeCCAResponseWord encOut resp alongside the updated challenge-ciphertext list S'.
Adaptive interleaved-query multi-challenge CCA adversaries and experiments #
An adaptive interleaved-query multi-challenge CCA adversary over challenge message space Msg
([BS23], Section 12.1, Attack Game 12.1, printed pp. 467–468):
numRounds nis the number of adaptive combined-oracle rounds at security parametern.- In each round,
step n pk state lastReplyreceives the unary security parametern, the public keypk, the adversary's saved state wordstate, and the encoded responselastReplyfrom the previous round ([]in round0), may make adaptive decryption queries against the current forbidden challenge-ciphertext listS, and outputs(query, nextState) : CCAQuery Msg (List Bool) × List Bool, wherequeryis either.challenge m₀ m₁or.decrypt c. - After
numRounds nrounds,finish n pk state lastReplyreceives(n, pk, state, lastReply), may make adaptive decryption queries against the final forbidden listS, and outputs a distinguishing bitBool.
Number of adaptive combined-oracle rounds at security parameter
n.- step : ℕ → List Bool → List Bool → List Bool → Probability.WordOracleComp Unit (CCAQuery Msg (List Bool) × List Bool)
One adaptive round: given
(n, pk, state, lastReply), interact with the current decryption oracle (rejectingS) and emit a combined queryCCAQuery Msg (List Bool)together with the updated state word. Final guessing stage: given
(n, pk, state, lastReply), interact with the current decryption oracle (rejectingS) and output a distinguishing bitBool.
An adaptive interleaved-query multi-challenge CCA adversary for single-bit messages (Bool).
Uniform strict PPT admissibility for an InterleavedCCA2AdversaryOf Msg over message encoding
encMsg:
numRoundsis computable in polynomial time on the unary security parametern.stepis uniformly strict oracle PPT on(n, pk, state, lastReply).finishis uniformly strict oracle PPT on(n, pk, state, lastReply).step_length_le: the encoded(query, nextState)output ofstep n pk state lastReplyis bounded by a polynomial in(n, pk.length)(ensuring that the state passed across polynomially many adaptive rounds remains polynomially bounded without telescope blowup).
- numRounds : Turing.MultiTapeTM.ComputableInPolyTime adversary.numRounds Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encUnary
The round budget
numRoundsis computable in polynomial time on unaryn. - step : Probability.IsOraclePPTOn (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits))) (Turing.MultiTapeTM.encPair (encCCAQuery encMsg) Turing.MultiTapeTM.encBits) fun (x : ℕ × List Bool × List Bool × List Bool) => match x with | (n, pk, state, lastReply) => adversary.step n pk state lastReply
Each adaptive round
stepis uniformly strict oracle PPT. - finish : Probability.IsOraclePPTOn (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits))) Turing.MultiTapeTM.encBool fun (x : ℕ × List Bool × List Bool × List Bool) => match x with | (n, pk, state, lastReply) => adversary.finish n pk state lastReply
The final guessing stage
finishis uniformly strict oracle PPT. - step_length_le : ∃ (cs : ℕ) (ds : ℕ), ∀ (n : ℕ) (pk state lastReply : List Bool), ∀ out ∈ OracleComp.support (adversary.step n pk state lastReply), ((Turing.MultiTapeTM.encPair (encCCAQuery encMsg) Turing.MultiTapeTM.encBits) out).length ≤ cs * (n + pk.length + 2) ^ ds
Uniform polynomial bound on the encoded
(query, nextState)output ofstepacross rounds in terms of(n, pk.length).
Native uniform strict oracle PPT admissibility for a bit interleaved CCA adversary.
Native uniform strict oracle PPT admissibility for a bit-word interleaved CCA adversary.
Per-stage query bound for an InterleavedCCA2AdversaryOf Msg: at security parameter n, the
number of rounds is at most qRounds n, each step call makes at most qStep n inner decryption
queries, and finish makes at most qFinish n inner decryption queries.
Loop state (state, lastReply, S) carried between adaptive rounds of interleavedCca2GameOn:
The adversary's saved state word in an InterleavedLoopState.
The encoded oracle response from the previous round in an InterleavedLoopState.
The list of forbidden challenge ciphertexts generated so far in an InterleavedLoopState.
Standard bit-string encoding of InterleavedLoopState.
Initial loop state ([], [], []) before round 0.
One closed adaptive round of the interleaved CCA experiment at challenge bit roundBit:
- Run
adversary.step n pk st.state st.lastReplyagainstcca2MultiPhase2Oracle encOut decrypt n sk st.forbidden(which rejects any decryption query in the current forbidden challenge setS = st.forbidden). - Execute the returned combined query
q : CCAQuery Msg (List Bool)againstinterleavedCcaWordOracle valid encOut encrypt decrypt n pk sk roundBit q st.forbiddento obtain the encoded responsereplyand updated forbidden challenge setS'. - Return the updated loop state
(state', reply, S').
The fully adaptive interleaved-query multi-challenge CCA experiment
([BS23], Section 12.1, Attack Game 12.1 and Definition 12.1, printed pp. 467–468):
sample (pk, sk) ← keyGen n, iterate interleavedRoundStep for adversary.numRounds n rounds
from ([], [], []), and run adversary.finish against cca2MultiPhase2Oracle with the final
forbidden challenge-ciphertext set S.
Unrestricted interleaved-query multi-challenge CCA experiment
(valid := fun _ _ _ _ => true).
Fully adaptive interleaved-query multi-challenge CCA security
([BS23], Section 12.1, Attack Game 12.1 and Definition 12.1, printed pp. 467–468;
[KL20], Section 12.2) with respect to challenge-pair admissibility predicate valid,
message encoding encMsg, and decryption output encoding encOut: every round-structured
InterleavedCCA2AdversaryOf Msg satisfying InterleavedCCA2AdversaryOf.IsPPT encMsg has
negligible advantage between the two experiments of interleavedCca2GameOn.
Unrestricted interleaved-query multi-challenge CCA security (valid := fun _ _ _ _ => true).
Interleaved-query multi-challenge CCA security for single-bit encryption (Msg = Bool,
Out = Bool).
Interleaved-query multi-challenge CCA security for bit-word encryption (Msg = List Bool,
Out = List Bool) under Attack Game 12.1's equal-length challenge rule
m₀.length == m₁.length.
Relationship 1: Interleaved CCA2 implies single-challenge 1CCA and phased Multi-CCA2 #
Embed a single-challenge CCA2AdversaryOf Msg as a 1-round InterleavedCCA2AdversaryOf Msg
([BS23], Section 12.1, Definition 12.2, printed p. 468):
- In Round 0 (
S = []),steprunsadversary.choose n pk(which makes Phase 1 decryption queries againstcca2MultiPhase2Oracle ... [] = cca2Phase1Oracle) and submits.challenge (ChoiceOut.msg₀ choice) (ChoiceOut.msg₁ choice)along with the saved stateChoiceOut.state choice. - In
finish(S = [ct]whenvalid n pk m₀ m₁ = true), iflastReplybegins withtrue(lastReply = true :: ct),finishrunsadversary.guess n state lastReply.tailagainstcca2MultiPhase2Oracle ... [ct] = cca2Phase2Oracle ... ct; otherwise (lastReply = []),finishreturnsfalse.
CCA2AdversaryOf.toInterleaved preserves uniform strict oracle PPT admissibility.
Running interleavedCca2GameOn on adversary.toInterleaved has the exact same output
distribution as running cca2GameOn on adversary.
Interleaved multi-challenge CCA security implies single-challenge 1CCA security ([BS23], Section 12.1, Definition 12.2, printed p. 468).
Interleaved multi-challenge CCA security implies phased batch-challenge multi-challenge CCA
security ([BS23], Section 12.1, Attack Game 12.1 and Theorem 12.1, printed pp.
467–468) whenever valid, keyGen, encrypt, and decrypt are polynomial-time / strict PPT:
the proof passes through single-challenge 1CCA security (INDCCA2InterleavedOn.indcca2On) and
the hybrid reduction INDCCA2On.indcca2MultiOn.
Relationship 2: Single-challenge 1CCA implies Interleaved Multi-CCA2 (Theorem 12.1) #
Hybrid interleaved CCA experiment at round index split : ℕ ([BS23], Section 12.1,
Theorem 12.1, printed p. 468): run the first min split (adversary.numRounds n) rounds with
roundBit = true, the remaining adversary.numRounds n - split rounds with roundBit = false, and
adversary.finish against the resulting forbidden challenge set S.
At split = 0, interleavedHybridGameOn coincides with interleavedCca2GameOn ... false.
Whenever adversary.numRounds n ≤ split, interleavedHybridGameOn at split coincides with
interleavedCca2GameOn ... true.
Single-challenge CCA2AdversaryOf Msg reduction at fixed hybrid round index split : ℕ
([BS23], Section 12.1, Theorem 12.1, printed p. 468):
- In Phase 1 (
choose), ifsplit < adversary.numRounds n, simulate the firstsplitrounds usingroundBit = true(interleavedOpenRoundStep ... true), then runadversary.stepfor roundsplitthroughmultiPhase2FilterHandler: if roundsplitemits.challenge m₀ m₁withvalid n pk m₀ m₁ = true, output((m₀, m₁), encInterleavedSingleState ⟨true, pk, adversary.numRounds n - 1 - split, state', S⟩); otherwise outputrejectInterleavedSingleState. - In Phase 2 (
guess), ifactive = true, prepend the external challenge ciphertextcttoS, simulate the remainingremRoundsrounds usingroundBit = false(interleavedOpenRoundStep ... false) starting from(state', true :: ct, ct :: S), and runadversary.finishthroughmultiPhase2FilterHandler.
Single-challenge CCA2AdversaryOf Msg reduction that samples a uniform dyadic round index
split ← ProbOracleComp.sample (sampleDyadicIndex (Q n)) in Phase 1 and runs
interleavedToSingleAt valid encrypt decBound adversary split
([BS23], Section 12.1, Theorem 12.1, printed p. 468).
interleavedToSingleAt preserves strict oracle PPT admissibility (CCA2AdversaryOf.IsPPT).
interleavedToSingle preserves strict oracle PPT admissibility (CCA2AdversaryOf.IsPPT).
Single-step hybrid identity for interleaved multi-challenge CCA ([BS23],
Theorem 12.1, printed p. 468): at any round index split : ℕ, the signed success-probability gap
between interleavedHybridGameOn ... split and interleavedHybridGameOn ... (split + 1) equals the
signed 1CCA gap of interleavedToSingleAt ... split.
Running interleavedToSingle in cca2GameOn averages interleavedToSingleAt uniformly over
Fin (dyadicSize (Q n)).
Quantitative signed hybrid gap for interleaved multi-challenge CCA ([BS23],
Theorem 12.1, printed p. 468): when adversary.numRounds n ≤ Q n, the signed success-probability
gap of interleavedCca2GameOn equals dyadicSize (Q n) times the signed 1CCA gap of
interleavedToSingle.
Quantitative hybrid advantage bound for interleaved multi-challenge CCA ([BS23],
Theorem 12.1, printed p. 468): when adversary.numRounds n ≤ Q n, the interleaved multi-challenge
CCA advantage equals dyadicSize (Q n) times the single-challenge 1CCA advantage of
interleavedToSingle.
Single-challenge 1CCA security implies fully adaptive interleaved-query multi-challenge CCA
security ([BS23], Section 12.1, Theorem 12.1, printed p. 468) whenever valid,
keyGen, encrypt, and decrypt are polynomial-time / strict PPT.
Equivalence of single-challenge 1CCA and fully adaptive interleaved-query multi-challenge CCA security ([BS23], Section 12.1, Theorem 12.1 together with Definition 12.2, printed p. 468).
Equivalence of phased batch-challenge multi-challenge CCA and fully adaptive interleaved-query multi-challenge CCA security ([BS23], Section 12.1, Attack Game 12.1 and Theorem 12.1, printed pp. 467–468).
Unrestricted single-challenge 1CCA security implies unrestricted interleaved multi-challenge CCA security ([BS23], Theorem 12.1).
Bit single-challenge 1CCA security implies bit interleaved multi-challenge CCA security ([BS23], Theorem 12.1).
Word single-challenge 1CCA security implies word interleaved multi-challenge CCA security ([BS23], Theorem 12.1).