Documentation

CslibFrontier.Crypto.Protocols.UC.JointState

Universal composition with joint state (step theorems and lazy multi-session functionality) #

This module defines the named data structures (SubSessionInput, SubSessionBackdoor, MultiSessionState), the lazy multi-session extension IdealFunctionality.multiSession (F̂), the sub-session relabelling MultiHybridProtocol.toJoint, the explicit demultiplexing and multiplexing adversaries jointDemux and jointMux, and the fixed-session step theorems EmulatesWithin.toJoint_multiSession and EmulatesWithin.multiSession_toJoint for this library's call-bounded, static-corruption port-model emulation notions (UC.EmulatesWithin, UC.Emulates, UC.Realizes).

These form the relabelling and execution-equivalence steps toward Theorem 1 (Universal Composition with Joint State) of [CR03] (CRYPTO 2003, LNCS 2729: §3, "The Composition Operation"; §3, "The Multi-session Extension of an Ideal Functionality"; Theorem 1; and the proof of Theorem 1, definition of π̃), adapted to a fixed finite session count m, static corruptions, pull-only execution, and this library's call-bounded statistical model (see Cslib.Crypto.Protocols.UC.Emulates for the call-budget model vs. PPT ITMs).

The generic lazy-vs-eager parallel-package initialization theorem (SSP.parFinLazy, SSP.run_parFinLazy_eq_parFin) lives separately in CslibFrontier.Crypto.Protocols.SSP.ParFinLazy (SSP.Basic supplies UC.Machine via UC.Linking), so SSP callers can import the bridge without importing the UC ideal-functionality or execution modules.

Modelling decisions and differences from [CR03] #

  1. Named structures (zero projection chains). SubSessionInput, SubSessionBackdoor, and MultiSessionState replace raw nested products and options.
  2. Lazy multi-session extensions F.multiSession and F.multiSessionProtocol ([CR03], §3, "The Multi-session Extension of an Ideal Functionality"). For any [DecidableEq SSID], IdealFunctionality.multiSession SSID F stores (secParam, corrupted, sessions) and creates a fresh copy of F with F.init secParam corrupted on the first party input or backdoor query for a given ssid, keeping distinct ssids independent. Because Machine.IsBounded quantifies over all states (including unreachable ones with arbitrary secParam) while Protocol.PolyBounded evaluates at the outer κ, (F.multiSession SSID).toProtocol need not be PolyBounded even when F.toProtocol is. IdealFunctionality.multiSessionProtocol SSID F captures κ and C at machine construction instead of in state, preserving polynomial call budgets (2 * pF) while matching (F.multiSession SSID).toProtocol in every UC execution.
  3. Pull-model interface and scheduling differences. In [CR03], §3, "The Multi-session Extension of an Ideal Functionality", whenever a copy of F sends (ssid, v) to some party Pi, F̂ sends (sid, ssid, v) to Pi and sends ssid to the adversary. Here, IdealFunctionality.multiSession returns an untagged Option SubOut on the selected pull query SubSessionInput SSID SubIn, and provides an explicitly queried backdoor interface (SubSessionBackdoor SSID BackQ) returning BackR (adding no automatic raw-state port) rather than sending adversary notifications on honest-party activations or outputs. Because the interfaces, scheduling, and call-bounded vs. PPT ITM resource models differ, no implication between Realizes for this pull API and the source premise is claimed here.
  4. Sub-session relabelling toJoint and fixed m. MultiHybridProtocol.toJoint relabels each SubSessionCall ⟨session, party, input⟩ as (party, ⟨session, input⟩) (adapting [CR03], §3, "The Composition Operation", and the proof of Theorem 1, definition of π̃, to a fixed finite Fin m family; dynamic SID creation and push-model tagged outputs / ssid notifications are out of scope).
  5. Explicit demux/mux adversaries under static corruption. jointDemux and jointMux translate network queries between the single-protocol F̂-hybrid interface and the m-session composeMulti interface while preserving replies (NetR ⊕ RoutedNetR SubOut BackR). Static corruptions C : Finset (Fin n) are shared across ρ, all copies of F, and ρ̂, so corrupted-party internal state translation ([CR03], item 3 of the proof of Theorem 1) is unneeded.
  6. Lazy-vs-eager equivalence via SSP.ParFinLazy. The proof of exec_compose_toJoint_multiSession uses SSP.run_parFinLazy_eq_parFin from CslibFrontier.Crypto.Protocols.SSP.ParFinLazy to bridge lazy first-touch initialization and eager SSP.parFin sampling.
  7. Scope and joint state vs. global setup. Joint state here is internal to a single subroutine protocol ρ̂, not a GUC/EUC global setup shared outside ρ̂. Structural isolation and unrestricted compliance hold by types (OracleSpec.empty closed machines and SubSessionCall).

