Documentation

CslibFrontier.Crypto.Protocols.MPC.Malicious

Malicious Real/Ideal Multi-Party Computation Taxonomy #

This module formalizes the real/ideal simulation paradigm for multi-party computation (MPC) against static coalitions of up to k malicious parties ([DR07], Section 8.1.1, Definition 8.1, pp. 183–185; cf. [Gol04]):

Note on [DR07], Theorem 8.2 (pp. 185–186): Theorem 8.2 is an unproved survey of six landmark malicious general-circuit MPC constructions from external literature (GMW87, LMPS04, BGW88/CCD88, RB89/Beaver91, ILM05); this module formalizes Definition 8.1 and its model-level invariants, hierarchy, and passive bridge without claiming those external protocol constructions.

Main definitions #

Main results #

References #

Functionalities with refusal inputs (⊥) and real/ideal execution outcomes #

@[reducible, inline]

A probabilistic multi-output functionality whose input domain includes none (⊥), modeling faulty parties that refuse to submit an input ([DR07], Section 8.1.1, p. 184).

noncomputable def Cslib.Crypto.Protocols.MPC.Malicious.OptFunctionality.ofDeterministic {ι : Type u} {In Out : ι → Type u} (f : ((i : ι) → Option (In i)) → (i : ι) → Out i) :

Lift a deterministic Option-input function to an OptFunctionality.

noncomputable def Cslib.Crypto.Protocols.MPC.Malicious.OptFunctionality.ofFunctionality {m : ℕ} {In Out : Fin m → Type} (f : Functionality m (fun (i : Fin m) => Option (In i)) Out) :

Lift an MPC.Functionality on Option-inputs to an OptFunctionality via ProbComp.eval.

noncomputable def Cslib.Crypto.Protocols.MPC.Malicious.OptFunctionality.ofTotalFunctionality {m : ℕ} {In Out : Fin m → Type} (defaultIn : (i : Fin m) → In i) (f : Functionality m In Out) :

Lift a total MPC.Functionality to an OptFunctionality using a per-party default input whenever a party supplies none (⊥).

