Documentation

CslibFrontier.Crypto.Protocols.MPC.Composition.Advantage

Concrete semi-honest advantage of a composed protocol #

PerfectSemiHonestPrivate.compose composes a perfectly private outer protocol with perfectly private subprotocols. This module gives the concrete, per-instance form of the composition argument for an outer protocol that is only computationally private: it bounds semiHonestAdvantage (P.compose Sub) for a coalition I with the composed simulator composeSim P S₁ S₂ through the hybrid execution that runs the outer protocol P in its ideal oracle world W₁ and expands the coalition's views with the subprotocol simulators S₂.

Everything here is original bookkeeping around Goldreich's composition theorem (Section 7.5.2.1, Theorem 7.5.7) rather than a cited statement: the quantities are concrete, for a fixed input tuple and distinguisher, with no security parameter and no efficiency claim about composeDistinguisher. The bound of the subprotocol-replacement gap by the semi-honest advantages against computationally private subprotocols (the hybrid argument over the oracle rounds of the kernel program, with an explicit distinguisher for each round) is in CslibFrontier/Crypto/Protocols/MPC/Composition/Hybrid.lean. The asymptotic statement with certified reductions is not proved (#6045).

Main definitions #

Main results #

References #

noncomputable def Cslib.Crypto.Protocols.MPC.composeDistinguisher {m : ℕ} {spec₁ spec₂ : MultiOracleSpec} {sc₁ : Schedule m spec₁} {sc₂ : (op : spec₁.Op) → Schedule (spec₁.arity op) spec₂} {In Coins₁ Out : Fin m → Type} {Coins₂ : (op : spec₁.Op) → Fin (spec₁.arity op) → Type} (P : Protocol m spec₁ sc₁ In Coins₁ Out) (S₂ : (op : spec₁.Op) → (J : Finset (Fin (spec₁.arity op))) → CoalitionSimulator (sc₂ op) (spec₁.Query op) (Coins₂ op) (spec₁.Answer op) J) (I : Finset (Fin m)) (x : (i : Fin m) → In i) (D : ((i : ↥I) → PartyView In (Schedule.ComposedCoins Coins₂ Coins₁ sc₁) (Schedule.compose sc₂ sc₁) ↑i) × ((i : Fin m) → Out i) → ProbComp Bool) (r : ((i : ↥I) → PartyView In Coins₁ sc₁ ↑i) × ((i : Fin m) → Out i)) :

The reduction of the composition argument: from a distinguisher D of the coalition I's views of a composed protocol P.compose Sub, the distinguisher of I's views of the outer protocol P on the input tuple x that expands these views at every oracle round with the subprotocol simulators S₂ (expandSimSteps) and runs D on the result.

theorem Cslib.Crypto.Protocols.MPC.eval_idealJoint_composeSim_bind {m : ℕ} {spec₁ spec₂ : MultiOracleSpec} {sc₁ : Schedule m spec₁} {sc₂ : (op : spec₁.Op) → Schedule (spec₁.arity op) spec₂} {In Coins₁ Out : Fin m → Type} {Coins₂ : (op : spec₁.Op) → Fin (spec₁.arity op) → Type} (P : Protocol m spec₁ sc₁ In Coins₁ Out) (f : Functionality m In Out) (I : Finset (Fin m)) (S₁ : CoalitionSimulator sc₁ In Coins₁ Out I) (S₂ : (op : spec₁.Op) → (J : Finset (Fin (spec₁.arity op))) → CoalitionSimulator (sc₂ op) (spec₁.Query op) (Coins₂ op) (spec₁.Answer op) J) (x : (i : Fin m) → In i) (D : ((i : ↥I) → PartyView In (Schedule.ComposedCoins Coins₂ Coins₁ sc₁) (Schedule.compose sc₂ sc₁) ↑i) × ((i : Fin m) → Out i) → ProbComp Bool) :
(idealJoint f I (composeSim P S₁ S₂) x >>= D).eval = (idealJoint f I S₁ x >>= composeDistinguisher P S₂ I x D).eval

Ideal to hybrid. The ideal game of a composed protocol with the composed simulator composeSim P S₁ S₂ against D is the ideal game of the outer protocol with S₁ against the reduction composeDistinguisher P S₂ I x D. No property of the simulators is used.

