Documentation

CslibFrontier.Crypto.Protocols.KEM.FujisakiOkamoto.SpreadNecessity

The γ-spreadness hypothesis of FO^⊥ is load-bearing #

In the ROM IND-CCA security theorem for the explicit-rejection Fujisaki–Okamoto transform FO^⊥ = U^⊥ ∘ T (Scheme.indCcaBotAdvantage_le and Scheme.advantage_eagerIndCcaBotGame_simBotGame_le in CslibFrontier.Crypto.Protocols.KEM.FujisakiOkamoto.Bot), replacing the real decapsulation oracle decapsBot by the keyless simulator simBotHandler incurs a qD · 2^{-γ} term bounding the probability that an unqueried message m' re-encrypts to a queried ciphertext c under T[PKE, G] ([HHK17], IACR ePrint 2017/604, full version dated 2 November 2021, §3.1 and §3.2.1). This module shows that the qD · 2^{-γ} spreadness term cannot be omitted.

For any explicit-coin PKE P and designated message m₀ : M, unspreadPointPKE P m₀ has ciphertext space Option CT:

The modified PKE preserves δ-correctness (unspreadPointPKE_deltaCorrect) and preserves fixed-message IND-CPA advantages (indCpaAdvantage) on all message pairs away from m₀ (unspreadPointPKE_indCpaAdvantage); it is not two-stage IND-CPA secure (cpaAdvantage), since an adversary may choose m₀. It fails γ-spreadness for every γ > 0 (unspreadPointPKE_gammaSpread_zero, unspreadPointPKE_not_gammaSpread_of_pos).

The 1-query adversary probeDecapsAdv makes zero queries to G, zero queries to H, and a single decapsulation query ROQuery.decaps none (roFullQueryBounds_probeDecapsAdv), outputting whether the decapsulation oracle returns some k.

For a uniform message sampler on a finite message space M, the distinguishing advantage between eagerIndCcaBotGame and simBotGame on probeDecapsAdv is therefore 1 - 1 / |M| (advantage_eagerIndCcaBotGame_simBotGame_probeDecapsAdv), matching the qD · 2^{-γ} term of advantage_eagerIndCcaBotGame_simBotGame_le at δ = 0, qG = 0, qH = 0, qD = 1, γ = 0.

Main definitions #

Main results #

References #

def Cslib.Crypto.Protocols.FujisakiOkamoto.unspreadPointPKE {PK SK M R CT : Type} [DecidableEq M] (P : ExplicitCoinPKE PK SK M R CT) (m₀ : M) :
ExplicitCoinPKE PK SK M R (Option CT)

Point-deterministic variant of P at m₀ : M: encrypts m₀ deterministically to none (ignoring coins) and every m ≠ m₀ to some (P.encDet pk m r). Decryption maps none to some m₀ and some c to P.dec sk c filtered by · ≠ m₀.

theorem Cslib.Crypto.Protocols.FujisakiOkamoto.unspreadPointPKE_msgFailProb_le {PK SK M R CT : Type} [DecidableEq M] (P : ExplicitCoinPKE PK SK M R CT) (m₀ : M) (pk : PK) (sk : SK) (m : M) :
(unspreadPointPKE P m₀).msgFailProb pk sk m ≤ P.msgFailProb pk sk m

unspreadPointPKE P m₀ has per-message decryption failure probability at most that of P.

theorem Cslib.Crypto.Protocols.FujisakiOkamoto.unspreadPointPKE_deltaCorrect {PK SK M R CT : Type} [DecidableEq M] [Fintype M] [Nonempty M] (P : ExplicitCoinPKE PK SK M R CT) (m₀ : M) {δ : ℝ} (hδ : P.DeltaCorrect δ) :

unspreadPointPKE P m₀ is δ-correct whenever P is.

theorem Cslib.Crypto.Protocols.FujisakiOkamoto.unspreadPointPKE_indCpaAdvantage {PK SK M R CT : Type} [DecidableEq M] (P : ExplicitCoinPKE PK SK M R CT) (m₀ m₁ m₂ : M) (hm₁ : m₁ ≠ m₀) (hm₂ : m₂ ≠ m₀) (A : PK → Option CT → ProbComp Bool) :
(unspreadPointPKE P m₀).indCpaAdvantage m₁ m₂ A = P.indCpaAdvantage m₁ m₂ fun (pk : PK) (c : CT) => A pk (some c)