Main definitions #

Main results #

References #

Named structures and lazy multi-session functionality #

A party input to a multi-session functionality or joint-state protocol: sub-session ssid with value input ([CR03], §3, "The Multi-session Extension of an Ideal Functionality", the (ssid, v) part of (sid, ssid, v)).

  • ssid : SSID

    Sub-session identifier.

  • input : SubIn

    Party input (or poll token) for sub-session ssid.

@[instance_reducible]
instance Cslib.Crypto.Protocols.UC.instDecidableEqSubSessionInput {SSID✝ SubIn✝ : Type} [DecidableEq SSID✝] [DecidableEq SubIn✝] :
DecidableEq (SubSessionInput SSID✝ SubIn✝)
def Cslib.Crypto.Protocols.UC.instDecidableEqSubSessionInput.decEq {SSID✝ SubIn✝ : Type} [DecidableEq SSID✝] [DecidableEq SubIn✝] (x✝ x✝¹ : SubSessionInput SSID✝ SubIn✝) :
Decidable (x✝ = x✝¹)

An adversary backdoor query to copy ssid of the multi-session functionality.

  • ssid : SSID

    Target sub-session identifier.

  • query : BackQ

    Backdoor query for sub-session ssid.

@[instance_reducible]
instance Cslib.Crypto.Protocols.UC.instDecidableEqSubSessionBackdoor {SSID✝ BackQ✝ : Type} [DecidableEq SSID✝] [DecidableEq BackQ✝] :
DecidableEq (SubSessionBackdoor SSID✝ BackQ✝)
def Cslib.Crypto.Protocols.UC.instDecidableEqSubSessionBackdoor.decEq {SSID✝ BackQ✝ : Type} [DecidableEq SSID✝] [DecidableEq BackQ✝] (x✝ x✝¹ : SubSessionBackdoor SSID✝ BackQ✝) :
Decidable (x✝ = x✝¹)
structure Cslib.Crypto.Protocols.UC.MultiSessionState (n : ℕ) (SSID FState : Type) :

State of F.multiSession: the security parameter and corrupted set recorded at invocation (so that copies can be created later) and the lazily created copies.

  • secParam : ℕ

    Security parameter fixed at functionality invocation.

  • corrupted : Finset (Fin n)

    Static corruption set fixed at functionality invocation.

  • sessions : SSID → Option FState

    Lazily initialized per-session states (none until first message).

def Cslib.Crypto.Protocols.UC.lazySessionStep {SSID FState S α : Type} [DecidableEq SSID] (init : ProbComp FState) (step : StateT FState ProbComp α) (ssid : SSID) (sessions : SSID → Option FState) (wrap : (SSID → Option FState) → S) :
ProbComp (α × S)

Single lazy session-table activation step: looks up ssid in sessions, initializes a fresh session via init on a miss, runs step on that session's state, and wraps the updated session table via wrap. Shared by IdealFunctionality.multiSession and IdealFunctionality.multiSessionProtocol.