theorem Cslib.Crypto.Protocols.MPC.Protocol.bind_realJoint_compose {m : ℕ} {spec₁ spec₂ : MultiOracleSpec} {sc₁ : Schedule m spec₁} {sc₂ : (op : spec₁.Op) → Schedule (spec₁.arity op) spec₂} {In Coins₁ Out : Fin m → Type} {Coins₂ : (op : spec₁.Op) → Fin (spec₁.arity op) → Type} {P : Protocol m spec₁ sc₁ In Coins₁ Out} {W₁ : MultiOracleWorld spec₁} {W₂ : MultiOracleWorld spec₂} {Sub : (op : spec₁.Op) → Protocol (spec₁.arity op) spec₂ (sc₂ op) (spec₁.Query op) (Coins₂ op) (spec₁.Answer op)} {S₂ : (op : spec₁.Op) → (J : Finset (Fin (spec₁.arity op))) → CoalitionSimulator (sc₂ op) (spec₁.Query op) (Coins₂ op) (spec₁.Answer op) J} (hSub : ∀ (op : spec₁.Op), PerfectSemiHonestPrivate (Sub op) W₂ (W₁ op) (S₂ op)) (I : Finset (Fin m)) (x : (i : Fin m) → In i) (D : ((i : ↥I) → PartyView In (Schedule.ComposedCoins Coins₂ Coins₁ sc₁) (Schedule.compose sc₂ sc₁) ↑i) × ((i : Fin m) → Out i) → ProbComp Bool) :
(((P.compose Sub).realJoint W₂ I x).bind fun (r : ((i : ↥I) → PartyView In (Schedule.ComposedCoins Coins₂ Coins₁ sc₁) (Schedule.compose sc₂ sc₁) ↑i) × ((i : Fin m) → Out i)) => (D r).eval) = (P.realJoint W₁ I x).bind fun (r : ((i : ↥I) → PartyView In Coins₁ sc₁ ↑i) × ((i : Fin m) → Out i)) => (composeDistinguisher P S₂ I x D r).eval

Hybrid to real, for perfectly private subprotocols. When every subprotocol Sub op is perfectly private in W₂ for the functionality W₁ op with simulators S₂ op, the real execution of P.compose Sub in W₂ against D is the real execution of P in W₁ against the reduction composeDistinguisher P S₂ I x D.

theorem Cslib.Crypto.Protocols.MPC.semiHonestAdvantage_compose_le {m : ℕ} {spec₁ spec₂ : MultiOracleSpec} {sc₁ : Schedule m spec₁} {sc₂ : (op : spec₁.Op) → Schedule (spec₁.arity op) spec₂} {In Coins₁ Out : Fin m → Type} {Coins₂ : (op : spec₁.Op) → Fin (spec₁.arity op) → Type} (P : Protocol m spec₁ sc₁ In Coins₁ Out) (W₁ : MultiOracleWorld spec₁) (W₂ : MultiOracleWorld spec₂) (f : Functionality m In Out) (I : Finset (Fin m)) (S₁ : CoalitionSimulator sc₁ In Coins₁ Out I) (Sub : (op : spec₁.Op) → Protocol (spec₁.arity op) spec₂ (sc₂ op) (spec₁.Query op) (Coins₂ op) (spec₁.Answer op)) (S₂ : (op : spec₁.Op) → (J : Finset (Fin (spec₁.arity op))) → CoalitionSimulator (sc₂ op) (spec₁.Query op) (Coins₂ op) (spec₁.Answer op) J) (x : (i : Fin m) → In i) (D : ((i : ↥I) → PartyView In (Schedule.ComposedCoins Coins₂ Coins₁ sc₁) (Schedule.compose sc₂ sc₁) ↑i) × ((i : Fin m) → Out i) → ProbComp Bool) :
semiHonestAdvantage (P.compose Sub) W₂ f I (composeSim P S₁ S₂) x D ≤ semiHonestAdvantage P W₁ f I S₁ x (composeDistinguisher P S₂ I x D) + Game.advantage ((P.realJoint W₁ I x).bind fun (r : ((i : ↥I) → PartyView In Coins₁ sc₁ ↑i) × ((i : Fin m) → Out i)) => (composeDistinguisher P S₂ I x D r).eval) (((P.compose Sub).realJoint W₂ I x).bind fun (r : ((i : ↥I) → PartyView In (Schedule.ComposedCoins Coins₂ Coins₁ sc₁) (Schedule.compose sc₂ sc₁) ↑i) × ((i : Fin m) → Out i)) => (D r).eval)

Concrete composition bound. For every outer protocol P in the oracle world W₁, outer simulator S₁ for coalition I, subprotocols Sub in W₂ and subprotocol simulators S₂, the semi-honest advantage of D against P.compose Sub with composeSim P S₁ S₂ is at most the advantage of the reduction composeDistinguisher P S₂ I x D against P with S₁, plus the subprotocol-replacement gap: the distance between the real execution of P in W₁ against the reduction and the real execution of P.compose Sub in W₂ against D. Nothing is assumed about P, Sub or the simulators; the gap is the term that the privacy of the subprotocols bounds.

