Documentation

CslibFrontier.Crypto.Protocols.SSP.Hybrid

State-separating proofs: hybrid arguments over parallel sessions #

The multi-session hybrid argument of state-separating proofs. To bound the advantage in distinguishing m real sessions parFin real from m ideal sessions parFin ideal, replace the sessions one at a time. The hop that replaces the session j₀ is exactly a single-session experiment: a reduction package runs every other session itself, each on its own persistent state, and forwards the session j₀ to the package under attack. Summing the hops bounds the multi-session advantage by the sum of the single-session advantages.

The second half treats sessions sharing a global package G, as in universal composability with global setup: the sessions import the interface of G, the environment also queries G directly, and the reduction routes the queries of the sessions it runs itself to G through its own import. Each hop is then a single-session experiment in which the environment also has direct access to G.

Main definitions #

Main results #

References #

Filling in one coordinate #

The hybrid reduction #

def Cslib.Crypto.Protocols.SSP.hybridReduction {ιE : Type} {E : ιE → Type} {m : ℕ} (j₀ : Fin m) (F : { j : Fin m // j ≠ j₀ } → UC.Machine OracleSpec.empty E) :

The reduction for the session j₀ of m sessions: it runs the closed packages F j of the sessions j ≠ j₀ itself, each on its own state, and forwards the queries to the session j₀ to the package it is composed with.

theorem Cslib.Crypto.Protocols.SSP.eval_run_hybridReduction_comp {ιE : Type} {E : ιE → Type} {α : Type} {m : ℕ} (G : Fin m → UC.Machine OracleSpec.empty E) (j₀ : Fin m) (Q : UC.Machine OracleSpec.empty E) (A : ProbOracleComp (sessionSpec m E) α) :
(((hybridReduction j₀ fun (i : { j : Fin m // j ≠ j₀ }) => G ↑i).comp Q).run A).eval = ((parFin (Function.update G j₀ Q)).run A).eval

Hybrid reduction. The reduction for the session j₀, running the sessions j ≠ j₀ with G j and composed with a closed package Q, behaves as the sessions G with the session j₀ replaced by Q.

def Cslib.Crypto.Protocols.SSP.hybridFamily {m : ℕ} {β : Type u_1} (real ideal : Fin m → β) (k : ℕ) :
Fin m → β

The k-th hybrid between two families: the sessions below k take the ideal component and the others the real one.

@[simp]
theorem Cslib.Crypto.Protocols.SSP.hybridFamily_zero {m : ℕ} {β : Type u_1} (real ideal : Fin m → β) :
hybridFamily real ideal 0 = real
@[simp]
theorem Cslib.Crypto.Protocols.SSP.hybridFamily_self {m : ℕ} {β : Type u_1} (real ideal : Fin m → β) :
hybridFamily real ideal m = ideal
def Cslib.Crypto.Protocols.SSP.hybridDistinguisher {ιE : Type} {E : ιE → Type} {m : ℕ} (real ideal : Fin m → UC.Machine OracleSpec.empty E) (A : ProbOracleComp (sessionSpec m E) Bool) (j₀ : Fin m) :

The single-session distinguisher of the hop at the session j₀: it runs A against the reduction whose sessions below j₀ are ideal and whose sessions above j₀ are real.

theorem Cslib.Crypto.Protocols.SSP.advantage_hybridFamily_succ {ιE : Type} {E : ιE → Type} {m : ℕ} (real ideal : Fin m → UC.Machine OracleSpec.empty E) (A : ProbOracleComp (sessionSpec m E) Bool) (j₀ : Fin m) :
advantage A (parFin (hybridFamily real ideal ↑j₀)) (parFin (hybridFamily real ideal (↑j₀ + 1))) = advantage (hybridDistinguisher real ideal A j₀) (real j₀) (ideal j₀)

Hybrid hop. Replacing the session j₀ of the hybrid is exactly distinguishing the real package of that session from the ideal one, by the single-session distinguisher.

theorem Cslib.Crypto.Protocols.SSP.advantage_parFin_le_sum {ιE : Type} {E : ιE → Type} {m : ℕ} (real ideal : Fin m → UC.Machine OracleSpec.empty E) (A : ProbOracleComp (sessionSpec m E) Bool) :
advantage A (parFin real) (parFin ideal) ≤ ∑ j : Fin m, advantage (hybridDistinguisher real ideal A j) (real j) (ideal j)

Multi-session hybrid bound. The advantage in distinguishing m real sessions from m ideal sessions is at most the sum, over the sessions, of the advantage of the single-session distinguisher of the hop at that session.

theorem Cslib.Crypto.Protocols.SSP.isBounded_hybridReduction {ιE : Type} {E : ιE → Type} {m : ℕ} (j₀ : Fin m) (F : { j : Fin m // j ≠ j₀ } → UC.Machine OracleSpec.empty E) {t : ℕ} (hF : ∀ (j : { j : Fin m // j ≠ j₀ }), (F j).IsBounded t) :
(hybridReduction j₀ F).IsBounded (m * t + 1)

The hybrid reduction for session j₀ of m sessions, each with call budget t, has call budget m * t + 1.

theorem Cslib.Crypto.Protocols.SSP.isQueryBounded_hybridDistinguisher {ιE : Type} {E : ιE → Type} {m : ℕ} (real ideal : Fin m → UC.Machine OracleSpec.empty E) {A : ProbOracleComp (sessionSpec m E) Bool} (j₀ : Fin m) {t qA : ℕ} (hreal : ∀ (j : Fin m), (real j).IsBounded t) (hideal : ∀ (j : Fin m), (ideal j).IsBounded t) (hA : OracleComp.IsQueryBounded A qA) :
OracleComp.IsQueryBounded (hybridDistinguisher real ideal A j₀) (m * t + 1 + qA * (m * t + 2))

The single-session distinguisher of hop j₀, linking an adversary with query budget qA against m real/ideal packages of call budget t, has query budget m * t + 1 + qA * (m * t + 2).

Sessions sharing a global package #

def Cslib.Crypto.Protocols.SSP.liftInr {ιE : Type} {E : ιE → Type} {α ιI : Type} {I : ιI → Type} (program : ProbOracleComp I α) :

A program querying the interface I, as a program querying the right summand of E ⊕ₒ I; its private coins stay private.

theorem Cslib.Crypto.Protocols.SSP.runFrom_par_id_liftInr {ιE : Type} {E : ιE → Type} {α ιI : Type} {I : ιI → Type} (Q : UC.Machine I E) (program : ProbOracleComp I α) (s : (par Q (UC.Machine.id I)).State) :
(par Q (UC.Machine.id I)).runFrom (liftInr program) s = (fun (a : α) => (a, s)) <$> program

A relabelled program run against a package placed beside the forwarding package only reaches the forwarding package, so it runs unchanged and leaves the state untouched.

def Cslib.Crypto.Protocols.SSP.globalWorld {ιE : Type} {E : ιE → Type} {ιI : Type} {I : ιI → Type} {m : ℕ} (P : Fin m → UC.Machine I E) (G : UC.Machine OracleSpec.empty I) :

The sessions P j sharing the global package G, which the environment also queries directly.

One session Q with the global package G, which the environment also queries directly.

def Cslib.Crypto.Protocols.SSP.globalReduction {ιE : Type} {E : ιE → Type} {ιI : Type} {I : ιI → Type} {m : ℕ} (j₀ : Fin m) (F : { j : Fin m // j ≠ j₀ } → UC.Machine I E) :

The reduction for the session j₀ of m sessions sharing a global package: it runs the packages F j of the sessions j ≠ j₀ itself, routing their queries to the global package through the right summand of its import, and forwards both the queries to the session j₀ and the direct queries to the global package.

theorem Cslib.Crypto.Protocols.SSP.eval_run_globalReduction_comp {ιE : Type} {E : ιE → Type} {α ιI : Type} {I : ιI → Type} {m : ℕ} (P : Fin m → UC.Machine I E) (G : UC.Machine OracleSpec.empty I) (j₀ : Fin m) (Q : UC.Machine I E) (A : ProbOracleComp (OracleSpec.sum (sessionSpec m E) I) α) :
(((globalReduction j₀ fun (i : { j : Fin m // j ≠ j₀ }) => P ↑i).comp (eucWorld Q G)).run A).eval = ((globalWorld (Function.update P j₀ Q) G).run A).eval

Hybrid reduction with a global package. The reduction for the session j₀, running the sessions j ≠ j₀ with P j and composed with the single-session world of Q, behaves as the sessions P with the session j₀ replaced by Q, sharing the global package.

def Cslib.Crypto.Protocols.SSP.globalDistinguisher {ιE : Type} {E : ιE → Type} {ιI : Type} {I : ιI → Type} {m : ℕ} (real ideal : Fin m → UC.Machine I E) (A : ProbOracleComp (OracleSpec.sum (sessionSpec m E) I) Bool) (j₀ : Fin m) :

The single-session distinguisher of the hop at the session j₀ with a global package: it runs A against the reduction whose sessions below j₀ are ideal and whose sessions above j₀ are real.

theorem Cslib.Crypto.Protocols.SSP.advantage_globalWorld_hybridFamily_succ {ιE : Type} {E : ιE → Type} {ιI : Type} {I : ιI → Type} {m : ℕ} (real ideal : Fin m → UC.Machine I E) (G : UC.Machine OracleSpec.empty I) (A : ProbOracleComp (OracleSpec.sum (sessionSpec m E) I) Bool) (j₀ : Fin m) :
advantage A (globalWorld (hybridFamily real ideal ↑j₀) G) (globalWorld (hybridFamily real ideal (↑j₀ + 1)) G) = advantage (globalDistinguisher real ideal A j₀) (eucWorld (real j₀) G) (eucWorld (ideal j₀) G)

Hybrid hop with a global package. Replacing the session j₀ of the hybrid is exactly distinguishing the single-session worlds of the real and the ideal package of that session.

theorem Cslib.Crypto.Protocols.SSP.advantage_globalWorld_le_sum {ιE : Type} {E : ιE → Type} {ιI : Type} {I : ιI → Type} {m : ℕ} (real ideal : Fin m → UC.Machine I E) (G : UC.Machine OracleSpec.empty I) (A : ProbOracleComp (OracleSpec.sum (sessionSpec m E) I) Bool) :
advantage A (globalWorld real G) (globalWorld ideal G) ≤ ∑ j : Fin m, advantage (globalDistinguisher real ideal A j) (eucWorld (real j) G) (eucWorld (ideal j) G)

Hybrid bound with a global package. The advantage in distinguishing m real sessions from m ideal sessions sharing the global package G is at most the sum, over the sessions, of the advantage of the single-session distinguisher of the hop at that session, which also has direct access to G.