theorem Cslib.Crypto.Protocols.UC.lazySessionStep_isQueryBounded {SSID FState S α : Type} [DecidableEq SSID] {init : ProbComp FState} {step : StateT FState ProbComp α} {t : ℕ} (hInit : OracleComp.IsQueryBounded init t) (hStep : ∀ (fState : FState), OracleComp.IsQueryBounded (step.run fState) t) (ssid : SSID) (sessions : SSID → Option FState) (wrap : (SSID → Option FState) → S) :
OracleComp.IsQueryBounded (lazySessionStep init step ssid sessions wrap) (2 * t)

Query-budget preservation for lazySessionStep: at most t calls for lazy initialization on a miss plus at most t calls for step.

def Cslib.Crypto.Protocols.UC.IdealFunctionality.multiSession {n : ℕ} {SubIn SubOut BackQ BackR : Type} (SSID : Type) [DecidableEq SSID] (F : IdealFunctionality n SubIn SubOut BackQ BackR) :
IdealFunctionality n (SubSessionInput SSID SubIn) SubOut (SubSessionBackdoor SSID BackQ) BackR

Multi-session extension F̂ of an ideal functionality F for any [DecidableEq SSID]: creates a fresh copy of F with F.init secParam corrupted on the first party input or backdoor query for ssid, and activates that copy ([CR03], §3, "The Multi-session Extension of an Ideal Functionality"). Unlike the source's F̂ (which sends (sid, ssid, v) to Pi and sends ssid to the adversary when a copy sends (ssid, v)), this pull API returns an untagged Option SubOut on the selected pull and provides an explicitly queried backdoor interface (SubSessionBackdoor SSID BackQ) returning BackR, adding no automatic raw-state port.

Because MultiSessionState stores secParam in state while Machine.IsBounded quantifies over all states (including unreachable ones with arbitrary secParam), (F.multiSession SSID).toProtocol need not satisfy Protocol.PolyBounded even when F.toProtocol does. Callers requiring a Protocol.PolyBounded multi-session extension (for instance in nested composeMulti) should use IdealFunctionality.multiSessionProtocol.

def Cslib.Crypto.Protocols.UC.IdealFunctionality.multiSessionProtocol {n : ℕ} {SubIn SubOut BackQ BackR : Type} (SSID : Type) [DecidableEq SSID] (F : IdealFunctionality n SubIn SubOut BackQ BackR) :
Protocol n (SubSessionInput SSID SubIn) SubOut (SubSessionBackdoor SSID BackQ) BackR

Budget-preserving protocol-level lazy multi-session extension of F for any [DecidableEq SSID]: captures the security parameter κ and static corruption set C at machine construction rather than storing them in state, calling F.init κ C directly on first touch of each ssid and storing only the session table SSID → Option F.State. Preserves polynomial call budgets (IdealFunctionality.multiSessionProtocol_polyBounded) and agrees in every UC execution with (F.multiSession SSID).toProtocol (exec_multiSessionProtocol_eq).

theorem Cslib.Crypto.Protocols.UC.IdealFunctionality.multiSession_polyBounded_of_zero {n : ℕ} {SubIn SubOut BackQ BackR : Type} (SSID : Type) [DecidableEq SSID] {F : IdealFunctionality n SubIn SubOut BackQ BackR} (hF : F.toProtocol.PolyBounded 0) :

Any 0-bounded ideal functionality's lazy multi-session extension (F.multiSession SSID) has polynomial call budget 0 (the uniform zero bound on F.toProtocol applies at every stored s.secParam and s.corrupted).

theorem Cslib.Crypto.Protocols.UC.IdealFunctionality.multiSessionProtocol_isBounded {n : ℕ} {SubIn SubOut BackQ BackR : Type} (SSID : Type) [DecidableEq SSID] {F : IdealFunctionality n SubIn SubOut BackQ BackR} {κ t : ℕ} {C : Finset (Fin n)} (hF : (F.toProtocol κ C).IsBounded t) :
(multiSessionProtocol SSID F κ C).IsBounded (2 * t)

Every activation of F.multiSessionProtocol SSID κ C makes at most 2 * t calls whenever F.toProtocol κ C has per-activation budget t (at most t for lazy F.init κ C on first touch plus at most t for the delegated handler).

