Documentation

CslibFrontier.Crypto.Protocols.KEM.FujisakiOkamoto.NotBot.Hybrids

Hybrid games for the ROM IND-CCA security of FO-notbot #

This module fixes the intermediate games of the IND-CCA proof for the implicit-rejection transform FO-notbot = U-notbot ∘ T of [HHK17] (IACR ePrint 2017/604, full version dated 2 November 2021, §3.1 and §3.2.2). The proof follows the structure of the paper's proofs of the §3.1 theorem for T (OW-PCA case, with the correctness hop that replaces G by good coins) and the §3.2.2 IND-CCA theorem for U-notbot, composed directly rather than through an OW-PCA interface.

Starting from the eager game Scheme.eagerIndCcaGame of CslibFrontier.Crypto.Protocols.KEM.FujisakiOkamoto.Security, the hybrids are:

  1. Scheme.eagerFbGame: decapsulation of invalid ciphertexts uses an independent table Hfb : CT → K instead of H(false, s, ·) for the secret seed s.
  2. Scheme.eagerCoupledGame: the oracles are computed from independent tables G, Hq : CT → K and Hraw : Bool × M × CT → K; a key-derivation query H(false, m, c) reads Hq c exactly when c = Enc(pk, m; G(m)) and Dec(sk, c) = some m (Scheme.coupledH), and every decapsulation query c ≠ c* reads Hq c.
  3. Scheme.coupledGame: the lazy-sampling realization of eagerCoupledGame on SimState. Its real and random challenge keys are compared in CslibFrontier.Crypto.Protocols.KEM.FujisakiOkamoto.NotBot.Challenge.

The keyless simulator Scheme.simHandler drops the decryption test Dec(sk, c) = some m from coupledH; the FO-notbot proof uses it only inside the one-wayness experiment Scheme.simFilterOwExperiment. The filtered games Scheme.coupledFilterGame and Scheme.simFilterGame are the corresponding hybrids of the FO^⊥ proof.

Main definitions #

References #

Decoupled implicit rejection #

noncomputable def Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.eagerFbHandler {PK SK M R CT K : Type} [DecidableEq CT] (S : Scheme PK SK M R CT K) (G : M → R) (H : Bool × M × CT → K) (Hfb : CT → K) (dk : ImplicitSK PK SK M) (cStar : CT) (q : ROQuery M CT) :
PMF (ROResp R K q)

Stateless oracle of eagerFbGame: as eagerHandler, except that a decapsulation query c ≠ cStar that decT rejects is answered by an independent table Hfb c rather than by H(false, dk.fallback, c).

noncomputable def Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.eagerFbGame {PK SK M R CT K : Type} [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) :

The eager IND-CCA game of FO-notbot with implicit-rejection keys drawn from an independent table Hfb : CT → K instead of H(false, s, ·).

Eager coupled game #

def Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.coupledH {PK SK M R CT K : Type} [DecidableEq M] [DecidableEq CT] (S : Scheme PK SK M R CT K) (G : M → R) (Hq : CT → K) (Hraw : Bool × M × CT → K) (pk : PK) (sk : SK) :
Bool × M × CT → K

Coupled key-derivation oracle: H(false, m, c) reads the ciphertext table Hq c when c = Enc(pk, m; G(m)) and Dec(sk, c) = some m, and the raw table Hraw otherwise.

noncomputable def Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.eagerCoupledHandler {PK SK M R CT K : Type} [DecidableEq M] [DecidableEq CT] (S : Scheme PK SK M R CT K) (G : M → R) (Hq : CT → K) (Hraw : Bool × M × CT → K) (pk : PK) (sk : SK) (cStar : CT) (q : ROQuery M CT) :
PMF (ROResp R K q)

Stateless oracle of eagerCoupledGame: G reads G, H reads coupledH, and every decapsulation query c ≠ cStar reads Hq c.

noncomputable def Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.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) :

The eager coupled game: independent tables G, Hq, Hraw, challenge c* = Enc(pk, m*; G(m*)) with real key coupledH (false, m*, c*).

Lazy coupled and simulator games #

def Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.coupledHashH {PK SK M R CT K : Type} [DecidableEq M] [DecidableEq CT] (S : Scheme PK SK M R CT K) (pk : PK) (sk : SK) (x : Bool × M × CT) :
StateT (SimState M R CT K) ProbComp K

Lazy realization of coupledH on SimState: G on gCache, Hq on hqCache and Hraw on hCache. It differs from simHashH only in the decryption test Dec(sk, c) = some m.

theorem Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.gCache_eq_of_mem_support_filterDecaps {M R CT K : Type} [DecidableEq CT] (sampleKey : ProbComp K) (d : List (M × R) → CT → Bool) (cStar c : CT) (st : SimState M R CT K) (x : Option K × SimState M R CT K) (hx : x ∈ ((if c = cStar then pure none else filterDecaps (simHashHq sampleKey) d c) st).eval.support) :
x.2.gCache = st.gCache

The filtered decapsulation branch shared by simFilterHandler and coupledFilterHandler leaves gCache unchanged.

theorem Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.gCache_eq_of_mem_support_decaps {M R CT K : Type} [DecidableEq CT] (sampleKey : ProbComp K) (cStar c : CT) (st : SimState M R CT K) (x : Option K × SimState M R CT K) (hx : x ∈ ((if c = cStar then pure none else do let k ← simHashHq sampleKey c pure (some k)) st).eval.support) :
x.2.gCache = st.gCache

The decapsulation branch shared by simHandler and coupledHandler leaves gCache unchanged.

def Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.coupledFilterHandler {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) :
StateT (SimState M R CT K) ProbComp (ROResp R K q)

Lazy coupled handler parameterized by a decapsulation filter d : List (M × R) → CT → Bool; it differs from simFilterHandler only in using coupledHashH for H.

def Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.coupledHandler {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) (q : ROQuery M CT) :
StateT (SimState M R CT K) ProbComp (ROResp R K q)

Lazy realization of eagerCoupledHandler on SimState; it differs from simHandler only in using coupledHashH for H.

def Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.coupledFilterGame {PK SK M R CT K : Type} [DecidableEq M] [DecidableEq CT] (S : Scheme PK SK M R CT K) (d : PK → SK → List (M × R) → CT → Bool) (A : ROAdversary PK M R CT K) (b : Bool) :

Lazy coupled game parameterized by a decapsulation filter d : PK → SK → List (M × R) → CT → Bool.

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

The lazy coupled game: G(m*) is programmed to fresh challenge coins r* and the real key is the answer of coupledHashH to (false, m*, c*).

def Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.simFilterGame {PK SK M R CT K : Type} [DecidableEq M] [DecidableEq CT] (S : Scheme PK SK M R CT K) (d : PK → List (M × R) → CT → Bool) (A : ROAdversary PK M R CT K) (b : Bool) :

Lazy keyless simulator game parameterized by a decapsulation filter d : PK → List (M × R) → CT → Bool.