Documentation

CslibFrontier.Crypto.Protocols.KEM.FujisakiOkamoto.NotBot.Lazy

Lazy/eager equivalence of the coupled FO-notbot game #

The lazy coupled game Scheme.coupledGame of CslibFrontier.Crypto.Protocols.KEM.FujisakiOkamoto.NotBot.Hybrids answers G, the ciphertext table Hq and the raw table Hraw lazily on the three caches of SimState. This module proves that it has the same output distribution as the eager coupled game Scheme.eagerCoupledGame, a step in the IND-CCA proof for FO-notbot of [HHK17] (IACR ePrint 2017/604, full version dated 2 November 2021, §3.1 and §3.2.2).

The three lazy tables are one lazy random oracle coupledLazyOracle on the joined interface CoupledSpec, read on the joined cache SimState.coupledCache, and every query of a filtered coupled game is the oracle program coupledProgram over it (coupledFilterHandler_eq_interpret). So RandomOracle.eval_run_interpret_eq_complete_bind replaces the three caches by complete tables in one step, RandomOracle.bind_complete_sum splits the completed table into G, Hraw and Hq, and interpret_coupledProgram reads the program on those tables. The same API serves the approximate lazy/eager hop of FO^⊥ (CslibFrontier.Crypto.Protocols.KEM.FujisakiOkamoto.Bot), whose decapsulation filter depends on the cache.

Main definitions #

Main results #

References #

@[reducible, inline]

The random oracles G : M → R, Hraw : Bool × M × CT → K and Hq : CT → K of the coupled game as one interface.

@[reducible, inline]

The joined cache represented by the three list caches gCache, hCache and hqCache of a SimState.

def Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.coupledProgram {PK SK M R CT K : Type} [DecidableEq M] [DecidableEq CT] (S : Scheme PK SK M R CT K) (pk : PK) (sk : SK) (cStar : CT) (accept : CT → Bool) (q : ROQuery M CT) :
OracleComp (CoupledSpec M R CT K) (ROResp R K q)

Each query of a coupled game as a program over its random oracles: G is forwarded, H runs the coupled key derivation coupledH, and decapsulation of c ≠ cStar reads Hq c when accept c holds and answers none otherwise.

@[reducible, inline]
abbrev Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.coupledLazyOracle {PK SK M R CT K : Type} [DecidableEq M] [DecidableEq CT] (S : Scheme PK SK M R CT K) (q : (M ⊕ Bool × M × CT) ⊕ CT) :
StateT (SimState M R CT K) ProbComp (CoupledSpec M R CT K q)

The lazy random oracles G, Hraw and Hq of the coupled games on the caches of SimState.

@[reducible, inline]
noncomputable abbrev Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.coupledDistribution {PK SK M R CT K : Type} (S : Scheme PK SK M R CT K) (q : (M ⊕ Bool × M × CT) ⊕ CT) :
PMF (CoupledSpec M R CT K q)

The sampling distributions of the coupled games' random oracles.

theorem Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.eval_coupledLazyOracle_map_coupledCache {PK SK M R CT K : Type} [DecidableEq M] [DecidableEq CT] (S : Scheme PK SK M R CT K) (q : (M ⊕ Bool × M × CT) ⊕ CT) (st : SimState M R CT K) :

Each lazy oracle call, read on the joined cache, is a lazy call of the joined oracle.

theorem Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.coupledFilterHandler_eq_interpret {PK SK M R CT K : Type} [DecidableEq M] [DecidableEq CT] (S : Scheme PK SK M R CT K) (d : List (M × R) → CT → Bool) (pk : PK) (sk : SK) (cStar : CT) (q : ROQuery M CT) (st : SimState M R CT K) :
S.coupledFilterHandler d pk sk cStar q st = (OracleComp.interpret S.coupledLazyOracle (S.coupledProgram pk sk cStar (d st.gCache) q)).run st

coupledFilterHandler d interprets coupledProgram, with the decapsulation filter read on the current G cache, against the lazy oracles on SimState.

theorem Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.interpret_coupledProgram {PK SK M R CT K : Type} [DecidableEq M] [DecidableEq CT] (S : Scheme PK SK M R CT K) (pk : PK) (sk : SK) (cStar : CT) (accept : CT → Bool) (T : (q : (M ⊕ Bool × M × CT) ⊕ CT) → CoupledSpec M R CT K q) (q : ROQuery M CT) :
OracleComp.interpret (fun (q : (M ⊕ Bool × M × CT) ⊕ CT) => PMF.pure (T q)) (S.coupledProgram pk sk cStar accept q) = ROQuery.dispatch (fun (m : M) => PMF.pure (T (Sum.inl (Sum.inl m)))) (fun (x : Bool × M × CT) => PMF.pure (S.coupledH (fun (m : M) => T (Sum.inl (Sum.inl m))) (fun (c : CT) => T (Sum.inr c)) (fun (x : Bool × M × CT) => T (Sum.inl (Sum.inr x))) pk sk x)) (fun (c : CT) => PMF.pure (bif accept c then some (T (Sum.inr c)) else none)) cStar q

Answering the coupled oracles from a complete table T turns coupledProgram into the stateless dispatcher that reads G, coupledH and, for accepted ciphertexts, Hq from T.

theorem Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.eval_coupledGame_eq_eagerCoupledGame {PK SK M R CT K : Type} [DecidableEq M] [DecidableEq CT] [Fintype M] [Finite R] [Fintype CT] [Finite K] (S : Scheme PK SK M R CT K) (A : ROAdversary PK M R CT K) (b : Bool) :

Lazy/eager equivalence of the coupled game: the lazy coupled game S.coupledGame A b has the output distribution of the eager coupled game S.eagerCoupledGame A b.