theorem Cslib.Crypto.Protocols.UC.IdealFunctionality.multiSessionProtocol_polyBounded {n : ℕ} {SubIn SubOut BackQ BackR : Type} (SSID : Type) [DecidableEq SSID] {F : IdealFunctionality n SubIn SubOut BackQ BackR} {pF : Polynomial ℕ} (hF : F.toProtocol.PolyBounded pF) :

Protocol-level lazy multi-session extension preserves polynomial call budgets with factor 2: if F.toProtocol has budget pF, then F.multiSessionProtocol SSID has budget 2 * pF.

Sub-session relabelling and explicit demux/mux adversaries #

def Cslib.Crypto.Protocols.UC.MultiHybridProtocol.toJoint {m n : ℕ} {In Out NetQ NetR SubIn SubOut : Type} (ρ : MultiHybridProtocol m n In Out NetQ NetR SubIn SubOut) :
HybridProtocol n In Out NetQ NetR (SubSessionInput (Fin m) SubIn) SubOut

Relabel a multi-session hybrid protocol ρ (SubSessionCall subroutine calls) to a single-subroutine HybridProtocol targeting F.multiSession (Fin m) ([CR03], §3, "The Composition Operation", and the proof of Theorem 1, definition of π̃).

theorem Cslib.Crypto.Protocols.UC.toJoint_polyBounded {m n : ℕ} {In Out NetQ NetR SubIn SubOut : Type} {ρ : MultiHybridProtocol m n In Out NetQ NetR SubIn SubOut} {pρ : Polynomial ℕ} (hρ : ρ.PolyBounded pρ) :

Library infrastructure (no cited result): relabelling ρ via toJoint preserves its polynomial call budget pρ unchanged.

def Cslib.Crypto.Protocols.UC.demuxNetQuery {m n : ℕ} {In NetQ SubIn BackQ : Type} :
RoutedNetQ n In (NetQ ⊕ RoutedNetQ n (SubSessionInput (Fin m) SubIn) (SubSessionBackdoor (Fin m) BackQ)) → RoutedNetQ n In (MultiNetQ m NetQ (RoutedNetQ n SubIn BackQ))

Library construction (no cited definition): translate a network query of the F̂-hybrid execution (compose ρ.toJoint F̂) to the corresponding network query of the m-session execution (composeMulti ρ F.toProtocol), keeping replies identical.

def Cslib.Crypto.Protocols.UC.muxNetQuery {m n : ℕ} {In NetQ SubIn BackQ : Type} :
RoutedNetQ n In (MultiNetQ m NetQ (RoutedNetQ n SubIn BackQ)) → RoutedNetQ n In (NetQ ⊕ RoutedNetQ n (SubSessionInput (Fin m) SubIn) (SubSessionBackdoor (Fin m) BackQ))

Library construction (no cited definition): inverse network query translation from the m-session interface (composeMulti ρ F.toProtocol) to the F̂-hybrid interface (compose ρ.toJoint F̂).

def Cslib.Crypto.Protocols.UC.jointDemux {m n : ℕ} {In Out NetQ NetR SubIn SubOut BackQ BackR AdvQ AdvR : Type} (A : ExecAdversary n In Out (NetQ ⊕ RoutedNetQ n (SubSessionInput (Fin m) SubIn) (SubSessionBackdoor (Fin m) BackQ)) (NetR ⊕ RoutedNetR SubOut BackR) AdvQ AdvR) :
ExecAdversary n In Out (MultiNetQ m NetQ (RoutedNetQ n SubIn BackQ)) (NetR ⊕ RoutedNetR SubOut BackR) AdvQ AdvR

Library construction (no cited result): explicit demultiplexing adversary for compose ρ.toJoint (F.multiSession (Fin m)).toProtocol running against composeMulti ρ F.toProtocol ([CR03], §3, "The Composition Operation", and the proof of Theorem 1).

