ROM IND-CCA Games, Eager/Lazy Equivalence, and CPA Reduction for HHK17 FO-notbot #
This module formalizes the Random Oracle Model (ROM) IND-CCA security experiments, eager/lazy
equivalence, keyless oracle simulator, and IND-CPA reduction hit-probability bounds for the
implicit-rejection Fujisaki–Okamoto transform FO-notbot (Scheme.keyGenNotBot,
Scheme.encapsNotBot, Scheme.decapsNotBot) from
CslibFrontier.Crypto.Protocols.KEM.FujisakiOkamoto
([HHK17], IACR ePrint 2017/604 full version dated 2 November 2021, §2.1,
§2.1 Def. 2.2 / Fig. 4, §3.1 Fig. 5, and §3.2.2 Fig. 12).
Source map and model notes #
Section and figure locators follow CslibFrontier.Crypto.Protocols.KEM.FujisakiOkamoto and refer to
the full version of [HHK17] served by IACR ePrint 2017/604, dated
2 November 2021:
- §2.1 and §2.1, Definition 2.2 / Figure 4:
ExplicitCoinPKEand its two-stage IND-CPA advantageExplicitCoinPKE.cpaAdvantage, the shared experimentCslib.Crypto.PKE.cpaExperimentofExplicitCoinPKE.toPKEwith the two-world advantage (twice HHK17's|Pr[b' = b] - 1/2|). - §3.1, Figure 5: derandomization and mandatory re-encryption check
T[PKE, G](encT,decT). - §3.2.2, Figure 12: implicit-rejection KEM
FO-notbot = U-notbot ∘ T(ImplicitSK,Scheme.keyGenNotBot,Scheme.encapsNotBot,Scheme.decapsNotBot), with the same key oracle for bothH(m, c)and the implicit-rejection keyH(fallback, c), and arbitrarySchemesamplerssampleCoins,sampleMsg,sampleKey.
In addition to the ExplicitCoinPKE and Scheme modeling choices documented in
CslibFrontier.Crypto.Protocols.KEM.FujisakiOkamoto, this module makes two ROM-specific modeling
choices:
- Adversaries with explicit coins (
RandomizedROAdversary): an adversary draws its coinsω ← A.coinsonce and then runs the deterministic oracle programA.run ω : KEM.Challenge PK CT K → OracleComp (ROResp R K) Bool(ROAdversary). The game hops are proved for deterministic programs;RandomizedROAdversary.advantage_play_leaverages them over the coins. Query bounds hold for every coin value. - Standard KEM IND-CCA experiment (
Scheme.roIndCcaGame,Scheme.eagerIndCcaGame, not separately located in the source map above): the real-or-random key experiment draws the random challenge key viakRand ← S.sampleKey(rather than a uniform draw onK), leaves decapsulation queries unbounded and uncounted inROQueryBounds, and requires[Fintype M] [Finite R] [Fintype CT] [Finite K]oneagerIndCcaGameto sample the eager random-oracle tablesScheme.coinTableandScheme.keyTable.
On top of those definitions, this module formalizes:
- Executable lazy and eager ROM IND-CCA games for
FO-notbot(Scheme.roIndCcaGame,Scheme.indCcaRomAdvantage,Scheme.eagerIndCcaGame) over the oracle interfaceROQuery M CT(G,H, and punctured decapsulation rejectingc = cStarwithnone), together with exact eager/lazy equivalence (Scheme.eval_roIndCcaGame_eq_eagerIndCcaGame,Scheme.indCcaRomAdvantage_eq_eager). Both games are instances of one ROM IND-CCA experimentScheme.romIndCcaExperiment, parameterized by the key generator and the decapsulation oracle (written as a program against the random oracles), whose eager/lazy equivalenceScheme.eval_romIndCcaExperiment_eq_eagerfollows from the generic represented-cache lawRandomOracle.eval_run_interpret_eq_complete_bind. The@[simp]bridgesScheme.romIndCcaExperiment_notBotandScheme.eagerRomIndCcaExperiment_notBotidentify theFO-notbotinstance withroIndCcaGameandeagerIndCcaGame; theFO^⊥instance is inCslibFrontier.Crypto.Protocols.KEM.FujisakiOkamoto.Bot. - Keyless ROM simulator and IND-CPA reduction (
Scheme.simHandler,Scheme.romCpaReduction,Scheme.simFilterOwExperiment). Neither is a verbatim construction from [HHK17]; they combine theTandU-notbotproofs.simHandleris adapted from theG/Hsimulations in two proofs of the full version: the proof of Theorem 3.2 (§3.1, IND-CPA security of the PKE implies OW-PCVA security ofT[PKE, G]), which answersGlazily, and the proof of Theorem 3.4 (§3.2.2, IND-CCA security ofU-notbot), which answers decapsulation queries and the matchingHqueries from a ciphertext-indexed table. HeresimHandleranswersH(false, m, c)via a lazy tableH_q(c)whenever the §3.1 Fig. 5 re-encryption checkEnc(pk, m; G(m)) = cholds, and answers punctured decapsulation queriesc ≠ cStarfromH_q(c)without usingsk(its consistency withroHandler/eagerIndCcaGameis proved in theNotBotmodules).romCpaReduction Ais one two-stage IND-CPA adversary: its first stage draws both challenge messagesm₀, m₁ ← S.sampleMsg, asD₁of Fig. 8 (proof of Theorem 3.2) does, and its second stage draws the coins ofA, runsAagainstsimHandleron the challenge and outputs whetherm₁was queried toG. With challenge bittruethis is the one-wayness experimentsimFilterOwExperiment(Scheme.eval_cpaExperiment_romFilterCpaReduction_true); with bitfalsethe targetm₁is independent of the challenge, so the reduction outputstruewith probability at most(qG + qH) / |M|(Scheme.succProbability_romFilterCpaReduction_false_le). Together they giveScheme.succProbability_simFilterOwExperiment_le. The IND-CCA bound forFO-notbotisScheme.indCcaRomAdvantage_leinCslibFrontier.Crypto.Protocols.KEM.FujisakiOkamoto.NotBot.
Main definitions #
Cslib.Crypto.Protocols.FujisakiOkamoto.ROQuery,Cslib.Crypto.Protocols.FujisakiOkamoto.ROResp,Cslib.Crypto.Protocols.FujisakiOkamoto.ROAdversary: query/response family and deterministic oracle adversary for the ROM IND-CCA experiment with random oraclesG,Hand decapsulation oracle.Cslib.Crypto.Protocols.FujisakiOkamoto.RandomizedROAdversary,Cslib.Crypto.Protocols.FujisakiOkamoto.RandomizedROAdversary.play: an adversary with explicit coins, and a game played with its coins drawn first.Cslib.Crypto.Protocols.FujisakiOkamoto.ROQuery.dispatch: the oracle interface in any monad. Every lazy, eager and simulated handler of the FO games and proof hybrids is this dispatcher applied to its ownG,Hand decapsulation implementations.Cslib.Crypto.Protocols.FujisakiOkamoto.ROQueryBounds: query-count bounds(qG, qH)onGandHexpressed viaCslib.OracleComp.IsCostBounded.Cslib.Crypto.Protocols.FujisakiOkamoto.ROCache,Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.roHandler,Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.roIndCcaGame,Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.indCcaRomAdvantage: lazy-cached executable ROM IND-CCA game and advantage forFO-notbot.Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.eagerIndCcaGame: eager random-oracle IND-CCA game defined directly fromScheme.keyGenNotBot,Scheme.encapsNotBot, andScheme.decapsNotBot.Cslib.Crypto.Protocols.FujisakiOkamoto.ROSpec,Cslib.Crypto.Protocols.FujisakiOkamoto.romProgram,Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.romIndCcaExperiment,Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.eagerRomIndCcaExperiment: the random-oracle signatureG ⊕ₒ H, the IND-CCA oracle interface as a program against it, and the lazy and eager ROM IND-CCA experiments for any key generator and decapsulation program.Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.notBotDecaps: theFO-notbotdecapsulation program, the instance ofromIndCcaExperimentthat givesroIndCcaGame.Cslib.Crypto.Protocols.FujisakiOkamoto.SimState,Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.simHandler,Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.simFilterHit,Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.romCpaReduction: keyless ROM simulator, its run on a challenge, and the two-stage IND-CPA reduction.Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.simFilterOwExperiment: the one-wayness experiment of the challenge hop.
Main results #
Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.eval_romIndCcaExperiment_eq_eager: the lazy ROM IND-CCA experiment has the same output distribution as its eager form, for every key generator and decapsulation program.Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.romIndCcaExperiment_notBot,Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.eagerRomIndCcaExperiment_notBot: theFO-notbotinstance of the experiment isroIndCcaGame, and its eager form iseagerIndCcaGame.Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.eval_roIndCcaGame_eq_eagerIndCcaGame,Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.indCcaRomAdvantage_eq_eager: the lazy executable gameroIndCcaGamehas the same output distribution and advantage aseagerIndCcaGame.Cslib.Crypto.Protocols.FujisakiOkamoto.RandomizedROAdversary.advantage_play_le: a per-coin bound averages over the adversary's coins.Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.eval_cpaExperiment_romFilterCpaReduction_true,Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.succProbability_romFilterCpaReduction_false_le,Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.succProbability_simFilterOwExperiment_le: the two sides of the reduction's IND-CPA experiment, and the boundPr[OW] ≤ Adv^{IND-CPA}(romFilterCpaReduction d A) + (qG + qH) / |M|.
References #
- D. Hofheinz, K. Hövelmanns, E. Kiltz, A Modular Analysis of the Fujisaki–Okamoto Transformation (IACR ePrint 2017/604, full version dated 2 November 2021).
Section 1: ROM Queries, Executable IND-CCA Game, Simulator, and CPA Reduction #
The oracle interface of the FO IND-CCA games, in any monad: G and H queries go to the
given random-oracle implementations, decapsulation of the challenge cStar is refused with
none, and any other ciphertext is answered by decaps. Every lazy, eager and simulated handler
of the games and proof hybrids is this dispatcher applied to its own G, H and decaps.
A deterministic IND-CCA oracle adversary in the Random Oracle Model receives the challenge
⟨pk, c*, k*⟩ and interacts with G, H, and the decapsulation oracle before outputting a
Boolean guess. A randomized adversary is a coin draw followed by one of these
(RandomizedROAdversary).
Query cost counting calls to the decapsulation oracle.
An ROAdversary satisfies query bounds (qG, qH) if on every challenge ch its execution
makes at most qG queries to G and at most qH queries to H.
Bounds (qG, qH) on G and H queries bound their combined count by qG + qH.
An ROAdversary satisfies full query bounds (qG, qH, qD) if on every challenge ch its
execution makes at most qG queries to G, qH queries to H, and qD queries to decaps.
A randomized ROM IND-CCA adversary with explicit coins: it draws its coins ω ← coins once,
before it receives the challenge, and then runs the deterministic oracle adversary run ω. This
is the explicit-coin adversary model of Cslib.Crypto.Protocols.ROMSignature.Forger; a
deterministic adversary is the case of a single coin value (ofDeterministic).
- Coins : Type
The adversary's coins.
Draw the adversary's coins.
- run : self.Coins → ROAdversary PK M R CT K
The deterministic adversary run with fixed coins.
A deterministic adversary, as a randomized adversary with a single coin value.
Play a game for deterministic adversaries: draw the coins ω and play the game with
A.run ω.
Every coin value obeys the query bounds (qG, qH) on G and H.
Every coin value obeys the query bounds (qG, qH, qD) on G, H and decapsulation.
Averaging over the adversary's coins. If, for every coin value ω, the advantage of
A.run ω in game is at most e + 2 · Pr[ow (A.run ω)], then the advantage of A is at most
e + 2 · Pr[ow (A.run ω)] with ω ← A.coins drawn inside the experiment.
Association-list caches for the keyless ROM simulator Scheme.simHandler, extending
ROCache (gCache for
G : M → R and hCache for unprogrammed queries to H : Bool × M × CT → K) with hqCache for
the ciphertext-indexed key table H_q : CT → K.
Cached query-response pairs for the ciphertext-key table
H_q : CT → K.
Lazy evaluation of H : Bool × M × CT → K inside ROCache via memoize.
Lazy evaluation of unprogrammed H : Bool × M × CT → K queries on the inherited hCache of
SimState via memoize.
Lazy evaluation of the ciphertext-key table H_q : CT → K inside SimState via
memoize.
Filtered decapsulation branch of the lazy SimState handlers: answer some (Hq c) when the
filter d accepts c on the current G cache, and none otherwise.
Each query of a ROM IND-CCA game as a program over the random oracles: G and H are
forwarded, decapsulation of cStar is refused, and any other ciphertext runs decaps.
Stateful oracle handler for the real ROM IND-CCA game of FO-notbot. Queries to the
challenge ciphertext cStar are rejected with none; other decapsulation queries run the scheme's
decapsulation decapsNotBotM against the lazy random oracles G and H.
The executable ROM IND-CCA security game for FO-notbot with bit b : Bool (standard KEM
IND-CCA experiment, not separately located in the source map above). When b = false, the
adversary receives the real encapsulated key kReal = H(false, m*, c*); when b = true, it
receives an independent key kRand ← S.sampleKey. Decapsulation queries are punctured at cStar
and otherwise unbounded.
The ROM IND-CCA advantage of a randomized adversary A against FO-notbot: the adversary
draws its coins and plays roIndCcaGame.
An eager random oracle X → K into the key space: an independent key S.sampleKey at every
point. The FO games draw H ← S.keyTable (Bool × M × CT) and their ciphertext-indexed key tables
S.keyTable CT from it.
Stateless handler for S.eagerIndCcaGame: G and H are complete functions and
decapsulation of c ≠ cStar uses the shared key oracle fun mc => H (false, mc).
The eager random-oracle IND-CCA game for FO-notbot (standard KEM IND-CCA experiment, not
separately located in the source map above), defined directly from S.keyGenNotBot,
S.encapsNotBot, and S.decapsNotBot over eager random oracles G ← S.coinTable and
H ← S.keyTable (Bool × M × CT) and kRand ← S.sampleKey.
Simulated H oracle of simHandler: on key-derivation queries (false, m, c), checks whether
S.pke.encDet pk m (G(m)) = c and if so returns H_q(c). This is designed so that decapsulation
queries can be answered from H_q(c) without the secret key sk; its consistency with the real
game is proved in the NotBot modules. The H_q table is adapted from the proof of the §3.2.2
IND-CCA theorem for U-notbot in [HHK17] (IACR ePrint 2017/604, full version
dated 2 November 2021), with that proof's plaintext check replaced by the re-encryption check of T
and the auxiliary slice answered from the raw table.
Common ROQuery dispatcher for lazy SimState handlers parameterized by an H handler hH
and a decapsulation filter d : List (M × R) → CT → Bool.
Keyless ROM simulator parameterized by a decapsulation acceptance filter
d : List (M × R) → CT → Bool on the cached G-queries gCache. On c ≠ cStar, decapsulation
returns some (H_q(c)) when d st.gCache c = true and none otherwise. Taking
d = fun _ _ => true recovers simHandler for FO-notbot, while filtering by whether c is a
cached re-encryption gives the simulator for FO^⊥.
Stateful oracle handler for a keyless ROM simulator of the FO-notbot IND-CCA
game, designed to answer decapsulation queries for c ≠ cStar directly from H_q(c) without using
sk (consistency with the real game is proved in the NotBot modules). It is not a verbatim
construction from [HHK17] (IACR ePrint 2017/604, full version dated
2 November 2021): it is adapted from the lazy G simulation in the proof of the §3.1 theorem for
T (IND-CPA implies OW-PCVA) and the H/decapsulation simulation in the proof of the §3.2.2
IND-CCA theorem for U-notbot, combined for FO-notbot.
The simulator run inside the IND-CPA reduction: given the public key pk, a target message m
and a challenge ciphertext cStar, draw a challenge key kStar ← S.sampleKey, run the
deterministic adversary A ⟨pk, cStar, kStar⟩ against S.simFilterHandler (d pk) pk cStar from
empty caches, and output whether m was queried to G.
The IND-CPA reduction of the FO proofs, for the keyless simulator with decapsulation
filter d, as one two-stage IND-CPA adversary. The first stage receives pk, draws the challenge
messages m₀, m₁ ← S.sampleMsg itself and keeps (pk, m₁). The second stage receives the
challenge cStar, draws the coins ω of A, runs A.run ω against the simulator
(simFilterHit) and outputs whether m₁ was queried to G.
The first stage is D₁ of the IND-CPA adversary D = (D₁, D₂) in the proof of Theorem 3.2 of
[HHK17] (§3.1, IND-CPA security of the PKE implies OW-PCVA security of
T[PKE, G]; IACR ePrint 2017/604, full version dated 2 November 2021, Fig. 8), which draws
(m₀, m₁) uniformly. There are two differences. D₂ compares the G-queries on m₀ and m₁
and breaks ties with a coin, whereas this second stage checks m₁ only. The wrapped adversary is
an IND-CCA adversary against the KEM, whose decapsulation queries are simulated as in the proof of
Theorem 3.4 (§3.2.2), rather than an OW-PCVA adversary against T[PKE, G].
The IND-CPA reduction for FO-notbot: romFilterCpaReduction with the unfiltered
simulator simHandler.
Section 2: One ROM IND-CCA Experiment and Eager/Lazy Equivalence #
The ROM IND-CCA games of FO-notbot and FO^⊥ differ only in their key generation and in the
decapsulation they run against the random oracles G and H. romIndCcaExperiment takes both as
parameters, with decapsulation a program over the joined interface ROSpec of G and H.
roIndCcaGame and eagerIndCcaGame are its FO-notbot instances
(romIndCcaExperiment_notBot, eagerRomIndCcaExperiment_notBot), and
CslibFrontier.Crypto.Protocols.KEM.FujisakiOkamoto.Bot gives the FO^⊥ instances. Every query
of the experiment is the oracle program romProgram, so
RandomOracle.eval_run_interpret_eq_complete_bind replaces both caches by complete tables in one
step, and RandomOracle.bind_complete_sum splits the completed table into G and H
(eval_romIndCcaExperiment_eq_eager).
The lazy handler of a ROM IND-CCA game: romProgram against the lazy oracles roHashG and
roHashH.
The eager handler of a ROM IND-CCA game: romProgram against complete tables G and H.
The ROM IND-CCA experiment of an FO-style KEM with key generation keyGen and
decapsulation decaps pk dk, a program over the random oracles, for challenge bit b. The
challenge encrypts m* ← sampleMsg under coins r* ← sampleCoins, which are programmed as
G(m*); the real key kReal ← sampleKey is programmed as H(false, m*, c*). The adversary
receives kReal when b = false and an independent kRand ← sampleKey when b = true, and
interacts with the lazy oracles through romHandler.
The eager ROM IND-CCA experiment: romIndCcaExperiment with eager random oracles
G ← S.coinTable and H ← S.keyTable (Bool × M × CT) and the challenge S.encapsBot G H pk.
A dispatcher whose random oracles are the calls of oracle and whose decapsulation interprets
decaps against oracle is oracle interpreting romProgram.
Interpreting decapsNotBotM against oracle calls runs it against the interpreted calls.
Interpreting decapsBotM against oracle calls runs it against the interpreted calls.
Eager/lazy equivalence for the ROM IND-CCA experiment: for every key generation and decapsulation program, the lazy experiment has the output distribution of the eager one.
The FO-notbot instance #
FO-notbot decapsulation decapsNotBotM as a program over the random oracles.
roHandler is the lazy handler of romProgram with FO-notbot decapsulation.
eagerHandler is the eager handler of romProgram with FO-notbot decapsulation.
roIndCcaGame is the ROM IND-CCA experiment of FO-notbot.
eagerIndCcaGame is the eager ROM IND-CCA experiment of FO-notbot.
Eager/lazy equivalence for the FO-notbot ROM IND-CCA game: evaluating the executable
lazy-cached game S.roIndCcaGame A b yields the exact same output distribution as the eager
random-oracle game S.eagerIndCcaGame A b.
The ROM IND-CCA advantage of a deterministic adversary A against FO-notbot equals the
distinguishing advantage between S.eagerIndCcaGame A false and S.eagerIndCcaGame A true.
Section 3: The One-Wayness Experiment and the IND-CPA Reduction #
A supported transition of simHashG adds at most one entry to gCache.
A supported transition of simHashHRaw preserves gCache.
Each query q to S.simFilterHandler d pk cStar increases gCache.length by at most
ROQuery.ghCost q.
Each query q to S.simHandler pk cStar increases gCache.length by at most
ROQuery.ghCost q.
The one-wayness experiment of the challenge hop: draw a key pair and a message
m ← S.sampleMsg, encrypt m with fresh coins, and run the simulator of simFilterHit on the
encryption. The experiment outputs whether the simulator queried G at m.
With challenge bit true, the IND-CPA experiment of romFilterCpaReduction d A encrypts the
message that the reduction looks for, and the other message is never used: the experiment is the
one-wayness experiment of A.run ω for coins ω ← A.coins.
With challenge bit false, the IND-CPA experiment of romFilterCpaReduction d A encrypts
m₀, and the reduction looks for an independent uniform message m₁. The simulator caches at most
qG + qH messages, so the reduction outputs true with probability at most (qG + qH) / |M|.
One-wayness from IND-CPA (the step Pr[QUERY] ≤ … of the proof of Theorem 3.2 of
[HHK17], for the two-world advantage): for uniform messages and an adversary
whose every coin value makes at most qG queries to G and qH queries to H, the averaged
one-wayness experiment is bounded by the two-stage IND-CPA advantage of the single reduction
romFilterCpaReduction d A:
Pr[OW] ≤ Adv^{IND-CPA}(romFilterCpaReduction d A) + (qG + qH) / |M|.