Documentation

CslibFrontier.Crypto.Protocols.MPC.Composition.Hybrid

Hybrid argument over the oracle rounds of a composed protocol #

semiHonestAdvantage_compose_le bounds the semi-honest advantage against a composed protocol P.compose Sub by the advantage of a reduction against the outer protocol P plus the subprotocol-replacement gap, and advantage_replacement_eq_kernelRun expresses that gap through two runs of one kernel program, Composition.kernelRun, on the ideal and on the real joint distributions of the subprotocols. This module bounds the gap by the semi-honest advantages of explicit distinguishers against the subprotocols, by the hybrid argument that replaces the subprotocol calls one at a time.

At an oracle round op of the outer protocol with query tuple q, the two runs differ in the kernel that the round draws from and in the kernel of the later rounds. Changing the kernel of this round, in front of the later rounds run on the ideal joint distributions, is a semi-honest distinguishing game against the subprotocol Sub op on the input tuple q: its distinguisher Composition.roundDistinguisher receives the views of the corrupted slots and the answers, runs the remaining rounds with the ideal functionalities W₁ and the subprotocol simulators S₂ (Composition.kernelProg) and applies the given test. Changing the kernel of the later rounds, after this round has drawn from the real joint distribution, is the same question for the tail, averaged over the real execution of this round.

Because the query tuple of a round depends on the outcome of the earlier rounds, the bound is not a sum of advantages at fixed inputs. Composition.replacementBound is the sum over the oracle rounds of the expectation, over the real executions of the earlier subprotocol calls, of the semi-honest advantage of that round's distinguisher against its subprotocol on the round's query tuple. It is an extended non-negative real defined by recursion on the outer steps.