def Cslib.Crypto.Protocols.UC.jointMux {m n : ℕ} {In Out NetQ NetR SubIn SubOut BackQ BackR AdvQ AdvR : Type} (A : ExecAdversary n In Out (MultiNetQ m NetQ (RoutedNetQ n SubIn BackQ)) (NetR ⊕ RoutedNetR SubOut BackR) AdvQ AdvR) :
ExecAdversary n In Out (NetQ ⊕ RoutedNetQ n (SubSessionInput (Fin m) SubIn) (SubSessionBackdoor (Fin m) BackQ)) (NetR ⊕ RoutedNetR SubOut BackR) AdvQ AdvR

Library construction (no cited result): explicit multiplexing adversary in the reverse direction, mapping composeMulti ρ F.toProtocol queries to compose ρ.toJoint (F.multiSession (Fin m)).toProtocol.

theorem Cslib.Crypto.Protocols.UC.jointDemux_polyBounded {m n : ℕ} {In Out NetQ NetR SubIn SubOut BackQ BackR AdvQ AdvR : Type} {A : ExecAdversary n In Out (NetQ ⊕ RoutedNetQ n (SubSessionInput (Fin m) SubIn) (SubSessionBackdoor (Fin m) BackQ)) (NetR ⊕ RoutedNetR SubOut BackR) AdvQ AdvR} {pA : Polynomial ℕ} (hA : Adversary.PolyBounded A pA) :

Library infrastructure (no cited result): jointDemux A preserves A's polynomial call budget pA.

theorem Cslib.Crypto.Protocols.UC.jointMux_polyBounded {m n : ℕ} {In Out NetQ NetR SubIn SubOut BackQ BackR AdvQ AdvR : Type} {A : ExecAdversary n In Out (MultiNetQ m NetQ (RoutedNetQ n SubIn BackQ)) (NetR ⊕ RoutedNetR SubOut BackR) AdvQ AdvR} {pA : Polynomial ℕ} (hA : Adversary.PolyBounded A pA) :

Library infrastructure (no cited result): jointMux A preserves A's polynomial call budget pA.

Execution identities and concrete step theorems #

theorem Cslib.Crypto.Protocols.UC.exec_compose_toJoint_multiSession {m n : ℕ} {In Out NetQ NetR SubIn SubOut BackQ BackR AdvQ AdvR : Type} (ρ : MultiHybridProtocol m n In Out NetQ NetR SubIn SubOut) (F : IdealFunctionality n SubIn SubOut BackQ BackR) (A : ExecAdversary n In Out (NetQ ⊕ RoutedNetQ n (SubSessionInput (Fin m) SubIn) (SubSessionBackdoor (Fin m) BackQ)) (NetR ⊕ RoutedNetR SubOut BackR) AdvQ AdvR) (C : Finset (Fin n)) (Z : Environment n In Out AdvQ AdvR) (κ : ℕ) (z : List Bool) :

A step of the proof of Theorem 1 of [CR03] (the step showing that "protocol π̃ in the F̂-hybrid model emulates protocol π in the F-hybrid model"), not that theorem; fixed-session joint-state execution identity for this library's call-bounded UC execution model: compose ρ.toJoint (F.multiSession (Fin m)).toProtocol with adversary A and composeMulti ρ F.toProtocol with jointDemux A have identical output distributions.

theorem Cslib.Crypto.Protocols.UC.exec_composeMulti_toJoint {m n : ℕ} {In Out NetQ NetR SubIn SubOut BackQ BackR AdvQ AdvR : Type} (ρ : MultiHybridProtocol m n In Out NetQ NetR SubIn SubOut) (F : IdealFunctionality n SubIn SubOut BackQ BackR) (A : ExecAdversary n In Out (MultiNetQ m NetQ (RoutedNetQ n SubIn BackQ)) (NetR ⊕ RoutedNetR SubOut BackR) AdvQ AdvR) (C : Finset (Fin n)) (Z : Environment n In Out AdvQ AdvR) (κ : ℕ) (z : List Bool) :

A step of the proof of Theorem 1 of [CR03] (the step showing that "protocol π̃ in the F̂-hybrid model emulates protocol π in the F-hybrid model"), not that theorem; fixed-session reverse joint-state execution identity for this library's call-bounded UC execution model: composeMulti ρ F.toProtocol with adversary A and compose ρ.toJoint (F.multiSession (Fin m)).toProtocol with jointMux A have identical output distributions.