def Cslib.Crypto.Protocols.MPC.Malicious.patchOptInput {ι : Type u} {In : ι → Type u} [DecidableEq ι] (C : Finset ι) (t : (i : ι) → In i) (t'C : (i : ↥C) → Option (In ↑i)) (i : ι) :
Option (In i)

Replace the inputs of coalition C with the adversary's effective inputs t'C (possibly none = ⊥), while keeping every honest party i ∉ C's true input some (t i).

@[simp]
theorem Cslib.Crypto.Protocols.MPC.Malicious.patchOptInput_mem {ι : Type u} {In : ι → Type u} [DecidableEq ι] (C : Finset ι) (t : (i : ι) → In i) (t'C : (i : ↥C) → Option (In ↑i)) {i : ι} (hi : i ∈ C) :
patchOptInput C t t'C i = t'C ⟨i, hi⟩
@[simp]
theorem Cslib.Crypto.Protocols.MPC.Malicious.patchOptInput_notMem {ι : Type u} {In : ι → Type u} [DecidableEq ι] (C : Finset ι) (t : (i : ι) → In i) (t'C : (i : ↥C) → Option (In ↑i)) {i : ι} (hi : i ∉ C) :
patchOptInput C t t'C i = some (t i)
@[simp]
theorem Cslib.Crypto.Protocols.MPC.Malicious.patchOptInput_some_self {ι : Type u} {In : ι → Type u} [DecidableEq ι] (C : Finset ι) (t : (i : ι) → In i) :
(patchOptInput C t fun (i : ↥C) => some (t ↑i)) = fun (i : ι) => some (t i)
structure Cslib.Crypto.Protocols.MPC.Malicious.ExecutionOutcome (ι : Type u) (Out : ι → Type u) (C : Finset ι) (AdvOut : Type u) :

Joint transcript outcome of a real or ideal MPC execution with corrupted coalition C ([DR07], Definition 8.1, pp. 183–184): each honest party i ∉ C receives either a value some y or none (abort / no output), paired with the adversary's arbitrary output advOut.

  • honestOut (i : ι) : i ∉ C → Option (Out i)

    Outputs received by the honest parties i ∉ C (none denotes abort / no output).

  • advOut : AdvOut

    Arbitrary output emitted by the adversary (or ideal simulator) controlling C.

theorem Cslib.Crypto.Protocols.MPC.Malicious.ExecutionOutcome.ext {ι : Type u} {Out : ι → Type u} {C : Finset ι} {AdvOut : Type u} {x y : ExecutionOutcome ι Out C AdvOut} (honestOut : x.honestOut = y.honestOut) (advOut : x.advOut = y.advOut) :
x = y
theorem Cslib.Crypto.Protocols.MPC.Malicious.ExecutionOutcome.ext_iff {ι : Type u} {Out : ι → Type u} {C : Finset ι} {AdvOut : Type u} {x y : ExecutionOutcome ι Out C AdvOut} :
def Cslib.Crypto.Protocols.MPC.Malicious.ExecutionOutcome.Delivered {ι : Type u} {Out : ι → Type u} {C : Finset ι} {AdvOut : Type u} (o : ExecutionOutcome ι Out C AdvOut) :

Every honest party i ∉ C received an output (some _).

def Cslib.Crypto.Protocols.MPC.Malicious.ExecutionOutcome.Aborted {ι : Type u} {Out : ι → Type u} {C : Finset ι} {AdvOut : Type u} (o : ExecutionOutcome ι Out C AdvOut) :

No honest party i ∉ C received an output (none everywhere).

def Cslib.Crypto.Protocols.MPC.Malicious.ExecutionOutcome.IsFair {ι : Type u} {Out : ι → Type u} {C : Finset ι} {AdvOut : Type u} (o : ExecutionOutcome ι Out C AdvOut) :

All-or-nothing fairness: either every honest party receives an output or none does ([DR07], Section 8.1.1, p. 184).

theorem Cslib.Crypto.Protocols.MPC.Malicious.ExecutionOutcome.Delivered.isFair {ι : Type u} {Out : ι → Type u} {C : Finset ι} {AdvOut : Type u} {o : ExecutionOutcome ι Out C AdvOut} (h : o.Delivered) :
theorem Cslib.Crypto.Protocols.MPC.Malicious.ExecutionOutcome.Aborted.isFair {ι : Type u} {Out : ι → Type u} {C : Finset ι} {AdvOut : Type u} {o : ExecutionOutcome ι Out C AdvOut} (h : o.Aborted) :
structure Cslib.Crypto.Protocols.MPC.Malicious.RealModel (ι : Type u) (In Out : ι → Type u) :
Type (u + 1)

An abstract real-world execution model REAL_{A, π}(t) for an MPC protocol π against static coalitions C ([DR07], Definition 8.1, p. 183).

  • Adv : Finset ι → Type u

    Admitted real-world adversaries controlling coalition C.

  • AdvOut {C : Finset ι} : self.Adv C → Type u

    Output type of adversary A controlling coalition C.

  • exec {C : Finset ι} (A : self.Adv C) : ((i : ι) → In i) → PMF (ExecutionOutcome ι Out C (self.AdvOut A))

    Real joint execution distribution REAL_{A, π}(t).

Ideal-model output-delivery guarantees and simulators #

The three output-delivery guarantees of [DR07], Section 8.1.1, pp. 183–184:

  • delivery: guaranteed output delivery (all honest parties always receive f's outputs);
  • fair: fairness (the ideal adversary may abort only before learning f's outputs);
  • withAbort: correctness and privacy without fairness (the ideal adversary learns C's outputs first and may then withhold outputs from honest parties).
structure Cslib.Crypto.Protocols.MPC.Malicious.DeliverySimulator (ι : Type u) (In Out : ι → Type u) (C : Finset ι) (AdvOut : Type u) :
Type (u + 1)

Ideal-world adversary (simulator) for guaranteed output delivery ([DR07], Definition 8.1, pp. 183–184): given C's true inputs, chooses effective inputs t'C (possibly none = ⊥) and local state, receives C's outputs from f, and emits AdvOut.

  • State : Type u

    Simulator internal state passed between input choice and output simulation.

  • chooseInput : ((i : ↥C) → In ↑i) → PMF (((i : ↥C) → Option (In ↑i)) × self.State)

    Choose effective inputs for C and internal state given C's true inputs.

  • finish : self.State → ((i : ↥C) → Out ↑i) → PMF AdvOut

    Produce the simulated adversary output given state and C's ideal outputs.

structure Cslib.Crypto.Protocols.MPC.Malicious.FairSimulator (ι : Type u) (In Out : ι → Type u) (C : Finset ι) (AdvOut : Type u) :
Type (u + 1)

Ideal-world adversary (simulator) for fair abort ([DR07], Section 8.1.1, p. 184): chooses whether to abort before f is evaluated (Sum.inl sa) or supply effective inputs Sum.inr (t'C, sd) for full delivery to all parties. Separating AbortState and DeliverState avoids requiring any dummy witness when an ideal adversary never aborts.

  • AbortState : Type u

    Simulator internal state carried into the early-abort branch.

  • DeliverState : Type u

    Simulator internal state carried into the delivery branch.

  • chooseAction : ((i : ↥C) → In ↑i) → PMF (self.AbortState ⊕ ((i : ↥C) → Option (In ↑i)) × self.DeliverState)

    Either abort before evaluation (Sum.inl sa) or submit effective coalition inputs (Sum.inr (t'C, sd)).

  • finishAbort : self.AbortState → PMF AdvOut

    Produce simulated adversary output on early abort (without seeing any functionality output).

  • finishDeliver : self.DeliverState → ((i : ↥C) → Out ↑i) → PMF AdvOut

    Produce simulated adversary output on delivery (seeing C's ideal outputs).

structure Cslib.Crypto.Protocols.MPC.Malicious.AbortSimulator (ι : Type u) (In Out : ι → Type u) (C : Finset ι) (AdvOut : Type u) :
Type (u + 1)

Ideal-world adversary (simulator) for correctness and privacy without fairness ([DR07], Section 8.1.1, p. 184): chooses effective inputs t'C, receives C's outputs from f, and then decides which honest parties receive some (y i) vs none alongside AdvOut.

  • State : Type u

    Simulator internal state.

  • chooseInput : ((i : ↥C) → In ↑i) → PMF (((i : ↥C) → Option (In ↑i)) × self.State)

    Choose effective coalition inputs and internal state.

  • decideDelivery : self.State → ((i : ↥C) → Out ↑i) → PMF (((i : ι) → i ∉ C → Bool) × AdvOut)

    After seeing C's ideal outputs, choose per-honest-party delivery flags and AdvOut.

noncomputable def Cslib.Crypto.Protocols.MPC.Malicious.idealDelivery {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] (f : OptFunctionality ι In Out) (C : Finset ι) {AdvOut : Type u} (S : DeliverySimulator ι In Out C AdvOut) (t : (i : ι) → In i) :
PMF (ExecutionOutcome ι Out C AdvOut)

Ideal execution IDEAL_{S, f}(t) with guaranteed output delivery.

noncomputable def Cslib.Crypto.Protocols.MPC.Malicious.idealFair {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] (f : OptFunctionality ι In Out) (C : Finset ι) {AdvOut : Type u} (S : FairSimulator ι In Out C AdvOut) (t : (i : ι) → In i) :
PMF (ExecutionOutcome ι Out C AdvOut)

Ideal execution IDEAL_{S, f}(t) with fair abort.

noncomputable def Cslib.Crypto.Protocols.MPC.Malicious.idealWithAbort {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] (f : OptFunctionality ι In Out) (C : Finset ι) {AdvOut : Type u} (S : AbortSimulator ι In Out C AdvOut) (t : (i : ι) → In i) :
PMF (ExecutionOutcome ι Out C AdvOut)

Ideal execution IDEAL_{S, f}(t) with unfair abort (correctness and privacy only).

@[reducible, inline]
abbrev Cslib.Crypto.Protocols.MPC.Malicious.IdealSimulator (g : OutputGuarantee) (ι : Type u) (In Out : ι → Type u) (C : Finset ι) (AdvOut : Type u) :
Type (u + 1)

Simulator type indexed by OutputGuarantee.

noncomputable def Cslib.Crypto.Protocols.MPC.Malicious.idealExec {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] (g : OutputGuarantee) (f : OptFunctionality ι In Out) (C : Finset ι) {AdvOut : Type u} :
IdealSimulator g ι In Out C AdvOut → ((i : ι) → In i) → PMF (ExecutionOutcome ι Out C AdvOut)

Ideal execution IDEAL_{S, f}(t) indexed by OutputGuarantee.

Exact distributional embeddings between output-delivery guarantees #

noncomputable def Cslib.Crypto.Protocols.MPC.Malicious.DeliverySimulator.toFairSimulator {ι : Type u} {In Out : ι → Type u} {C : Finset ι} {AdvOut : Type u} (S : DeliverySimulator ι In Out C AdvOut) :
FairSimulator ι In Out C AdvOut

Embed a DeliverySimulator into FairSimulator by never choosing the abort branch.

theorem Cslib.Crypto.Protocols.MPC.Malicious.idealFair_toFairSimulator {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] (f : OptFunctionality ι In Out) (C : Finset ι) {AdvOut : Type u} (S : DeliverySimulator ι In Out C AdvOut) (t : (i : ι) → In i) :

Embedding a DeliverySimulator into FairSimulator preserves the exact ideal distribution.

noncomputable def Cslib.Crypto.Protocols.MPC.Malicious.FairSimulator.toAbortSimulator {ι : Type u} {In Out : ι → Type u} {C : Finset ι} {AdvOut : Type u} (S : FairSimulator ι In Out C AdvOut) :
AbortSimulator ι In Out C AdvOut

Embed a FairSimulator into AbortSimulator: on early abort (Sum.inl sa), submit ⊥ (none) for all coalition members, discard f's outputs, and withhold delivery from all honest parties; on delivery (Sum.inr (t'C, sd)), deliver to all honest parties.

theorem Cslib.Crypto.Protocols.MPC.Malicious.idealWithAbort_toAbortSimulator {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] (f : OptFunctionality ι In Out) (C : Finset ι) {AdvOut : Type u} (S : FairSimulator ι In Out C AdvOut) (t : (i : ι) → In i) :

Embedding a FairSimulator into AbortSimulator preserves the exact ideal distribution.

noncomputable def Cslib.Crypto.Protocols.MPC.Malicious.DeliverySimulator.toAbortSimulator {ι : Type u} {In Out : ι → Type u} {C : Finset ι} {AdvOut : Type u} (S : DeliverySimulator ι In Out C AdvOut) :
AbortSimulator ι In Out C AdvOut

Embed a DeliverySimulator directly into AbortSimulator.

theorem Cslib.Crypto.Protocols.MPC.Malicious.idealWithAbort_delivery_toAbortSimulator {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] (f : OptFunctionality ι In Out) (C : Finset ι) {AdvOut : Type u} (S : DeliverySimulator ι In Out C AdvOut) (t : (i : ι) → In i) :

Support invariants of the ideal executions #

theorem Cslib.Crypto.Protocols.MPC.Malicious.delivered_of_mem_support_idealDelivery {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] {f : OptFunctionality ι In Out} {C : Finset ι} {AdvOut : Type u} {S : DeliverySimulator ι In Out C AdvOut} {t : (i : ι) → In i} {o : ExecutionOutcome ι Out C AdvOut} (ho : o ∈ (idealDelivery f C S t).support) :

Every outcome in the support of idealDelivery delivers outputs to all honest parties.

theorem Cslib.Crypto.Protocols.MPC.Malicious.isFair_of_mem_support_idealFair {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] {f : OptFunctionality ι In Out} {C : Finset ι} {AdvOut : Type u} {S : FairSimulator ι In Out C AdvOut} {t : (i : ι) → In i} {o : ExecutionOutcome ι Out C AdvOut} (ho : o ∈ (idealFair f C S t).support) :

Every outcome in the support of idealFair satisfies all-or-nothing fairness: either every honest party receives an output or none does.

theorem Cslib.Crypto.Protocols.MPC.Malicious.exists_effectiveInput_of_mem_support_idealWithAbort_deterministic {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] {f : ((i : ι) → Option (In i)) → (i : ι) → Out i} {C : Finset ι} {AdvOut : Type u} {S : AbortSimulator ι In Out C AdvOut} {t : (i : ι) → In i} {o : ExecutionOutcome ι Out C AdvOut} (ho : o ∈ (idealWithAbort (OptFunctionality.ofDeterministic f) C S t).support) :
∃ (t'C : (i : ↥C) → Option (In ↑i)), ∀ (i : ι) (hi : i ∉ C) (y : Out i), o.honestOut i hi = some y → y = f (patchOptInput C t t'C) i

Deterministic correctness of idealWithAbort: in any supported outcome of idealWithAbort for a deterministic functionality f, there is a single effective coalition input t'C such that every honest party i ∉ C that receives an output some y_i receives the exact value f (patchOptInput C t t'C) i.

Definition 8.1: Perfect, statistical, and computational malicious MPC security #

def Cslib.Crypto.Protocols.MPC.Malicious.PerfectMaliciousSecure {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] (g : OutputGuarantee) (k : ℕ) (real : RealModel ι In Out) (f : OptFunctionality ι In Out) :

Perfect malicious MPC security ([DR07], Section 8.1.1, Definition 8.1, pp. 183–184): for every static coalition C of size at most k and every admitted real adversary A, there exists an ideal simulator S (matching output guarantee g) whose ideal execution distribution equals real.exec A t on every input profile t.

def Cslib.Crypto.Protocols.MPC.Malicious.StatisticallyMaliciousSecure {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] (g : OutputGuarantee) (k : ℕ) (ε : ENNReal) (real : RealModel ι In Out) (f : OptFunctionality ι In Out) :

Statistical malicious MPC security ([DR07], Section 8.1.1, Definition 8.1, pp. 183–184): for every coalition C of size at most k and every real adversary A, there exists an ideal simulator S such that real.exec A t and idealExec g f C S t are within statistical distance ε (CloseTo) on every input profile t.

def Cslib.Crypto.Protocols.MPC.Malicious.ComputationallyMaliciousSecure {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] (g : OutputGuarantee) (k : ℕ) (real : ℕ → RealModel ι In Out) (f : OptFunctionality ι In Out) (AdvAdm : (C : Finset ι) → ((lam : ℕ) → (real lam).Adv C) → Prop) (SimAdm : (C : Finset ι) → (A : (lam : ℕ) → (real lam).Adv C) → ((lam : ℕ) → IdealSimulator g ι In Out C ((real lam).AdvOut (A lam))) → Prop) (DistAdm : (C : Finset ι) → (A : (lam : ℕ) → (real lam).Adv C) → ((lam : ℕ) → ExecutionOutcome ι Out C ((real lam).AdvOut (A lam)) → Game) → Prop) :

Computational malicious MPC security ([DR07], Section 8.1.1, Definition 8.1, pp. 184–185): vocabulary predicate for a security-parameterized protocol family real : ℕ → RealModel ι In Out against an admitted adversary-family class AdvAdm, simulator-family class SimAdm, and distinguisher-family class DistAdm. For every coalition C with C.card ≤ k and every admitted adversary family A, there exists an admitted simulator family S such that for every input profile t, the real and ideal transcript ensembles are Game.Indistinguishable against DistAdm.

Hierarchy and invariant theorems #

theorem Cslib.Crypto.Protocols.MPC.Malicious.PerfectMaliciousSecure.mono_threshold {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] {g : OutputGuarantee} {k₁ k₂ : ℕ} {real : RealModel ι In Out} {f : OptFunctionality ι In Out} (h : PerfectMaliciousSecure g k₂ real f) (hle : k₁ ≤ k₂) :

Perfect security is antitone in the corruption threshold k.

theorem Cslib.Crypto.Protocols.MPC.Malicious.StatisticallyMaliciousSecure.mono_threshold {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] {g : OutputGuarantee} {k₁ k₂ : ℕ} {ε : ENNReal} {real : RealModel ι In Out} {f : OptFunctionality ι In Out} (h : StatisticallyMaliciousSecure g k₂ ε real f) (hle : k₁ ≤ k₂) :

Statistical security is antitone in the corruption threshold k.

theorem Cslib.Crypto.Protocols.MPC.Malicious.StatisticallyMaliciousSecure.mono_error {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] {g : OutputGuarantee} {k : ℕ} {ε₁ ε₂ : ENNReal} {real : RealModel ι In Out} {f : OptFunctionality ι In Out} (h : StatisticallyMaliciousSecure g k ε₁ real f) (hle : ε₁ ≤ ε₂) :

Statistical security is monotone in the error bound ε.

theorem Cslib.Crypto.Protocols.MPC.Malicious.ComputationallyMaliciousSecure.mono_threshold {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] {g : OutputGuarantee} {k₁ k₂ : ℕ} {real : ℕ → RealModel ι In Out} {f : OptFunctionality ι In Out} {AdvAdm : (C : Finset ι) → ((lam : ℕ) → (real lam).Adv C) → Prop} {SimAdm : (C : Finset ι) → (A : (lam : ℕ) → (real lam).Adv C) → ((lam : ℕ) → IdealSimulator g ι In Out C ((real lam).AdvOut (A lam))) → Prop} {DistAdm : (C : Finset ι) → (A : (lam : ℕ) → (real lam).Adv C) → ((lam : ℕ) → ExecutionOutcome ι Out C ((real lam).AdvOut (A lam)) → Game) → Prop} (h : ComputationallyMaliciousSecure g k₂ real f AdvAdm SimAdm DistAdm) (hle : k₁ ≤ k₂) :
ComputationallyMaliciousSecure g k₁ real f AdvAdm SimAdm DistAdm

Computational security is antitone in the corruption threshold k.

Guaranteed output delivery implies fairness (perfect regime).

Fairness implies correctness and privacy without fairness (perfect regime).

Guaranteed output delivery implies fairness (statistical regime).

Fairness implies correctness and privacy without fairness (statistical regime).

theorem Cslib.Crypto.Protocols.MPC.Malicious.ComputationallyMaliciousSecure.fair_of_delivery {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] {k : ℕ} {real : ℕ → RealModel ι In Out} {f : OptFunctionality ι In Out} {AdvAdm : (C : Finset ι) → ((lam : ℕ) → (real lam).Adv C) → Prop} {SimAdmDeliv : (C : Finset ι) → (A : (lam : ℕ) → (real lam).Adv C) → ((lam : ℕ) → IdealSimulator OutputGuarantee.delivery ι In Out C ((real lam).AdvOut (A lam))) → Prop} {SimAdmFair : (C : Finset ι) → (A : (lam : ℕ) → (real lam).Adv C) → ((lam : ℕ) → IdealSimulator OutputGuarantee.fair ι In Out C ((real lam).AdvOut (A lam))) → Prop} {DistAdm : (C : Finset ι) → (A : (lam : ℕ) → (real lam).Adv C) → ((lam : ℕ) → ExecutionOutcome ι Out C ((real lam).AdvOut (A lam)) → Game) → Prop} (hSim : ∀ (C : Finset ι) (A : (lam : ℕ) → (real lam).Adv C) (S : (lam : ℕ) → IdealSimulator OutputGuarantee.delivery ι In Out C ((real lam).AdvOut (A lam))), SimAdmDeliv C A S → SimAdmFair C A fun (lam : ℕ) => DeliverySimulator.toFairSimulator (S lam)) (h : ComputationallyMaliciousSecure OutputGuarantee.delivery k real f AdvAdm SimAdmDeliv DistAdm) :
ComputationallyMaliciousSecure OutputGuarantee.fair k real f AdvAdm SimAdmFair DistAdm

Guaranteed output delivery implies fairness (computational regime), whenever simulator admissibility is preserved by DeliverySimulator.toFairSimulator.

theorem Cslib.Crypto.Protocols.MPC.Malicious.ComputationallyMaliciousSecure.withAbort_of_fair {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] {k : ℕ} {real : ℕ → RealModel ι In Out} {f : OptFunctionality ι In Out} {AdvAdm : (C : Finset ι) → ((lam : ℕ) → (real lam).Adv C) → Prop} {SimAdmFair : (C : Finset ι) → (A : (lam : ℕ) → (real lam).Adv C) → ((lam : ℕ) → IdealSimulator OutputGuarantee.fair ι In Out C ((real lam).AdvOut (A lam))) → Prop} {SimAdmAbort : (C : Finset ι) → (A : (lam : ℕ) → (real lam).Adv C) → ((lam : ℕ) → IdealSimulator OutputGuarantee.withAbort ι In Out C ((real lam).AdvOut (A lam))) → Prop} {DistAdm : (C : Finset ι) → (A : (lam : ℕ) → (real lam).Adv C) → ((lam : ℕ) → ExecutionOutcome ι Out C ((real lam).AdvOut (A lam)) → Game) → Prop} (hSim : ∀ (C : Finset ι) (A : (lam : ℕ) → (real lam).Adv C) (S : (lam : ℕ) → IdealSimulator OutputGuarantee.fair ι In Out C ((real lam).AdvOut (A lam))), SimAdmFair C A S → SimAdmAbort C A fun (lam : ℕ) => FairSimulator.toAbortSimulator (S lam)) (h : ComputationallyMaliciousSecure OutputGuarantee.fair k real f AdvAdm SimAdmFair DistAdm) :
ComputationallyMaliciousSecure OutputGuarantee.withAbort k real f AdvAdm SimAdmAbort DistAdm

Fairness implies correctness and privacy without fairness (computational regime), whenever simulator admissibility is preserved by FairSimulator.toAbortSimulator.

theorem Cslib.Crypto.Protocols.MPC.Malicious.PerfectMaliciousSecure.statisticallySecure {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] {g : OutputGuarantee} {k : ℕ} {real : RealModel ι In Out} {f : OptFunctionality ι In Out} (h : PerfectMaliciousSecure g k real f) :

Perfect security implies 0-statistical security.

0-statistical security coincides with perfect security.

theorem Cslib.Crypto.Protocols.MPC.Malicious.StatisticallyMaliciousSecure.computationallySecure {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] {g : OutputGuarantee} {k : ℕ} {real : ℕ → RealModel ι In Out} {f : OptFunctionality ι In Out} {ε : ℕ → NNReal} {AdvAdm : (C : Finset ι) → ((lam : ℕ) → (real lam).Adv C) → Prop} {DistAdm : (C : Finset ι) → (A : (lam : ℕ) → (real lam).Adv C) → ((lam : ℕ) → ExecutionOutcome ι Out C ((real lam).AdvOut (A lam)) → Game) → Prop} (hstat : ∀ (lam : ℕ), StatisticallyMaliciousSecure g k (↑(ε lam)) (real lam) f) (hneg : Negligible ε) :
ComputationallyMaliciousSecure g k real f AdvAdm (fun (x : Finset ι) (x_1 : (lam : ℕ) → (real lam).Adv x) (x_2 : (lam : ℕ) → IdealSimulator g ι In Out x ((real lam).AdvOut (x_1 lam))) => True) DistAdm

Statistical security with negligible error implies computational security (against unrestricted simulator and distinguisher admissibility classes).

theorem Cslib.Crypto.Protocols.MPC.Malicious.StatisticallyMaliciousSecure.prob_not_delivered_le {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] {k : ℕ} {ε : ENNReal} {real : RealModel ι In Out} {f : OptFunctionality ι In Out} (h : StatisticallyMaliciousSecure OutputGuarantee.delivery k ε real f) {C : Finset ι} (hC : C.card ≤ k) (A : real.Adv C) (t : (i : ι) → In i) :
(real.exec A t).toOuterMeasure {o : ExecutionOutcome ι Out C (real.AdvOut A) | ¬o.Delivered} ≤ ε

Under statistical output-delivery security with error ε, the real execution fails to deliver all honest outputs with probability at most ε.

theorem Cslib.Crypto.Protocols.MPC.Malicious.PerfectMaliciousSecure.delivered_of_mem_support {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] {k : ℕ} {real : RealModel ι In Out} {f : OptFunctionality ι In Out} (h : PerfectMaliciousSecure OutputGuarantee.delivery k real f) {C : Finset ι} (hC : C.card ≤ k) (A : real.Adv C) (t : (i : ι) → In i) {o : ExecutionOutcome ι Out C (real.AdvOut A)} (ho : o ∈ (real.exec A t).support) :

Under perfect output-delivery security, every outcome in the support of the real execution delivers outputs to all honest parties.

theorem Cslib.Crypto.Protocols.MPC.Malicious.StatisticallyMaliciousSecure.prob_unfair_le {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] {k : ℕ} {ε : ENNReal} {real : RealModel ι In Out} {f : OptFunctionality ι In Out} (h : StatisticallyMaliciousSecure OutputGuarantee.fair k ε real f) {C : Finset ι} (hC : C.card ≤ k) (A : real.Adv C) (t : (i : ι) → In i) :
(real.exec A t).toOuterMeasure {o : ExecutionOutcome ι Out C (real.AdvOut A) | ¬o.IsFair} ≤ ε

Under statistical fair security with error ε, the real execution produces an unfair (partially delivered / partially aborted) honest outcome with probability at most ε.

theorem Cslib.Crypto.Protocols.MPC.Malicious.PerfectMaliciousSecure.isFair_of_mem_support {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] {k : ℕ} {real : RealModel ι In Out} {f : OptFunctionality ι In Out} (h : PerfectMaliciousSecure OutputGuarantee.fair k real f) {C : Finset ι} (hC : C.card ≤ k) (A : real.Adv C) (t : (i : ι) → In i) {o : ExecutionOutcome ι Out C (real.AdvOut A)} (ho : o ∈ (real.exec A t).support) :

Under perfect fair security, every outcome in the support of the real execution satisfies all-or-nothing fairness (o.IsFair).

theorem Cslib.Crypto.Protocols.MPC.Malicious.PerfectMaliciousSecure.honestOut_eq_of_deterministic {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] {k : ℕ} {real : RealModel ι In Out} {f : ((i : ι) → Option (In i)) → (i : ι) → Out i} (h : PerfectMaliciousSecure OutputGuarantee.withAbort k real (OptFunctionality.ofDeterministic f)) {C : Finset ι} (hC : C.card ≤ k) (A : real.Adv C) (t : (i : ι) → In i) {o : ExecutionOutcome ι Out C (real.AdvOut A)} (ho : o ∈ (real.exec A t).support) :
∃ (t'C : (i : ↥C) → Option (In ↑i)), ∀ (i : ι) (hi : i ∉ C) (y : Out i), o.honestOut i hi = some y → y = f (patchOptInput C t t'C) i

Under perfect withAbort security for a deterministic functionality f, whenever any honest parties receive outputs in a supported real execution, all delivered honest outputs agree with f evaluated on honest inputs patched by a single effective coalition input t'C.

Detectable-abort fair MPC ([DR07], Section 8.4.2, p. 194) #

structure Cslib.Crypto.Protocols.MPC.Malicious.DetectableOutcome (ι : Type u) (Out : ι → Type u) (C : Finset ι) (AdvOut : Type u) :

Joint execution outcome for detectable-abort fair MPC ([DR07], Section 8.4.2, p. 194): augments ExecutionOutcome with blame : Option ι, identifying a deviating party when the protocol aborts without output (none on delivery).

  • outcome : ExecutionOutcome ι Out C AdvOut

    Underlying honest outputs and adversary output.

  • blame : Option ι

    Detected deviating party on abort (some p), or none on delivery.

theorem Cslib.Crypto.Protocols.MPC.Malicious.DetectableOutcome.ext_iff {ι : Type u} {Out : ι → Type u} {C : Finset ι} {AdvOut : Type u} {x y : DetectableOutcome ι Out C AdvOut} :
theorem Cslib.Crypto.Protocols.MPC.Malicious.DetectableOutcome.ext {ι : Type u} {Out : ι → Type u} {C : Finset ι} {AdvOut : Type u} {x y : DetectableOutcome ι Out C AdvOut} (outcome : x.outcome = y.outcome) (blame : x.blame = y.blame) :
x = y
structure Cslib.Crypto.Protocols.MPC.Malicious.DetectableFairModel (ι : Type u) (In Out : ι → Type u) :
Type (u + 1)

Real-world execution model for a fair MPC protocol with detectable abort.

  • Adv : Finset ι → Type u

    Admitted real-world adversaries controlling coalition C.

  • AdvOut {C : Finset ι} : self.Adv C → Type u

    Output type of adversary A.

  • exec {C : Finset ι} (A : self.Adv C) : ((i : ι) → In i) → PMF (DetectableOutcome ι Out C (self.AdvOut A))

    Real joint execution distribution including the detected cheater blame.

noncomputable def Cslib.Crypto.Protocols.MPC.Malicious.DetectableFairModel.toRealModel {ι : Type u} {In Out : ι → Type u} (real : DetectableFairModel ι In Out) :
RealModel ι In Out

Forget the blame field to view a DetectableFairModel as an ordinary RealModel.

structure Cslib.Crypto.Protocols.MPC.Malicious.DetectableFairSimulator (ι : Type u) (In Out : ι → Type u) (C : Finset ι) (AdvOut : Type u) :
Type (u + 1)

Ideal-world simulator for detectable-abort fair MPC: on early abort, the simulator must designate a blamed cheater p : C (necessarily inside the corrupted coalition C, so no honest party is ever blamed); on delivery, blame = none.

  • AbortState : Type u

    Simulator internal state carried into the early-abort branch.

  • DeliverState : Type u

    Simulator internal state carried into the delivery branch.

  • chooseAction : ((i : ↥C) → In ↑i) → PMF (↥C × self.AbortState ⊕ ((i : ↥C) → Option (In ↑i)) × self.DeliverState)

    Either abort before evaluation and blame a member p : C (Sum.inl (p, sa)), or submit effective coalition inputs (Sum.inr (t'C, sd)).

  • finishAbort : self.AbortState → PMF AdvOut

    Produce simulated adversary output on early abort.

  • finishDeliver : self.DeliverState → ((i : ↥C) → Out ↑i) → PMF AdvOut

    Produce simulated adversary output on delivery.

noncomputable def Cslib.Crypto.Protocols.MPC.Malicious.idealFairDetectable {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] (f : OptFunctionality ι In Out) (C : Finset ι) {AdvOut : Type u} (S : DetectableFairSimulator ι In Out C AdvOut) (t : (i : ι) → In i) :
PMF (DetectableOutcome ι Out C AdvOut)

Ideal execution for detectable-abort fair MPC.

noncomputable def Cslib.Crypto.Protocols.MPC.Malicious.DetectableFairSimulator.toFairSimulator {ι : Type u} {In Out : ι → Type u} {C : Finset ι} {AdvOut : Type u} (S : DetectableFairSimulator ι In Out C AdvOut) :
FairSimulator ι In Out C AdvOut

Forget blame to obtain an ordinary FairSimulator from a DetectableFairSimulator.

theorem Cslib.Crypto.Protocols.MPC.Malicious.map_outcome_idealFairDetectable {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] (f : OptFunctionality ι In Out) (C : Finset ι) {AdvOut : Type u} (S : DetectableFairSimulator ι In Out C AdvOut) (t : (i : ι) → In i) :
def Cslib.Crypto.Protocols.MPC.Malicious.PerfectDetectableFairSecure {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] (k : ℕ) (real : DetectableFairModel ι In Out) (f : OptFunctionality ι In Out) :

Perfect security for detectable-abort fair MPC.

def Cslib.Crypto.Protocols.MPC.Malicious.StatisticallyDetectableFairSecure {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] (k : ℕ) (ε : ENNReal) (real : DetectableFairModel ι In Out) (f : OptFunctionality ι In Out) :

Statistical security for detectable-abort fair MPC.

def Cslib.Crypto.Protocols.MPC.Malicious.ComputationallyDetectableFairSecure {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] (k : ℕ) (real : ℕ → DetectableFairModel ι In Out) (f : OptFunctionality ι In Out) (AdvAdm : (C : Finset ι) → ((lam : ℕ) → (real lam).Adv C) → Prop) (SimAdm : (C : Finset ι) → (A : (lam : ℕ) → (real lam).Adv C) → ((lam : ℕ) → DetectableFairSimulator ι In Out C ((real lam).AdvOut (A lam))) → Prop) (DistAdm : (C : Finset ι) → (A : (lam : ℕ) → (real lam).Adv C) → ((lam : ℕ) → DetectableOutcome ι Out C ((real lam).AdvOut (A lam)) → Game) → Prop) :

Computational security for detectable-abort fair MPC (vocabulary predicate).

theorem Cslib.Crypto.Protocols.MPC.Malicious.delivered_or_blame_mem_of_mem_support_idealFairDetectable {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] {f : OptFunctionality ι In Out} {C : Finset ι} {AdvOut : Type u} {S : DetectableFairSimulator ι In Out C AdvOut} {t : (i : ι) → In i} {d : DetectableOutcome ι Out C AdvOut} (hd : d ∈ (idealFairDetectable f C S t).support) :

Every supported outcome of idealFairDetectable either delivers all honest outputs with blame = none, or aborts all honest outputs while blaming a member p ∈ C.

theorem Cslib.Crypto.Protocols.MPC.Malicious.PerfectDetectableFairSecure.blame_mem_of_some {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] {k : ℕ} {real : DetectableFairModel ι In Out} {f : OptFunctionality ι In Out} (h : PerfectDetectableFairSecure k real f) {C : Finset ι} (hC : C.card ≤ k) (A : real.Adv C) (t : (i : ι) → In i) {d : DetectableOutcome ι Out C (real.AdvOut A)} (hd : d ∈ (real.exec A t).support) {p : ι} (hp : d.blame = some p) :
p ∈ C

Under perfect detectable-abort fair security, whenever an execution aborts (and at least one honest party exists, or simply whenever d.blame is set), a member p ∈ C is blamed; no honest party is ever falsely accused.

theorem Cslib.Crypto.Protocols.MPC.Malicious.PerfectDetectableFairSecure.blame_mem_of_aborted {ι : Type u} {In Out : ι → Type u} [DecidableEq ι] {k : ℕ} {real : DetectableFairModel ι In Out} {f : OptFunctionality ι In Out} (h : PerfectDetectableFairSecure k real f) {C : Finset ι} (hC : C.card ≤ k) (A : real.Adv C) (t : (i : ι) → In i) {d : DetectableOutcome ι Out C (real.AdvOut A)} (hd : d ∈ (real.exec A t).support) {i : ι} (hi : i ∉ C) (hnone : d.outcome.honestOut i hi = none) :
∃ p ∈ C, d.blame = some p

Under perfect detectable-abort fair security, if i ∉ C receives none, then some member p ∈ C is blamed (d.blame = some p).

Forgetting blame turns perfect detectable-abort fair security into ordinary perfect fair security.

Forgetting blame turns statistical detectable-abort fair security into ordinary statistical fair security.

Bridge from semi-honest MPC.Protocol (Basic.lean) #

noncomputable def Cslib.Crypto.Protocols.MPC.Malicious.Protocol.toPassiveRealModel {m : ℕ} {spec : MultiOracleSpec} {sc : Schedule m spec} {In Coins Out : Fin m → Type} (proto : Protocol m spec sc In Coins Out) (W : MultiOracleWorld spec) :
RealModel (Fin m) In Out

Embed any synchronous m-party Protocol from CslibFrontier.Crypto.Protocols.MPC.Basic into RealModel for passive (semi-honest) adversaries: for every coalition C, the unique passive adversary (PUnit) executes proto honestly and outputs the coalition's joint views.

theorem Cslib.Crypto.Protocols.MPC.Malicious.PerfectSemiHonestPrivateLe.toPerfectMaliciousSecure {m : ℕ} {spec : MultiOracleSpec} {sc : Schedule m spec} {In Coins Out : Fin m → Type} {k : ℕ} {proto : Protocol m spec sc In Coins Out} {W : MultiOracleWorld spec} {f : Functionality m In Out} {S : (I : Finset (Fin m)) → CoalitionSimulator sc In Coins Out I} (h : PerfectSemiHonestPrivateLe k proto W f S) (defaultIn : (i : Fin m) → In i) :

Passive bridge from PerfectSemiHonestPrivateLe: every k-threshold perfectly private semi-honest Protocol (such as BGW.bgwSumProtocol or CircuitEval's GMW protocol) satisfies PerfectMaliciousSecure .delivery k in its passive RealModel against OptFunctionality.ofTotalFunctionality defaultIn f.