theorem Cslib.Crypto.Protocols.MPC.semiHonestAdvantage_compose {m : ℕ} {spec₁ spec₂ : MultiOracleSpec} {sc₁ : Schedule m spec₁} {sc₂ : (op : spec₁.Op) → Schedule (spec₁.arity op) spec₂} {In Coins₁ Out : Fin m → Type} {Coins₂ : (op : spec₁.Op) → Fin (spec₁.arity op) → Type} {P : Protocol m spec₁ sc₁ In Coins₁ Out} {W₁ : MultiOracleWorld spec₁} {W₂ : MultiOracleWorld spec₂} {Sub : (op : spec₁.Op) → Protocol (spec₁.arity op) spec₂ (sc₂ op) (spec₁.Query op) (Coins₂ op) (spec₁.Answer op)} {S₂ : (op : spec₁.Op) → (J : Finset (Fin (spec₁.arity op))) → CoalitionSimulator (sc₂ op) (spec₁.Query op) (Coins₂ op) (spec₁.Answer op) J} (hSub : ∀ (op : spec₁.Op), PerfectSemiHonestPrivate (Sub op) W₂ (W₁ op) (S₂ op)) (f : Functionality m In Out) (I : Finset (Fin m)) (S₁ : CoalitionSimulator sc₁ In Coins₁ Out I) (x : (i : Fin m) → In i) (D : ((i : ↥I) → PartyView In (Schedule.ComposedCoins Coins₂ Coins₁ sc₁) (Schedule.compose sc₂ sc₁) ↑i) × ((i : Fin m) → Out i) → ProbComp Bool) :
semiHonestAdvantage (P.compose Sub) W₂ f I (composeSim P S₁ S₂) x D = semiHonestAdvantage P W₁ f I S₁ x (composeDistinguisher P S₂ I x D)

Composition with perfectly private subprotocols preserves the advantage. When every subprotocol Sub op is perfectly private in W₂ for the functionality W₁ op with simulators S₂ op, the semi-honest advantage of D against P.compose Sub with composeSim P S₁ S₂ equals the advantage of the reduction composeDistinguisher P S₂ I x D against P with S₁. The outer protocol may be only computationally private; PerfectSemiHonestPrivate.compose is the case where the right-hand side vanishes for every distinguisher.

theorem Cslib.Crypto.Protocols.MPC.Protocol.bind_realJoint_composeDistinguisher_eq_kernelRun {m : ℕ} {spec₁ spec₂ : MultiOracleSpec} {sc₁ : Schedule m spec₁} {sc₂ : (op : spec₁.Op) → Schedule (spec₁.arity op) spec₂} {In Coins₁ Out : Fin m → Type} {Coins₂ : (op : spec₁.Op) → Fin (spec₁.arity op) → Type} (P : Protocol m spec₁ sc₁ In Coins₁ Out) (W₁ : MultiOracleWorld spec₁) (S₂ : (op : spec₁.Op) → (J : Finset (Fin (spec₁.arity op))) → CoalitionSimulator (sc₂ op) (spec₁.Query op) (Coins₂ op) (spec₁.Answer op) J) (I : Finset (Fin m)) (x : (i : Fin m) → In i) (D : ((i : ↥I) → PartyView In (Schedule.ComposedCoins Coins₂ Coins₁ sc₁) (Schedule.compose sc₂ sc₁) ↑i) × ((i : Fin m) → Out i) → ProbComp Bool) :
((P.realJoint W₁ I x).bind fun (r : ((i : ↥I) → PartyView In Coins₁ sc₁ ↑i) × ((i : Fin m) → Out i)) => (composeDistinguisher P S₂ I x D r).eval) = (ProbComp.eval (OracleComp.pi P.sampleCoins)).bind fun (c₁ : (i : Fin m) → Coins₁ i) => (Composition.kernelRun (fun (op : spec₁.Op) (J : Finset (Fin (spec₁.arity op))) (q : (s : Fin (spec₁.arity op)) → spec₁.Query op s) => (idealJoint (W₁ op) J (S₂ op J) q).eval) I P.steps fun (i : Fin m) => (x i, c₁ i)).bind fun (res : ((i : ↥I) → Schedule.SubCoins Coins₂ sc₁ ↑i × (Schedule.compose sc₂ sc₁).Received ↑i) × ((i : Fin m) → Out i)) => (D (fun (i : ↥I) => { input := x ↑i, coins := (c₁ ↑i, (res.1 i).1), received := (res.1 i).2 }, res.2)).eval

