Documentation

CslibFrontier.Crypto.Protocols.KEM.FujisakiOkamoto.NotBot.Challenge

The challenge hops of the FO IND-CCA proofs #

The last hop of the ROM IND-CCA proofs for FO-notbot and FO^⊥ ([HHK17], proofs of the §3.1 theorems for T combined with the proofs of the §3.2 IND-CCA theorems for U) bounds the distinguishing advantage between the real and the random challenge key by the success probability of the one-wayness experiment Scheme.simFilterOwExperiment, which Scheme.succProbability_simFilterOwExperiment_le bounds by the IND-CPA advantage of Scheme.romCpaReduction.

In the challenge games the handler starts with G(m*) = r* and Hq(c*) = kq already cached, and the adversary receives kq (b = false) or an independent kRand (b = true). Both games are compared with the run of the same handler from empty caches:

  1. A preset cache entry is the same as a lazily programmed sampler point: the run from the preset caches has the output law of the run from empty caches whose G sampler returns r* at m* and whose Hq sampler returns kq at c*.
  2. The programmed and the unprogrammed handlers are identical until G(m*) or Hq(c*) is cached, for either input key.
  3. It remains to bound the probability that the unprogrammed run caches Hq(c*) without G(m*).

For FO-notbot the handler is the coupled one, whose key-derivation oracle reads Hq(c) for H(false, m, c) only when c = Enc(pk, m; G(m)) and Dec(sk, c) = some m. If the challenge decrypts to m*, this forces m = m*, so step 3 costs nothing beyond the challenge's own decryption failure, as in game G3 of the proof of Theorem 3.4 of [HHK17]. The decryption test is then removed inside the run from empty caches, at cost (qG + qH) δ, which leaves the one-wayness experiment of the keyless simulator. No spreadness is needed (advantage_coupledGame_le).

For the keyless simulator of the FO^⊥ proof, H(false, m, c*) reads Hq(c*) whenever a cached coin G(m) re-encrypts m to c*, also for m ≠ m*; γ-spreadness bounds this collision by (qG + qH) · 2^(-γ) (advantage_simFilterGame_le).

Main results #

References #

Association lists with one programmed entry #

def Cslib.Crypto.Protocols.FujisakiOkamoto.ens {α β : Type} [DecidableEq α] (x : α) (v : β) (L : List (α × β)) :
List (α × β)

Drop every entry for x and append (x, v): the list that a memoized cache would hold if (x, v) had been stored before every other entry.

theorem Cslib.Crypto.Protocols.FujisakiOkamoto.lookup_ens {α β : Type} [DecidableEq α] (x : α) (v : β) (L : List (α × β)) (y : α) :
List.lookup y (ens x v L) = if y = x then some v else List.lookup y L

Simulators with lazily programmed points #

Cache growth #

Programmed and unprogrammed simulators agree until a programmed point is cached #

Preset cache entries as lazily programmed points #

def Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.LookupNoneOr {α β : Type} [BEq α] (x : α) (v : β) (L : List (α × β)) :

A lookup at x is either missing or equal to v.

Unfolding simFilterGame #

The challenge hop of the keyless simulator #

In the keyless simulator, H(false, m, cStar) reads Hq(cStar) whenever the cached coin G(m) re-encrypts m to cStar, also for m ≠ mStar. simRun_bad_le bounds this collision by γ-spreadness. The resulting hop advantage_simFilterGame_le is the challenge hop of the FO^⊥ proof; the FO-notbot proof takes its challenge hop with the decryption test instead (next section) and needs no spreadness.

theorem Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.advantage_simFilterGame_le {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) (hd : ∀ (pk : PK) (mStar : M) (rStar : R) (L : List (M × R)) (c : CT), c ≠ S.pke.encDet pk mStar rStar → LookupNoneOr mStar rStar L → d pk (ens mStar rStar L) c = d pk L c) (A : ROAdversary PK M R CT K) {qG qH : ℕ} (hq : ROQueryBounds A qG qH) {γ : ℝ} (hγ : S.pke.GammaSpread γ) :
↑(Game.advantage (S.simFilterGame d A false).eval (S.simFilterGame d A true).eval) ≤ 2 * ((ProbComp.eval (S.simFilterOwExperiment d A)) true).toReal + 2 * ((↑qG + ↑qH) * 2 ^ (-γ))

Filtered challenge hop: if the PKE is γ-spread and the decapsulation filter d is invariant under programming (mStar, rStar) at ciphertexts c ≠ Enc(pk, mStar; rStar), then for every adversary making at most qG queries to G and qH queries to H, the advantage between simFilterGame d A false and simFilterGame d A true is at most 2 Pr[simFilterOwExperiment d A] + 2 (qG + qH) 2^(-γ).

The challenge hop with the decryption test #

The coupled handler tests Dec(sk, c) = some m besides re-encryption. When the challenge cStar = Enc(pk, mStar; rStar) decrypts to mStar, a query H(false, m, cStar) therefore reads Hq(cStar) only for m = mStar, so the coupled run caches Hq(cStar) only after G(mStar) (coupledRun_progBad_le). The decryption test is removed afterwards, inside the run from empty caches (coupledRun_hit_le), at the cost of the decryption failures of the cached coins.

theorem Cslib.Crypto.Protocols.FujisakiOkamoto.Scheme.advantage_coupledGame_le {PK SK M R CT K : Type} [DecidableEq M] [DecidableEq CT] [Fintype M] [Nonempty M] (S : Scheme PK SK M R CT K) (A : ROAdversary PK M R CT K) {qG qH : ℕ} (hq : ROQueryBounds A qG qH) {δ : ℝ} (hδ : S.pke.DeltaCorrect δ) :
↑(Game.advantage (S.coupledGame A false).eval (S.coupledGame A true).eval) ≤ 2 * ((ProbComp.eval (S.simFilterOwExperiment (fun (x : PK) (x_1 : List (M × R)) (x_2 : CT) => true) A)) true).toReal + 2 * ↑(qG + qH + 1) * δ

Challenge hop of the FO-notbot IND-CCA proof ([HHK17], game G3 of the proof of Theorem 3.4, with the plaintext-checking oracle removed from the one-wayness run as in games G1–G2 of the proof of Theorem 3.1): for a δ-correct PKE and every adversary making at most qG queries to G and qH queries to H, the advantage between the coupled games coupledGame A false and coupledGame A true is at most 2 Pr[simFilterOwExperiment A] + 2 (qG + qH + 1) δ. No spreadness is needed: the coupled key-derivation oracle reads the challenge key only after G(m*) is queried, unless the challenge itself fails to decrypt.