Everything here is original bookkeeping for the hybrid argument in the proof of Goldreich's composition theorem (Section 7.5.2.1, Theorem 7.5.7), not a cited statement. The bounds are concrete: a fixed input tuple and distinguisher, no security parameter, and no efficiency claim about Composition.roundDistinguisher. The asymptotic composition theorem, which needs polynomial-time certificates for these distinguishers and a choice of the earlier rounds' outcome as non-uniform advice, is not proved here (#6045).

Main definitions #

Main results #

References #

theorem Cslib.Crypto.Protocols.MPC.Composition.kernelRun_oracle {m : ℕ} {spec₁ spec₂ : MultiOracleSpec} {sc₂ : (op : spec₁.Op) → Schedule (spec₁.arity op) spec₂} {Coins₂ : (op : spec₁.Op) → Fin (spec₁.arity op) → Type} (μ : (op : spec₁.Op) → (J : Finset (Fin (spec₁.arity op))) → ((s : Fin (spec₁.arity op)) → spec₁.Query op s) → PMF (((s : ↥J) → PartyView (spec₁.Query op) (Coins₂ op) (sc₂ op) ↑s) × ((s : Fin (spec₁.arity op)) → spec₁.Answer op s))) (I : Finset (Fin m)) {State Out : Fin m → Type} {op : spec₁.Op} {parties : Fin (spec₁.arity op) ↪ Fin m} {sc₁ : Schedule m spec₁} (query : (s : Fin (spec₁.arity op)) → State (parties s) → spec₁.Query op s) (next : Steps (fun (i : Fin m) => State i × (Round.oracle op parties).Received i) Out sc₁) (st : (i : Fin m) → State i) :
kernelRun μ I (Steps.oracle query next) st = (μ op (subCoalition parties I) fun (s : Fin (spec₁.arity op)) => query s (st (parties s))).bind fun (r : ((s : ↥(subCoalition parties I)) → PartyView (spec₁.Query op) (Coins₂ op) (sc₂ op) ↑s) × ((s : Fin (spec₁.arity op)) → spec₁.Answer op s)) => PMF.map (fun (res : ((i : ↥I) → Schedule.SubCoins Coins₂ sc₁ ↑i × (Schedule.compose sc₂ sc₁).Received ↑i) × ((i : Fin m) → Out i)) => (fun (i : ↥I) => ((pushTupleRestrict parties I (fun (s : ↥(subCoalition parties I)) => (r.1 s).coins) i, (res.1 i).1), (pushScheduleReceivedRestrict parties I (sc₂ op) (fun (s : ↥(subCoalition parties I)) => (r.1 s).received) i).append (res.1 i).2), res.2)) (kernelRun μ I next fun (i : Fin m) => (st i, Round.deliverOracle parties r.2 i))

The kernel program at an oracle round, with the drawn views and answers as one pair r: the round draws r from the kernel on the round's query tuple, the answers r.2 are delivered, and the corrupted slots' subprotocol coins and transcripts in r.1 are put in front of the result of the remaining rounds.

noncomputable def Cslib.Crypto.Protocols.MPC.Composition.kernelProg {m : ℕ} {spec₁ spec₂ : MultiOracleSpec} {sc₂ : (op : spec₁.Op) → Schedule (spec₁.arity op) spec₂} {Coins₂ : (op : spec₁.Op) → Fin (spec₁.arity op) → Type} (κ : (op : spec₁.Op) → (J : Finset (Fin (spec₁.arity op))) → ((s : Fin (spec₁.arity op)) → spec₁.Query op s) → ProbComp (((s : ↥J) → PartyView (spec₁.Query op) (Coins₂ op) (sc₂ op) ↑s) × ((s : Fin (spec₁.arity op)) → spec₁.Answer op s))) (I : Finset (Fin m)) {State Out : Fin m → Type} {sc₁ : Schedule m spec₁} (steps : Steps State Out sc₁) (st : (i : Fin m) → State i) :
ProbComp (((i : ↥I) → Schedule.SubCoins Coins₂ sc₁ ↑i × (Schedule.compose sc₂ sc₁).Received ↑i) × ((i : Fin m) → Out i))

The kernel program of kernelRun as a ProbComp, for kernels κ that are programs: every oracle round op with query tuple q draws the views of the corrupted slots J = subCoalition parties I and all the answers from κ op J q. Its distribution is kernelRun on the distributions of κ (eval_kernelProg).

theorem Cslib.Crypto.Protocols.MPC.Composition.eval_kernelProg {m : ℕ} {spec₁ spec₂ : MultiOracleSpec} {sc₂ : (op : spec₁.Op) → Schedule (spec₁.arity op) spec₂} {Coins₂ : (op : spec₁.Op) → Fin (spec₁.arity op) → Type} (κ : (op : spec₁.Op) → (J : Finset (Fin (spec₁.arity op))) → ((s : Fin (spec₁.arity op)) → spec₁.Query op s) → ProbComp (((s : ↥J) → PartyView (spec₁.Query op) (Coins₂ op) (sc₂ op) ↑s) × ((s : Fin (spec₁.arity op)) → spec₁.Answer op s))) (I : Finset (Fin m)) {State Out : Fin m → Type} {sc₁ : Schedule m spec₁} (steps : Steps State Out sc₁) (st : (i : Fin m) → State i) :
(kernelProg κ I steps st).eval = kernelRun (fun (op : spec₁.Op) (J : Finset (Fin (spec₁.arity op))) (q : (s : Fin (spec₁.arity op)) → spec₁.Query op s) => (κ op J q).eval) I steps st

The kernel program kernelProg κ has the distribution of kernelRun on the distributions of the kernels κ.

noncomputable def Cslib.Crypto.Protocols.MPC.Composition.roundDistinguisher {m : ℕ} {spec₁ spec₂ : MultiOracleSpec} {sc₂ : (op : spec₁.Op) → Schedule (spec₁.arity op) spec₂} {Coins₂ : (op : spec₁.Op) → Fin (spec₁.arity op) → Type} (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)) {State Out : Fin m → Type} {op : spec₁.Op} {parties : Fin (spec₁.arity op) ↪ Fin m} {sc₁ : Schedule m spec₁} (next : Steps (fun (i : Fin m) => State i × (Round.oracle op parties).Received i) Out sc₁) (st : (i : Fin m) → State i) (D : ((i : ↥I) → Schedule.SubCoins Coins₂ (Round.oracle op parties :: sc₁) ↑i × (Schedule.compose sc₂ (Round.oracle op parties :: sc₁)).Received ↑i) × ((i : Fin m) → Out i) → ProbComp Bool) (r : ((s : ↥(subCoalition parties I)) → PartyView (spec₁.Query op) (Coins₂ op) (sc₂ op) ↑s) × ((s : Fin (spec₁.arity op)) → spec₁.Answer op s)) :

The distinguisher against the subprotocol of an oracle round. At an oracle round .oracle query next of the outer steps, reached in the states st, a test D of the kernel program's result becomes this distinguisher of the views of the corrupted slots subCoalition parties I and the answers of the subprotocol Sub op: it delivers the answers, runs the remaining rounds next on the ideal joint distributions of the subprotocols, sampled with the ideal functionalities W₁ and the simulators S₂ (kernelProg), puts the given views in front of the result and runs D.

noncomputable def Cslib.Crypto.Protocols.MPC.Composition.replacementBound {m : ℕ} {spec₁ spec₂ : MultiOracleSpec} {sc₂ : (op : spec₁.Op) → Schedule (spec₁.arity op) spec₂} {Coins₂ : (op : spec₁.Op) → Fin (spec₁.arity op) → Type} (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)) {State Out : Fin m → Type} {sc₁ : Schedule m spec₁} (steps : Steps State Out sc₁) (st : (i : Fin m) → State i) (D : ((i : ↥I) → Schedule.SubCoins Coins₂ sc₁ ↑i × (Schedule.compose sc₂ sc₁).Received ↑i) × ((i : Fin m) → Out i) → ProbComp Bool) :