The hybrid game as a kernel game. The real execution of the outer protocol P in W₁ against the reduction composeDistinguisher P S₂ I x D samples the outer coins, runs the kernel program of P.steps on the ideal joint distributions of the subprotocols and runs D on the resulting views and outputs.

theorem Cslib.Crypto.Protocols.MPC.advantage_replacement_eq_kernelRun {m : ℕ} {spec₁ spec₂ : MultiOracleSpec} {sc₁ : Schedule m spec₁} {sc₂ : (op : spec₁.Op) → Schedule (spec₁.arity op) spec₂} {In Coins₁ Out : Fin m → Type} {Coins₂ : (op : spec₁.Op) → Fin (spec₁.arity op) → Type} (P : Protocol m spec₁ sc₁ In Coins₁ Out) (W₁ : MultiOracleWorld spec₁) (W₂ : MultiOracleWorld spec₂) (Sub : (op : spec₁.Op) → Protocol (spec₁.arity op) spec₂ (sc₂ op) (spec₁.Query op) (Coins₂ op) (spec₁.Answer op)) (S₂ : (op : spec₁.Op) → (J : Finset (Fin (spec₁.arity op))) → CoalitionSimulator (sc₂ op) (spec₁.Query op) (Coins₂ op) (spec₁.Answer op) J) (I : Finset (Fin m)) (x : (i : Fin m) → In i) (D : ((i : ↥I) → PartyView In (Schedule.ComposedCoins Coins₂ Coins₁ sc₁) (Schedule.compose sc₂ sc₁) ↑i) × ((i : Fin m) → Out i) → ProbComp Bool) :
Game.advantage ((P.realJoint W₁ I x).bind fun (r : ((i : ↥I) → PartyView In Coins₁ sc₁ ↑i) × ((i : Fin m) → Out i)) => (composeDistinguisher P S₂ I x D r).eval) (((P.compose Sub).realJoint W₂ I x).bind fun (r : ((i : ↥I) → PartyView In (Schedule.ComposedCoins Coins₂ Coins₁ sc₁) (Schedule.compose sc₂ sc₁) ↑i) × ((i : Fin m) → Out i)) => (D r).eval) = Game.advantage ((ProbComp.eval (OracleComp.pi P.sampleCoins)).bind fun (c₁ : (i : Fin m) → Coins₁ i) => (Composition.kernelRun (fun (op : spec₁.Op) (J : Finset (Fin (spec₁.arity op))) (q : (s : Fin (spec₁.arity op)) → spec₁.Query op s) => (idealJoint (W₁ op) J (S₂ op J) q).eval) I P.steps fun (i : Fin m) => (x i, c₁ i)).bind fun (res : ((i : ↥I) → Schedule.SubCoins Coins₂ sc₁ ↑i × (Schedule.compose sc₂ sc₁).Received ↑i) × ((i : Fin m) → Out i)) => (D (fun (i : ↥I) => { input := x ↑i, coins := (c₁ ↑i, (res.1 i).1), received := (res.1 i).2 }, res.2)).eval) ((ProbComp.eval (OracleComp.pi P.sampleCoins)).bind fun (c₁ : (i : Fin m) → Coins₁ i) => (Composition.kernelRun (fun (op : spec₁.Op) (J : Finset (Fin (spec₁.arity op))) (q : (s : Fin (spec₁.arity op)) → spec₁.Query op s) => (Sub op).realJoint W₂ J q) I P.steps fun (i : Fin m) => (x i, c₁ i)).bind fun (res : ((i : ↥I) → Schedule.SubCoins Coins₂ sc₁ ↑i × (Schedule.compose sc₂ sc₁).Received ↑i) × ((i : Fin m) → Out i)) => (D (fun (i : ↥I) => { input := x ↑i, coins := (c₁ ↑i, (res.1 i).1), received := (res.1 i).2 }, res.2)).eval)

The subprotocol-replacement gap is a kernel gap. The replacement gap of semiHonestAdvantage_compose_le is the advantage of one test between two runs of the same kernel program kernelRun of P.steps, after sampling the outer coins: on the ideal joint distributions idealJoint (W₁ op) J (S₂ op J) q of the subprotocols and on their real joint distributions (Sub op).realJoint W₂ J q. The two runs differ only in the kernel that each oracle round draws from, which is the setting of the hybrid argument over the oracle rounds. Nothing is assumed about P, Sub or the simulators, and no bound on the gap is derived here.