Documentation

CslibFrontier.Crypto.Protocols.KEM.FujisakiOkamoto.NotBot.Correctness

Correctness hop of the FO IND-CCA proofs #

This module bounds the distance between the lazy coupled handler Scheme.coupledFilterHandler and the keyless simulator Scheme.simFilterHandler of CslibFrontier.Crypto.Protocols.KEM.FujisakiOkamoto.NotBot.Hybrids by the decryption error of the underlying PKE. This is the correctness step of the proof of the §3.1 theorem for T in [HHK17] (games G1–G2 of the proof of Theorem 3.1), where the plaintext-checking oracle is replaced by re-encryption.

The two handlers differ only in the decryption test Dec(sk, c) = some m of the key-derivation oracle H(false, m, c). For a fixed key pair, both are run on the same SimState, and a state is bad when some coin r cached for a message m in gCache fails to decrypt (Dec(sk, Enc(pk, m; r)) ≠ some m). Caches only grow, so bad states are absorbing, and from a good state the two handlers agree on every transition into a good state: a cached coin r = G(m) with Enc(pk, m; r) = c then forces Dec(sk, c) = some m. The difference lemma bounds the distance by the probability of reaching a bad state. Every G or H query samples at most one fresh coin, which fails with probability at most the worst-case message failure probability (closeTo_run_coupledFilterHandler_simFilterHandler). The FO-notbot challenge hop applies this to the one-wayness run from empty caches. In the filtered games of the FO^⊥ proof the challenge coin r* accounts for one more term, and averaging over key generation with δ-correctness gives the bound (qG + qH + 1) δ.

Main results #

References #

def Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.GoodCache {PK SK M R CT K : Type} (P : ExplicitCoinPKE PK SK M R CT) (pk : PK) (sk : SK) (st : SimState M R CT K) :

Every coin cached in gCache decrypts correctly for its message.

theorem Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.GoodCache.of_subset {PK SK M R CT K : Type} {P : ExplicitCoinPKE PK SK M R CT} {pk : PK} {sk : SK} {st st' : SimState M R CT K} (h : GoodCache P pk sk st') (hsub : ∀ e ∈ st.gCache, e ∈ st'.gCache) :
GoodCache P pk sk st
theorem Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.closeTo_run_coupledFilterHandler_simFilterHandler {PK SK M R CT K : Type} [DecidableEq M] [DecidableEq CT] [Fintype M] [Nonempty M] (S : Scheme PK SK M R CT K) (pk : PK) (sk : SK) (cStar : CT) (d₁ d₂ : List (M × R) → CT → Bool) (hd : ∀ (st : SimState M R CT K) (c : CT), GoodCache S.pke pk sk st → d₁ st.gCache c = d₂ st.gCache c) {α β : Type} (prog : OracleComp (ROResp R K) α) {k : ℕ} (hk : OracleComp.IsCostBounded ROQuery.ghCost prog k) {st : SimState M R CT K} (hs : GoodCache S.pke pk sk st) (next : α × SimState M R CT K → PMF β) :
Probability.CloseTo (((OracleComp.interpret (fun (q : ROQuery M CT) (state : SimState M R CT K) => (S.coupledFilterHandler d₁ pk sk cStar q state).eval) prog).run st).bind next) (((OracleComp.interpret (fun (q : ROQuery M CT) (state : SimState M R CT K) => (S.simFilterHandler d₂ pk cStar q state).eval) prog).run st).bind next) (↑k * ENNReal.ofReal (S.pke.keyPairMaxFailProb pk sk))

The coupled and keyless handlers agree until a cached coin fails to decrypt. Run from a state whose cached coins all decrypt correctly, and post-processed by any next, a program making at most k combined G/H queries has output laws under coupledFilterHandler d₁ and simFilterHandler d₂ within k times the worst-message failure probability of the key pair, provided the two decapsulation filters agree on such states.

theorem Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.advantage_coupledFilterGame_simFilterGame_le {PK SK M R CT K : Type} [DecidableEq M] [DecidableEq CT] [Fintype M] [Nonempty M] (S : Scheme PK SK M R CT K) (d₁ : PK → SK → List (M × R) → CT → Bool) (d₂ : PK → List (M × R) → CT → Bool) (hd : ∀ (pk : PK) (sk : SK) (st : SimState M R CT K) (c : CT), GoodCache S.pke pk sk st → d₁ pk sk st.gCache c = d₂ pk st.gCache c) (A : ROAdversary PK M R CT K) {qG qH : ℕ} (hq : ROQueryBounds A qG qH) {δ : ℝ} (hδ : S.pke.DeltaCorrect δ) (b : Bool) :
↑(Game.advantage (S.coupledFilterGame d₁ A b).eval (S.simFilterGame d₂ A b).eval) ≤ ↑(qG + qH + 1) * δ

Filtered correctness hop: for an adversary making at most qG queries to G and qH queries to H against a δ-correct PKE, when the decapsulation filters d₁ and d₂ agree on every state satisfying GoodCache, coupledFilterGame d₁ and simFilterGame d₂ have distinguishing advantage at most (qG + qH + 1) δ.