The hybrid bound on the replacement gap of a kernel program. For the outer steps steps from the states st and a test D of the kernel program's result, the sum over the oracle rounds of steps of the expected semi-honest advantage of that round's distinguisher (roundDistinguisher) against the round's subprotocol Sub op in W₂, for the functionality W₁ op with the simulator S₂ op, on the round's query tuple. The expectation is over the real joint distributions (Sub op).realJoint W₂ of the earlier oracle rounds, which determine the query tuple and the states of the round. Message rounds contribute nothing.

theorem Cslib.Crypto.Protocols.MPC.Composition.advantage_kernelRun_le_replacementBound {m : ℕ} {spec₁ spec₂ : MultiOracleSpec} {sc₂ : (op : spec₁.Op) → Schedule (spec₁.arity op) spec₂} {Coins₂ : (op : spec₁.Op) → Fin (spec₁.arity op) → Type} (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)) {State Out : Fin m → Type} {sc₁ : Schedule m spec₁} (steps : Steps State Out sc₁) (st : (i : Fin m) → State i) (D : ((i : ↥I) → Schedule.SubCoins Coins₂ sc₁ ↑i × (Schedule.compose sc₂ sc₁).Received ↑i) × ((i : Fin m) → Out i) → ProbComp Bool) :
↑(Game.advantage ((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 steps st).bind fun (res : ((i : ↥I) → Schedule.SubCoins Coins₂ sc₁ ↑i × (Schedule.compose sc₂ sc₁).Received ↑i) × ((i : Fin m) → Out i)) => (D res).eval) ((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 steps st).bind fun (res : ((i : ↥I) → Schedule.SubCoins Coins₂ sc₁ ↑i × (Schedule.compose sc₂ sc₁).Received ↑i) × ((i : Fin m) → Out i)) => (D res).eval)) ≤ replacementBound W₁ W₂ Sub S₂ I steps st D

Hybrid argument over the oracle rounds. The advantage of a test D between the kernel program of steps 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 is at most replacementBound: the sum over the oracle rounds of the expected semi-honest advantage of the round's distinguisher against the round's subprotocol. Nothing is assumed about the subprotocols, the simulators or D.

theorem Cslib.Crypto.Protocols.MPC.Composition.replacementBound_eq_zero {m : ℕ} {spec₁ spec₂ : MultiOracleSpec} {sc₂ : (op : spec₁.Op) → Schedule (spec₁.arity op) spec₂} {Coins₂ : (op : spec₁.Op) → Fin (spec₁.arity op) → Type} {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)) {State Out : Fin m → Type} {sc₁ : Schedule m spec₁} (steps : Steps State Out sc₁) (st : (i : Fin m) → State i) (D : ((i : ↥I) → Schedule.SubCoins Coins₂ sc₁ ↑i × (Schedule.compose sc₂ sc₁).Received ↑i) × ((i : Fin m) → Out i) → ProbComp Bool) :
replacementBound W₁ W₂ Sub S₂ I steps st D = 0

The hybrid bound vanishes for perfectly private subprotocols. When every subprotocol Sub op is perfectly private in W₂ for the functionality W₁ op with the simulators S₂ op, every round distinguisher has advantage zero, so replacementBound is zero.

theorem Cslib.Crypto.Protocols.MPC.advantage_replacement_le_replacementBound {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)) ≤ ∑' (c₁ : (i : Fin m) → Coins₁ i), (ProbComp.eval (OracleComp.pi P.sampleCoins)) c₁ * Composition.replacementBound W₁ W₂ Sub S₂ I P.steps (fun (i : Fin m) => (x i, c₁ i)) 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)

The subprotocol-replacement gap is at most the hybrid bound. The replacement gap of semiHonestAdvantage_compose_le is at most the expectation, over the outer coins c₁, of Composition.replacementBound for P.steps from the inputs x and coins c₁: the sum over the oracle rounds of P of the expected semi-honest advantage of the round's distinguisher (Composition.roundDistinguisher) against the round's subprotocol on the round's query tuple. Nothing is assumed about P, Sub, the simulators or D.

theorem Cslib.Crypto.Protocols.MPC.semiHonestAdvantage_compose_le_replacementBound {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)) + ∑' (c₁ : (i : Fin m) → Coins₁ i), (ProbComp.eval (OracleComp.pi P.sampleCoins)) c₁ * Composition.replacementBound W₁ W₂ Sub S₂ I P.steps (fun (i : Fin m) => (x i, c₁ i)) 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)

Concrete composition theorem. 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 expectation over the outer coins of Composition.replacementBound: the sum over the oracle rounds of P of the expected semi-honest advantage of the round's distinguisher Composition.roundDistinguisher against the round's subprotocol Sub op, for the functionality W₁ op with the simulator S₂ op, on the round's query tuple.

This is the concrete, per-instance form of the hybrid argument for Goldreich's Theorem 7.5.7, not the cited theorem: nothing is assumed about P, Sub or the simulators, and no efficiency of the distinguishers is claimed.