On any pair of challenge messages m₁ ≠ m₀ and m₂ ≠ m₀, unspreadPointPKE P m₀ has the exact same fixed-message IND-CPA advantages (indCpaAdvantage) as P. It is not two-stage IND-CPA secure (cpaAdvantage), since a two-stage adversary may choose m₀.

Every explicit-coin PKE (and in particular unspreadPointPKE P m₀) is trivially 0-spread.

Because unspreadPointPKE P m₀ encrypts m₀ deterministically to none, the coin-collision probability at (m₀, none) is 1.

theorem Cslib.Crypto.Protocols.FujisakiOkamoto.unspreadPointPKE_not_gammaSpread_of_pos {PK SK M R CT : Type} [DecidableEq M] (P : ExplicitCoinPKE PK SK M R CT) (m₀ : M) {γ : ℝ} (hγ : 0 < γ) :

unspreadPointPKE P m₀ is not γ-spread for any γ > 0.

def Cslib.Crypto.Protocols.FujisakiOkamoto.unspreadScheme {PK SK M R CT K : Type} [DecidableEq M] (P : ExplicitCoinPKE PK SK M R CT) (m₀ : M) (sampleMsg : ProbComp M) (sampleKey : ProbComp K) :
Scheme PK SK M R (Option CT) K

Scheme wrapper around unspreadPointPKE P m₀.

The 1-Query Decapsulation Probe Adversary #

The 1-query decapsulation probe adversary: ignores the challenge, queries the decapsulation oracle once on none : Option CT, and outputs true iff the oracle returns some k.

probeDecapsAdv makes 0 queries to G, 0 queries to H, and 1 query to decaps.

theorem Cslib.Crypto.Protocols.FujisakiOkamoto.eval_simBotGame_probeDecapsAdv {PK SK M R CT K : Type} [DecidableEq M] [DecidableEq CT] (P : ExplicitCoinPKE PK SK M R CT) (m₀ : M) (sampleMsg : ProbComp M) (sampleKey : ProbComp K) (b : Bool) :
((unspreadScheme P m₀ sampleMsg sampleKey).simBotGame probeDecapsAdv b).eval = PMF.pure false

In the keyless simulator game simBotGame, probeDecapsAdv outputs false with probability 1: when m* = m₀ the query none equals c* and is rejected; when m* ≠ m₀ the only cached message in gCache is m*, whose encryption under unspreadPointPKE P m₀ is some _ ≠ none.

theorem Cslib.Crypto.Protocols.FujisakiOkamoto.eval_roIndCcaBotGame_probeDecapsAdv {PK SK M R CT K : Type} [DecidableEq M] [DecidableEq CT] (P : ExplicitCoinPKE PK SK M R CT) (m₀ : M) (sampleMsg : ProbComp M) (sampleKey : ProbComp K) (b : Bool) :
((unspreadScheme P m₀ sampleMsg sampleKey).roIndCcaBotGame probeDecapsAdv b).eval = PMF.map (fun (mStar : M) => decide (mStar ≠ m₀)) sampleMsg.eval

In the real FO^⊥ game roIndCcaBotGame, probeDecapsAdv outputs decide (m* ≠ m₀) for each sampled challenge message m* ← sampleMsg.

theorem Cslib.Crypto.Protocols.FujisakiOkamoto.advantage_eagerIndCcaBotGame_simBotGame_probeDecapsAdv {PK SK M R CT K : Type} [DecidableEq M] [DecidableEq CT] [Fintype M] [Nonempty M] [Finite R] [Fintype CT] [Finite K] (P : ExplicitCoinPKE PK SK M R CT) (m₀ : M) (sampleMsg : ProbComp M) (sampleKey : ProbComp K) (hmsg : sampleMsg.eval = Probability.PMF.uniformOfFintype M) (b : Bool) :
↑(((unspreadScheme P m₀ sampleMsg sampleKey).eagerIndCcaBotGame probeDecapsAdv b).advantage ((unspreadScheme P m₀ sampleMsg sampleKey).simBotGame probeDecapsAdv b).eval) = 1 - 1 / ↑(Fintype.card M)

Necessity of the qD · 2^{-γ} spreadness term in FO^⊥: for a uniform message sampler on a finite message space M, the 1-query adversary probeDecapsAdv (qG = 0, qH = 0, qD = 1) distinguishes eagerIndCcaBotGame from simBotGame over unspreadScheme P m₀ with advantage 1 - 1 / |M|.