theorem Cslib.Crypto.Protocols.UC.EmulatesWithin.toJoint_multiSession {m n : ℕ} {In Out NetQ NetR SubIn SubOut BackQ BackR : Type} (ρ : MultiHybridProtocol m n In Out NetQ NetR SubIn SubOut) (F : IdealFunctionality n SubIn SubOut BackQ BackR) :

A step of the proof of Theorem 1 of [CR03] (the step showing that "protocol π̃ in the F̂-hybrid model emulates protocol π in the F-hybrid model"), not that theorem; fixed-session joint-state step for this library's call-bounded EmulatesWithin relation: compose ρ.toJoint (F.multiSession (Fin m)).toProtocol emulates composeMulti ρ F.toProtocol with overhead Polynomial.X and zero distinguishing error via the explicit demultiplexing adversary jointDemux. Fixed number m of sessions chosen in advance; static corruption; pull execution returning untagged Option SubOut with explicit SubSessionBackdoor queries.

theorem Cslib.Crypto.Protocols.UC.EmulatesWithin.multiSession_toJoint {m n : ℕ} {In Out NetQ NetR SubIn SubOut BackQ BackR : Type} (ρ : MultiHybridProtocol m n In Out NetQ NetR SubIn SubOut) (F : IdealFunctionality n SubIn SubOut BackQ BackR) :

A step of the proof of Theorem 1 of [CR03] (the step showing that "protocol π̃ in the F̂-hybrid model emulates protocol π in the F-hybrid model"), not that theorem; fixed-session reverse joint-state step for this library's call-bounded EmulatesWithin relation: composeMulti ρ F.toProtocol emulates compose ρ.toJoint (F.multiSession (Fin m)).toProtocol with overhead Polynomial.X and zero distinguishing error via jointMux. Fixed number m of sessions chosen in advance; static corruption; pull execution returning untagged Option SubOut with explicit SubSessionBackdoor queries.

theorem Cslib.Crypto.Protocols.UC.Realizes.compose_toJoint {m n : ℕ} {In Out NetQ NetR SubIn SubOut BackQ BackR NQ NR : Type} {ρ : MultiHybridProtocol m n In Out NetQ NetR SubIn SubOut} {F : IdealFunctionality n SubIn SubOut BackQ BackR} {ρHat : Protocol n (SubSessionInput (Fin m) SubIn) SubOut NQ NR} {pρ : Polynomial ℕ} (hρ : ρ.PolyBounded pρ) (h : Realizes ρHat (IdealFunctionality.multiSession (Fin m) F)) :

Fixed-session joint-state replacement step in this library's call-bounded statistical Realizes model (a step toward Theorem 1 of [CR03], not that theorem): for a fixed number m of sessions, static corruptions, and pull execution, if ρHat realizes the multi-session extension F.multiSession (Fin m), then the joint-state protocol compose ρ.toJoint ρHat emulates the m-session F-hybrid protocol composeMulti ρ F.toProtocol.

theorem Cslib.Crypto.Protocols.UC.Realizes.compose_toJoint_trans {m n : ℕ} {In Out NetQ NetR SubIn SubOut BackQ BackR NQ NR GQ GR : Type} {ρ : MultiHybridProtocol m n In Out NetQ NetR SubIn SubOut} {F : IdealFunctionality n SubIn SubOut BackQ BackR} {G : IdealFunctionality n In Out GQ GR} {ρHat : Protocol n (SubSessionInput (Fin m) SubIn) SubOut NQ NR} {pρ : Polynomial ℕ} (hρ : ρ.PolyBounded pρ) (h : Realizes ρHat (IdealFunctionality.multiSession (Fin m) F)) (hρG : Realizes (UC.composeMulti ρ F.toProtocol) G) :

Fixed-session modular joint-state realization step in this library's call-bounded statistical Realizes model (a step toward Theorem 1 of [CR03], not that theorem): for a fixed number m of sessions, static corruptions, and pull execution, if ρHat realizes F.multiSession (Fin m) and composeMulti ρ F.toProtocol realizes G, then the joint-state protocol compose ρ.toJoint ρHat realizes G.

theorem Cslib.Crypto.Protocols.UC.RealizesWithin.compose_toJoint {m n : ℕ} {In Out NetQ NetR SubIn SubOut BackQ BackR NQ NR : Type} {ρ : MultiHybridProtocol m n In Out NetQ NetR SubIn SubOut} {F : IdealFunctionality n SubIn SubOut BackQ BackR} {ρHat : Protocol n (SubSessionInput (Fin m) SubIn) SubOut NQ NR} {pρ g : Polynomial ℕ} {ε : Polynomial ℕ → Polynomial ℕ → ℕ → NNReal} (hρ : ρ.PolyBounded pρ) (h : RealizesWithin ρHat (IdealFunctionality.multiSession (Fin m) F) g ε) :

Concrete fixed-session joint-state replacement step in this library's call-bounded RealizesWithin model (a step toward Theorem 1 of [CR03], not that theorem): for a fixed number m of sessions, static corruptions, and pull execution, if ρHat realizes F.multiSession (Fin m) with overhead g and error ε, then compose ρ.toJoint ρHat emulates composeMulti ρ F.toProtocol with the overhead and error below.

theorem Cslib.Crypto.Protocols.UC.Realizes.composeMulti_toJoint {m n : ℕ} {In Out NetQ NetR SubIn SubOut NQ NR BackQ BackR : Type} {ρ : MultiHybridProtocol m n In Out NetQ NetR SubIn SubOut} {π : Protocol n SubIn SubOut NQ NR} {F : IdealFunctionality n SubIn SubOut BackQ BackR} {pρ pπ pF : Polynomial ℕ} (hρ : ρ.PolyBounded pρ) (hπ : π.PolyBounded pπ) (hF : F.toProtocol.PolyBounded pF) (h : Realizes π F) :

Reverse fixed-session joint-state composition step in this library's call-bounded statistical Realizes model (a step toward Theorem 1 of [CR03], not that theorem): for a fixed number m of sessions, static corruptions, and pull execution, if π realizes F, then the m-session protocol composeMulti ρ π emulates the F.multiSession (Fin m)-hybrid protocol compose ρ.toJoint (F.multiSession (Fin m)).toProtocol.

Budget-preserving multi-session protocol execution and emulation #

theorem Cslib.Crypto.Protocols.UC.exec_multiSessionProtocol_eq {n : ℕ} {SubIn SubOut BackQ BackR AdvQ AdvR : Type} (SSID : Type) [DecidableEq SSID] (F : IdealFunctionality n SubIn SubOut BackQ BackR) (A : ExecAdversary n (SubSessionInput SSID SubIn) SubOut (SubSessionBackdoor SSID BackQ) BackR AdvQ AdvR) (C : Finset (Fin n)) (Z : Environment n (SubSessionInput SSID SubIn) SubOut AdvQ AdvR) (κ : ℕ) (z : List Bool) :

Exact UC execution agreement between the budget-preserving protocol F.multiSessionProtocol SSID and (F.multiSession SSID).toProtocol for every adversary, corruption set, environment, security parameter, and auxiliary input.

theorem Cslib.Crypto.Protocols.UC.EmulatesWithin.multiSessionProtocol_right_iff {n : ℕ} {SubIn SubOut BackQ BackR NQ NR : Type} (SSID : Type) [DecidableEq SSID] {π : Protocol n (SubSessionInput SSID SubIn) SubOut NQ NR} {F : IdealFunctionality n SubIn SubOut BackQ BackR} {g : Polynomial ℕ} {ε : Polynomial ℕ → Polynomial ℕ → ℕ → NNReal} :

Concrete UC emulation of F.multiSessionProtocol SSID is equivalent to concrete UC realization of F.multiSession SSID with the exact same simulator overhead and error bound.

theorem Cslib.Crypto.Protocols.UC.EmulatesWithin.multiSessionProtocol_left_iff {n : ℕ} {SubIn SubOut BackQ BackR NQ NR : Type} (SSID : Type) [DecidableEq SSID] {F : IdealFunctionality n SubIn SubOut BackQ BackR} {φ : Protocol n (SubSessionInput SSID SubIn) SubOut NQ NR} {g : Polynomial ℕ} {ε : Polynomial ℕ → Polynomial ℕ → ℕ → NNReal} :

Concrete UC emulation by F.multiSessionProtocol SSID is equivalent to concrete UC emulation by (F.multiSession SSID).toProtocol with the exact same overhead and error bound.

theorem Cslib.Crypto.Protocols.UC.exec_compose_toJoint_multiSessionProtocol {m n : ℕ} {In Out NetQ NetR SubIn SubOut BackQ BackR AdvQ AdvR : Type} (ρ : MultiHybridProtocol m n In Out NetQ NetR SubIn SubOut) (F : IdealFunctionality n SubIn SubOut BackQ BackR) (A : ExecAdversary n In Out (NetQ ⊕ RoutedNetQ n (SubSessionInput (Fin m) SubIn) (SubSessionBackdoor (Fin m) BackQ)) (NetR ⊕ RoutedNetR SubOut BackR) AdvQ AdvR) (C : Finset (Fin n)) (Z : Environment n In Out AdvQ AdvR) (κ : ℕ) (z : List Bool) :

Fixed-session joint-state execution identity using the budget-preserving multi-session protocol: compose ρ.toJoint (F.multiSessionProtocol (Fin m)) with adversary A and composeMulti ρ F.toProtocol with jointDemux A have identical output distributions.

theorem Cslib.Crypto.Protocols.UC.exec_composeMulti_toJoint_multiSessionProtocol {m n : ℕ} {In Out NetQ NetR SubIn SubOut BackQ BackR AdvQ AdvR : Type} (ρ : MultiHybridProtocol m n In Out NetQ NetR SubIn SubOut) (F : IdealFunctionality n SubIn SubOut BackQ BackR) (A : ExecAdversary n In Out (MultiNetQ m NetQ (RoutedNetQ n SubIn BackQ)) (NetR ⊕ RoutedNetR SubOut BackR) AdvQ AdvR) (C : Finset (Fin n)) (Z : Environment n In Out AdvQ AdvR) (κ : ℕ) (z : List Bool) :

Reverse fixed-session joint-state execution identity using the budget-preserving multi-session protocol: composeMulti ρ F.toProtocol with adversary A and compose ρ.toJoint (F.multiSessionProtocol (Fin m)) with jointMux A have identical output distributions.

theorem Cslib.Crypto.Protocols.UC.EmulatesWithin.toJoint_multiSessionProtocol {m n : ℕ} {In Out NetQ NetR SubIn SubOut BackQ BackR : Type} (ρ : MultiHybridProtocol m n In Out NetQ NetR SubIn SubOut) (F : IdealFunctionality n SubIn SubOut BackQ BackR) :

Fixed-session joint-state step for EmulatesWithin using F.multiSessionProtocol (Fin m): compose ρ.toJoint (F.multiSessionProtocol (Fin m)) emulates composeMulti ρ F.toProtocol with overhead Polynomial.X and zero distinguishing error via jointDemux.

theorem Cslib.Crypto.Protocols.UC.EmulatesWithin.multiSessionProtocol_toJoint {m n : ℕ} {In Out NetQ NetR SubIn SubOut BackQ BackR : Type} (ρ : MultiHybridProtocol m n In Out NetQ NetR SubIn SubOut) (F : IdealFunctionality n SubIn SubOut BackQ BackR) :

Reverse fixed-session joint-state step for EmulatesWithin using F.multiSessionProtocol (Fin m): composeMulti ρ F.toProtocol emulates compose ρ.toJoint (F.multiSessionProtocol (Fin m)) with overhead Polynomial.X and zero distinguishing error via jointMux.