Documentation

CslibFrontier.Crypto.Protocols.UC.MultiSession

Multi-session universal composition for a fixed session family #

This module proves fixed-arity multi-session composition steps for this library's own call-bounded, static-corruption port-model emulation notions (UC.EmulatesDummyWithin, UC.EmulatesWithin, UC.Emulates, UC.Realizes), via explicit parallel simulation and the multi-session state-separating hybrid bound SSP.advantage_parFin_le_sum [BDLF+18].

Scope and relation to [Can20a] #

These results adapt Theorem 22, Corollaries 23–24, and the heterogeneous-family extension of Section 6.3 of [Can20a] to a fixed number m of sessions chosen in advance; not dynamic session creation; this is not the full Theorem 22. Specifically:

  1. Fixed Fin m session family vs. dynamic SID spawning. In Theorem 22 of [Can20a] (JACM p. 28:58; ePrint 2000/067, rev. February 11, 2020, p. 61), a calling protocol dynamically spawns poly(κ) subroutine sessions indexed by bitstring session identifiers across a recursive ITI call tree. Here m : ℕ is a fixed finite arity (Fin m) of depth-1 subroutine sessions, universally quantified over {m : ℕ} in every theorem (so concrete EmulatesWithin bounds instantiate m := q.eval κ at any fixed security parameter κ). Lazy first-touch spawning and dynamic session identifiers are not formalised here and are left to a follow-up.
  2. Heterogeneous §6.3 families with one fixed interface per side. In Section 6.3 of [Can20a] (JACM p. 28:67; ePrint p. 70), distinct session identifiers may invoke distinct protocols. In EmulatesDummyWithin.composeFamily and Emulates.composeFamily, the protocol implementations and their private state types ((π j κ C).State, (φ j κ C).State) may vary with the session j : Fin m, while the party count n, party input/output types SubIn and SubOut, and each side's network message types (NQ₁, NR₁ and NQ₂, NR₂) are shared across all m sessions.
  3. Library call-bounded statistical notions vs. PPT ITMs and §4.4. Per-activation counting of oracle calls and private samples (MultiHybridProtocol.PolyBounded, Protocol.PolyBounded, Adversary.PolyBounded, Environment.PolyBounded) is this library's own convention (see the Cslib.Crypto.Protocols.UC.Emulates docstring); pure computation, state size, and message length are unbounded. By contrast, Section 4.4 of [Can20a] (JACM p. 28:48; ePrint p. 50) defines statistical emulation with computationally unbounded participants and quantitative running-time simulation overhead, and Theorem 22 is proved for PPT ITMs; no implication to or from Canetti's PPT or Section 4.4 notions is established here.
  4. Static same-party corruptions C : Finset (Fin n) vs. adaptive per-identity corruptions. The calling protocol ρ κ C and all m subroutine sessions corruptRouter C (σ j κ C) share the same static corruption set C, fixed prior to execution.
  5. Structural type-level isolation and compliance vs. runtime predicates. Subroutine-respecting isolation (each session j : Fin m is a closed Machine OracleSpec.empty package inside SSP.parFin), subroutine-exposing network addressing (MultiNetQ.sub j q), and (π, φ, ξ)- compliance (unrestricted SubSessionCall m n SubIn, corresponding to ξ = univ) are enforced statically by types rather than runtime directory queries.

Unlike the single-session theorem (m = 1 in UC.Emulates.compose), where only hρ needs a polynomial call budget, for m ≥ 2 the single-hop hybrid distinguisher sessionHopEnv internally simulates both real sessions π j (j > j₀) and ideal simulated sessions (φ j, S j) (j < j₀), so polynomial call budgets on both π and φ (hπ, hφ) are essential—matching Canetti's hypothesis that ρ, π, and φ are all bounded protocols.

Main definitions #

Main results #

References #

Ports, hybrid protocols, and session routing #

A subroutine party-port call from a multi-session hybrid protocol: delivers input to target party port party of subroutine session session (or polls it). The outer protocol can select any target party : Fin n, including on a network activation.

  • session : Fin m

    Target subroutine session index (0 ≤ session < m).

  • party : Fin n

    Target party port index (0 ≤ party < n) in that subroutine session.

  • input : SubIn

    Input (or poll token) delivered to (session, party).

@[instance_reducible]
instance Cslib.Crypto.Protocols.UC.instDecidableEqSubSessionCall {m✝ n✝ : ℕ} {SubIn✝ : Type} [DecidableEq SubIn✝] :
DecidableEq (SubSessionCall m✝ n✝ SubIn✝)
def Cslib.Crypto.Protocols.UC.instDecidableEqSubSessionCall.decEq {m✝ n✝ : ℕ} {SubIn✝ : Type} [DecidableEq SubIn✝] (x✝ x✝¹ : SubSessionCall m✝ n✝ SubIn✝) :
Decidable (x✝ = x✝¹)
def Cslib.Crypto.Protocols.UC.multiPartySpec (m n : ℕ) (SubIn SubOut : Type) :
SubSessionCall m n SubIn → Type

The party-port interface of m subroutine sessions of n parties: each SubSessionCall receives an optional output of the subroutine.

@[reducible, inline]
abbrev Cslib.Crypto.Protocols.UC.MultiHybridProtocol (m n : ℕ) (In Out NetQ NetR SubIn SubOut : Type) :

An n-party protocol in the multi-session hybrid model of m subroutine sessions with party inputs SubIn and outputs SubOut.

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

Every activation of the multi-session hybrid protocol at security parameter κ makes at most p.eval κ calls, counting private samples and subroutine calls.

inductive Cslib.Crypto.Protocols.UC.MultiNetQ (m : ℕ) (NetQ SubRoutedQ : Type) :

Network-side query to a multi-session composed protocol: either a query to the calling protocol ρ's own network port, or a query to subroutine session session's routed network port (including corrupted-party subroutine inputs .inl (i, x) and subroutine network queries .inr q).

  • outer {m : ℕ} {NetQ SubRoutedQ : Type} (query : NetQ) : MultiNetQ m NetQ SubRoutedQ

    A query directed to the outer calling protocol ρ's own network port.

  • sub {m : ℕ} {NetQ SubRoutedQ : Type} (session : Fin m) (query : SubRoutedQ) : MultiNetQ m NetQ SubRoutedQ

    A query directed to subroutine session session's routed network port.

@[instance_reducible]
instance Cslib.Crypto.Protocols.UC.instDecidableEqMultiNetQ {m✝ : ℕ} {NetQ✝ SubRoutedQ✝ : Type} [DecidableEq NetQ✝] [DecidableEq SubRoutedQ✝] :
DecidableEq (MultiNetQ m✝ NetQ✝ SubRoutedQ✝)
def Cslib.Crypto.Protocols.UC.instDecidableEqMultiNetQ.decEq {m✝ : ℕ} {NetQ✝ SubRoutedQ✝ : Type} [DecidableEq NetQ✝] [DecidableEq SubRoutedQ✝] (x✝ x✝¹ : MultiNetQ m✝ NetQ✝ SubRoutedQ✝) :
Decidable (x✝ = x✝¹)
def Cslib.Crypto.Protocols.UC.sessionRouter {m n : ℕ} {SubIn SubOut NQ NR : Type} (C : Finset (Fin n)) (σ : Fin m → Machine OracleSpec.empty (protocolSpec n SubIn SubOut NQ NR)) :
Machine OracleSpec.empty (SSP.sessionSpec m (protocolSpec n SubIn SubOut (RoutedNetQ n SubIn NQ) (RoutedNetR SubOut NR)))

Parallel router for m independent subroutine sessions sharing the static corruption set C. Each session j : Fin m owns its private state inside SSP.parFin and cannot inspect or mutate any other session's state.

def Cslib.Crypto.Protocols.UC.liftMultiParty {m n : ℕ} {SubIn SubOut NQ NR α : Type} (program : ProbOracleComp (multiPartySpec m n SubIn SubOut) α) :
ProbOracleComp (SSP.sessionSpec m (protocolSpec n SubIn SubOut NQ NR)) α

A program calling only the multi-session subroutine party port, lifted to call the m-session interface SSP.sessionSpec m (protocolSpec n SubIn SubOut NQ NR).

def Cslib.Crypto.Protocols.UC.multiHybridWrap {m n : ℕ} {In Out NetQ NetR SubIn SubOut NQ NR : Type} (M : Machine (multiPartySpec m n SubIn SubOut) (protocolSpec n In Out NetQ NetR)) :
Machine (SSP.sessionSpec m (protocolSpec n SubIn SubOut NQ NR)) (protocolSpec n In Out (MultiNetQ m NetQ NQ) (NetR ⊕ NR))

Wrap a multi-session hybrid protocol machine so its subroutine party calls target SSP.sessionSpec m (protocolSpec n SubIn SubOut NQ NR) and each subroutine session's network port is exposed under MultiNetQ.sub j / Sum.inr.

def Cslib.Crypto.Protocols.UC.composeFamily {m n : ℕ} {In Out NetQ NetR SubIn SubOut NQ NR : Type} (ρ : MultiHybridProtocol m n In Out NetQ NetR SubIn SubOut) (σ : Fin m → Protocol n SubIn SubOut NQ NR) :
Protocol n In Out (MultiNetQ m NetQ (RoutedNetQ n SubIn NQ)) (NetR ⊕ RoutedNetR SubOut NR)

Heterogeneous multi-session subroutine replacement: the hybrid protocol ρ with its m subroutine sessions answered by the independent protocol family σ : Fin m → Protocol … behind sessionRouter C, sharing the same parties and static corruption set C.

@[reducible, inline]
abbrev Cslib.Crypto.Protocols.UC.composeMulti {m n : ℕ} {In Out NetQ NetR SubIn SubOut NQ NR : Type} (ρ : MultiHybridProtocol m n In Out NetQ NetR SubIn SubOut) (σ : Protocol n SubIn SubOut NQ NR) :
Protocol n In Out (MultiNetQ m NetQ (RoutedNetQ n SubIn NQ)) (NetR ⊕ RoutedNetR SubOut NR)

Homogeneous multi-session subroutine replacement: ρ calling m independent instances of the same protocol σ.

Multi-session simulator, absorbed hybrid, and single-hop reduction environment #

def Cslib.Crypto.Protocols.UC.multiHybridSimMachine {m n : ℕ} {In Out NetQ NetR SubIn SubOut NQ₁ NR₁ NQ₂ NR₂ : Type} (S : Fin m → Machine (netSpec (RoutedNetQ n SubIn NQ₂) (RoutedNetR SubOut NR₂)) (netSpec (RoutedNetQ n SubIn NQ₁) (RoutedNetR SubOut NR₁))) :
Machine (netSpec (RoutedNetQ n In (MultiNetQ m NetQ (RoutedNetQ n SubIn NQ₂))) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR₂))) (netSpec (RoutedNetQ n In (MultiNetQ m NetQ (RoutedNetQ n SubIn NQ₁))) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR₁)))

Machine combining m independent subroutine simulators S j side by side on the composed network interface, forwarding corrupted outer-party inputs and outer network queries unchanged and routing session j network queries to S j on state coordinate j.

def Cslib.Crypto.Protocols.UC.multiHybridSim {m n : ℕ} {In Out NetQ NetR SubIn SubOut NQ₁ NR₁ NQ₂ NR₂ : Type} (S : Fin m → Adversary n (RoutedNetQ n SubIn NQ₁) (RoutedNetR SubOut NR₁) (RoutedNetQ n SubIn NQ₂) (RoutedNetR SubOut NR₂)) :
Adversary n (RoutedNetQ n In (MultiNetQ m NetQ (RoutedNetQ n SubIn NQ₁))) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR₁)) (RoutedNetQ n In (MultiNetQ m NetQ (RoutedNetQ n SubIn NQ₂))) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR₂))

The composed simulator for composeFamily ρ π against composeFamily ρ φ, running an independent simulator S j for each subroutine session j : Fin m.

def Cslib.Crypto.Protocols.UC.absorbMultiHybrid {m n : ℕ} {In Out NetQ NetR SubIn SubOut NQ NR : Type} (C : Finset (Fin n)) (ρ : MultiHybridProtocol m n In Out NetQ NetR SubIn SubOut) (Z : Environment n In Out (RoutedNetQ n In (MultiNetQ m NetQ (RoutedNetQ n SubIn NQ))) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR))) (κ : ℕ) (z : List Bool) :
ProbOracleComp (SSP.sessionSpec m (protocolSpec n SubIn SubOut (RoutedNetQ n SubIn NQ) (RoutedNetR SubOut NR))) Bool

Absorbing ρ κ C into an environment Z produces a distinguisher against the m-session subroutine interface SSP.sessionSpec m (protocolSpec n SubIn SubOut …).

def Cslib.Crypto.Protocols.UC.sessionHopEnv {m n : ℕ} {In Out NetQ NetR SubIn SubOut NQ₁ NR₁ NQ₂ NR₂ : Type} (C : Finset (Fin n)) (ρ : MultiHybridProtocol m n In Out NetQ NetR SubIn SubOut) (π : Fin m → Protocol n SubIn SubOut NQ₁ NR₁) (φ : Fin m → Protocol n SubIn SubOut NQ₂ NR₂) (S : Fin m → Adversary n (RoutedNetQ n SubIn NQ₁) (RoutedNetR SubOut NR₁) (RoutedNetQ n SubIn NQ₂) (RoutedNetR SubOut NR₂)) (Z : Environment n In Out (RoutedNetQ n In (MultiNetQ m NetQ (RoutedNetQ n SubIn NQ₁))) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR₁))) (j₀ : Fin m) :
Environment n SubIn SubOut (RoutedNetQ n SubIn NQ₁) (RoutedNetR SubOut NR₁)

Single-hop reduction environment for session j₀: runs ideal simulated sessions (φ j, S j) for j < j₀, forwards session j₀ externally, and runs real sessions π j for j > j₀.

Polynomial dominating both a real session corruptRouter C (π j κ C) (pπ) and an ideal simulated session execMachine (φ j) (S j) κ C ((pD + 1) * (pφ + 1) + pφ).

noncomputable def Cslib.Crypto.Protocols.UC.sessionHopPoly (m : ℕ) (pZ pρ pπ pφ pD : Polynomial ℕ) :

Polynomial call-budget bound for the single-hop hybrid distinguisher sessionHopEnv.

Execution identities #

theorem Cslib.Crypto.Protocols.UC.exec_composeFamily_dummy {m n : ℕ} {In Out NetQ NetR SubIn SubOut NQ NR : Type} (ρ : MultiHybridProtocol m n In Out NetQ NetR SubIn SubOut) (π : Fin m → Protocol n SubIn SubOut NQ NR) (C : Finset (Fin n)) (Z : Environment n In Out (RoutedNetQ n In (MultiNetQ m NetQ (RoutedNetQ n SubIn NQ))) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR))) (κ : ℕ) (z : List Bool) :
exec (composeFamily ρ π) (dummyAdversary n (RoutedNetQ n In (MultiNetQ m NetQ (RoutedNetQ n SubIn NQ))) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR))) C Z κ z = (sessionRouter C fun (j : Fin m) => π j κ C).run (absorbMultiHybrid C ρ Z κ z)

Running composeFamily ρ π with the dummy adversary is running sessionRouter against absorbMultiHybrid. This is an equation of programs.

theorem Cslib.Crypto.Protocols.UC.liftMultiParty_map {m n : ℕ} {SubIn SubOut NQ NR α β : Type} (f : α → β) (program : ProbOracleComp (multiPartySpec m n SubIn SubOut) α) :
liftMultiParty (f <$> program) = f <$> liftMultiParty program

Mapping over a multi-session party-interface program commutes with liftMultiParty.

theorem Cslib.Crypto.Protocols.UC.eval_exec_composeFamily_multiHybridSim {m n : ℕ} {In Out NetQ NetR SubIn SubOut NQ₁ NR₁ NQ₂ NR₂ : Type} (ρ : MultiHybridProtocol m n In Out NetQ NetR SubIn SubOut) (φ : Fin m → Protocol n SubIn SubOut NQ₂ NR₂) (S : Fin m → Adversary n (RoutedNetQ n SubIn NQ₁) (RoutedNetR SubOut NR₁) (RoutedNetQ n SubIn NQ₂) (RoutedNetR SubOut NR₂)) (C : Finset (Fin n)) (Z : Environment n In Out (RoutedNetQ n In (MultiNetQ m NetQ (RoutedNetQ n SubIn NQ₁))) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR₁))) (κ : ℕ) (z : List Bool) :
(exec (composeFamily ρ φ) (multiHybridSim S) C Z κ z).eval = ((SSP.parFin fun (j : Fin m) => execMachine (φ j) (S j) κ C).run (absorbMultiHybrid C ρ Z κ z)).eval

Running composeFamily ρ φ with multiHybridSim S has the same output distribution as running m parallel ideal-world executions execMachine (φ j) (S j) κ C against absorbMultiHybrid.

Hybrid telescoping advantage bound and polynomial call budgets #

theorem Cslib.Crypto.Protocols.UC.advantage_composeFamily_le_sum {m n : ℕ} {In Out NetQ NetR SubIn SubOut NQ₁ NR₁ NQ₂ NR₂ : Type} (ρ : MultiHybridProtocol m n In Out NetQ NetR SubIn SubOut) (π : Fin m → Protocol n SubIn SubOut NQ₁ NR₁) (φ : Fin m → Protocol n SubIn SubOut NQ₂ NR₂) (S : Fin m → Adversary n (RoutedNetQ n SubIn NQ₁) (RoutedNetR SubOut NR₁) (RoutedNetQ n SubIn NQ₂) (RoutedNetR SubOut NR₂)) (C : Finset (Fin n)) (Z : Environment n In Out (RoutedNetQ n In (MultiNetQ m NetQ (RoutedNetQ n SubIn NQ₁))) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR₁))) (κ : ℕ) (z : List Bool) :
advantage (composeFamily ρ π) (composeFamily ρ φ) (dummyAdversary n (RoutedNetQ n In (MultiNetQ m NetQ (RoutedNetQ n SubIn NQ₁))) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR₁))) (multiHybridSim S) C Z κ z ≤ ∑ j : Fin m, advantage (π j) (φ j) (dummyAdversary n (RoutedNetQ n SubIn NQ₁) (RoutedNetR SubOut NR₁)) (S j) C (sessionHopEnv C ρ π φ S Z j) κ z

Hybrid telescoping bound for m fixed sessions: the dummy-adversary distinguishing advantage between composeFamily ρ π and composeFamily ρ φ (under multiHybridSim S) is at most the sum over j : Fin m of the single-session dummy-adversary distinguishing advantages between π j and φ j against sessionHopEnv C ρ π φ S Z j.

theorem Cslib.Crypto.Protocols.UC.isBounded_multiHybridWrap {m n : ℕ} {In Out NetQ NetR SubIn SubOut NQ NR : Type} {M : Machine (multiPartySpec m n SubIn SubOut) (protocolSpec n In Out NetQ NetR)} {t : ℕ} (h : M.IsBounded t) :

Wrapping a t-bounded multi-session hybrid machine yields a (t + 1)-bounded machine (accounting for 1-query forwarding of .inr (.sub j q)).

theorem Cslib.Crypto.Protocols.UC.absorbMultiHybrid_polyBounded {m n : ℕ} {In Out NetQ NetR SubIn SubOut NQ NR : Type} (C : Finset (Fin n)) {ρ : MultiHybridProtocol m n In Out NetQ NetR SubIn SubOut} {Z : Environment n In Out (RoutedNetQ n In (MultiNetQ m NetQ (RoutedNetQ n SubIn NQ))) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR))} {pρ pZ : Polynomial ℕ} (hρ : ρ.PolyBounded pρ) (hZ : Z.PolyBounded pZ) (κ : ℕ) (z : List Bool) :

Absorbing a pρ-bounded multi-session hybrid protocol into a pZ-bounded environment gives query bound (absorbPoly pZ pρ).eval κ.

theorem Cslib.Crypto.Protocols.UC.composeFamily_polyBounded {m n : ℕ} {In Out NetQ NetR SubIn SubOut NQ NR : Type} {ρ : MultiHybridProtocol m n In Out NetQ NetR SubIn SubOut} {σ : Fin m → Protocol n SubIn SubOut NQ NR} {pρ pσ : Polynomial ℕ} (hρ : ρ.PolyBounded pρ) (hσ : ∀ (j : Fin m), (σ j).PolyBounded pσ) :
(composeFamily ρ σ).PolyBounded ((pρ + 1) * (Polynomial.C m * pσ + 1) + Polynomial.C m * pσ)

Composing a pρ-bounded multi-session hybrid protocol with a family of pσ-bounded protocols yields a ((pρ + 1) * (Polynomial.C m * pσ + 1) + Polynomial.C m * pσ)-bounded composed protocol.

theorem Cslib.Crypto.Protocols.UC.multiHybridSim_polyBounded {m n : ℕ} {In Out NetQ NetR SubIn SubOut NQ₁ NR₁ NQ₂ NR₂ : Type} {S : Fin m → Adversary n (RoutedNetQ n SubIn NQ₁) (RoutedNetR SubOut NR₁) (RoutedNetQ n SubIn NQ₂) (RoutedNetR SubOut NR₂)} {pS : Polynomial ℕ} (hS : ∀ (j : Fin m), (S j).PolyBounded pS) :

Parallel composition multiHybridSim S of pS-bounded simulators has polynomial call budget Polynomial.C m * pS + 1.

theorem Cslib.Crypto.Protocols.UC.eval_sessionHopPoly_mono {m : ℕ} {pZ pρ pπ pφ pD pD' : Polynomial ℕ} (hpD : ∀ (κ : ℕ), Polynomial.eval κ pD ≤ Polynomial.eval κ pD') (κ : ℕ) :
Polynomial.eval κ (sessionHopPoly m pZ pρ pπ pφ pD) ≤ Polynomial.eval κ (sessionHopPoly m pZ pρ pπ pφ pD')

Pointwise monotonicity of sessionHopPoly in the simulator polynomial bound pD.

theorem Cslib.Crypto.Protocols.UC.sessionHopEnv_polyBounded {m n : ℕ} {In Out NetQ NetR SubIn SubOut NQ₁ NR₁ NQ₂ NR₂ : Type} (C : Finset (Fin n)) {ρ : MultiHybridProtocol m n In Out NetQ NetR SubIn SubOut} {π : Fin m → Protocol n SubIn SubOut NQ₁ NR₁} {φ : Fin m → Protocol n SubIn SubOut NQ₂ NR₂} {S : Fin m → Adversary n (RoutedNetQ n SubIn NQ₁) (RoutedNetR SubOut NR₁) (RoutedNetQ n SubIn NQ₂) (RoutedNetR SubOut NR₂)} {Z : Environment n In Out (RoutedNetQ n In (MultiNetQ m NetQ (RoutedNetQ n SubIn NQ₁))) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR₁))} {pρ pπ pφ pD pZ : Polynomial ℕ} (hρ : ρ.PolyBounded pρ) (hπ : ∀ (j : Fin m), (π j).PolyBounded pπ) (hφ : ∀ (j : Fin m), (φ j).PolyBounded pφ) (hS : ∀ (j : Fin m), (S j).PolyBounded pD) (hZ : Z.PolyBounded pZ) (j₀ : Fin m) :
(sessionHopEnv C ρ π φ S Z j₀).PolyBounded (sessionHopPoly m pZ pρ pπ pφ pD)

Each single-hop hybrid distinguisher sessionHopEnv C ρ π φ S Z j₀ has polynomial call budget sessionHopPoly m pZ pρ pπ pφ pD.

Multi-session UC composition theorems #

theorem Cslib.Crypto.Protocols.UC.EmulatesDummyWithin.composeFamily {m n : ℕ} {In Out NetQ NetR SubIn SubOut NQ₁ NR₁ NQ₂ NR₂ : Type} {ρ : MultiHybridProtocol m n In Out NetQ NetR SubIn SubOut} {π : Fin m → Protocol n SubIn SubOut NQ₁ NR₁} {φ : Fin m → Protocol n SubIn SubOut NQ₂ NR₂} {pρ pπ pφ pD : Polynomial ℕ} {ε : Fin m → Polynomial ℕ → ℕ → NNReal} (hρ : ρ.PolyBounded pρ) (hπ : ∀ (j : Fin m), (π j).PolyBounded pπ) (hφ : ∀ (j : Fin m), (φ j).PolyBounded pφ) (h : ∀ (j : Fin m), EmulatesDummyWithin (π j) (φ j) pD (ε j)) :
EmulatesDummyWithin (UC.composeFamily ρ π) (UC.composeFamily ρ φ) (Polynomial.C m * pD + 1) fun (pZ : Polynomial ℕ) (κ : ℕ) => ∑ j : Fin m, ε j (sessionHopPoly m pZ pρ pπ pφ pD) κ

Fixed-session composition step for EmulatesDummyWithin, this library's own call-bounded dummy-adversary emulation relation, with an explicit parallel simulator multiHybridSim over a fixed family of m sessions sharing party count, party input/output types, and one fixed network interface per side (implementations and private state types may vary per session). Adapts Theorem 22 and Section 6.3 of [Can20a] (JACM p. 28:58, p. 28:67; ePrint 2000/067, pp. 61, 70) to static corruptions and a fixed Fin m session family; see the module docstring for the relation to Canetti's PPT theorem.

theorem Cslib.Crypto.Protocols.UC.EmulatesDummyWithin.composeMulti {m n : ℕ} {In Out NetQ NetR SubIn SubOut NQ₁ NR₁ NQ₂ NR₂ : Type} {ρ : MultiHybridProtocol m n In Out NetQ NetR SubIn SubOut} {π : Protocol n SubIn SubOut NQ₁ NR₁} {φ : Protocol n SubIn SubOut NQ₂ NR₂} {pρ pπ pφ pD : Polynomial ℕ} {ε : Polynomial ℕ → ℕ → NNReal} (hρ : ρ.PolyBounded pρ) (hπ : π.PolyBounded pπ) (hφ : φ.PolyBounded pφ) (h : EmulatesDummyWithin π φ pD ε) :
EmulatesDummyWithin (UC.composeMulti ρ π) (UC.composeMulti ρ φ) (Polynomial.C m * pD + 1) fun (pZ : Polynomial ℕ) (κ : ℕ) => m • ε (sessionHopPoly m pZ pρ pπ pφ pD) κ

Fixed-session homogeneous composition step for EmulatesDummyWithin, this library's own call-bounded dummy-adversary emulation relation, specializing EmulatesDummyWithin.composeFamily to m instances of a single subroutine protocol π replaced by φ. Adapts Theorem 22 of [Can20a] (JACM p. 28:58; ePrint 2000/067, p. 61) to static corruptions and a fixed Fin m session count; see the module docstring for the relation to Canetti's PPT theorem.

theorem Cslib.Crypto.Protocols.UC.EmulatesWithin.composeMulti {m n : ℕ} {In Out NetQ NetR SubIn SubOut NQ₁ NR₁ NQ₂ NR₂ : Type} {ρ : MultiHybridProtocol m n In Out NetQ NetR SubIn SubOut} {π : Protocol n SubIn SubOut NQ₁ NR₁} {φ : Protocol n SubIn SubOut NQ₂ NR₂} {pρ pπ pφ g : Polynomial ℕ} {ε : Polynomial ℕ → Polynomial ℕ → ℕ → NNReal} (hρ : ρ.PolyBounded pρ) (hπ : π.PolyBounded pπ) (hφ : φ.PolyBounded pφ) (h : EmulatesWithin π φ g ε) :
EmulatesWithin (UC.composeMulti ρ π) (UC.composeMulti ρ φ) (compSimPoly (Polynomial.C m * g.comp (Polynomial.X + 1) + 1)) fun (pA pZ : Polynomial ℕ) (κ : ℕ) => m • ε 1 (sessionHopPoly m (absorbPoly pZ pA) pρ pπ pφ (g.comp (Polynomial.X + 1))) κ

Fixed-session quantitative composition step for EmulatesWithin, this library's own call-bounded emulation relation, yielding explicit simulator call overhead and distinguishing bound m • ε 1 (sessionHopPoly m (absorbPoly pZ pA) pρ pπ pφ (g.comp (X + 1))). Adapts Theorem 22 of [Can20a] (JACM p. 28:58; ePrint 2000/067, p. 61) to static corruptions and a fixed Fin m session count; see the module docstring for the relation to Canetti's PPT theorem.

theorem Cslib.Crypto.Protocols.UC.Emulates.composeFamily {m n : ℕ} {In Out NetQ NetR SubIn SubOut NQ₁ NR₁ NQ₂ NR₂ : Type} {ρ : MultiHybridProtocol m n In Out NetQ NetR SubIn SubOut} {π : Fin m → Protocol n SubIn SubOut NQ₁ NR₁} {φ : Fin m → Protocol n SubIn SubOut NQ₂ NR₂} {pρ pπ pφ : Polynomial ℕ} (hρ : ρ.PolyBounded pρ) (hπ : ∀ (j : Fin m), (π j).PolyBounded pπ) (hφ : ∀ (j : Fin m), (φ j).PolyBounded pφ) (h : ∀ (j : Fin m), Emulates (π j) (φ j)) :

Fixed-session composition step for Emulates, this library's own call-bounded emulation relation, with an explicit parallel simulator and one fixed interface per side: protocol implementations and private state types may vary per session j : Fin m, while party count n, party input/output types, and each side's network message types are shared across sessions. Adapts Theorem 22 and Section 6.3 of [Can20a] (JACM p. 28:58, p. 28:67; ePrint 2000/067, pp. 61, 70) to static corruptions and a fixed Fin m session family; see the module docstring for the relation to Canetti's PPT theorem.

theorem Cslib.Crypto.Protocols.UC.Emulates.composeMulti {m n : ℕ} {In Out NetQ NetR SubIn SubOut NQ₁ NR₁ NQ₂ NR₂ : Type} {ρ : MultiHybridProtocol m n In Out NetQ NetR SubIn SubOut} {π : Protocol n SubIn SubOut NQ₁ NR₁} {φ : Protocol n SubIn SubOut NQ₂ NR₂} {pρ pπ pφ : Polynomial ℕ} (hρ : ρ.PolyBounded pρ) (hπ : π.PolyBounded pπ) (hφ : φ.PolyBounded pφ) (h : Emulates π φ) :

Fixed-session homogeneous composition step for Emulates, this library's own call-bounded emulation relation, specializing Emulates.composeFamily to m instances of π replaced by φ. Adapts Theorem 22 of [Can20a] (JACM p. 28:58; ePrint 2000/067, p. 61) to static corruptions and a fixed Fin m session count; see the module docstring for the relation to Canetti's PPT theorem.

theorem Cslib.Crypto.Protocols.UC.Realizes.composeMulti {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) :

Fixed-session composition step for Realizes, this library's own call-bounded emulation relation against an ideal functionality, replacing m instances of F in composeMulti ρ with a protocol π that realizes F. Adapts Corollary 23 of [Can20a] (JACM p. 28:59; ePrint 2000/067, p. 62) to static corruptions and a fixed Fin m session count; see the module docstring for the relation to Canetti's PPT theorem.

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

Fixed-session transitive hybrid replacement step for Realizes, this library's own call-bounded emulation relation against an ideal functionality: if π realizes F and composeMulti ρ F.toProtocol realizes G, then composeMulti ρ π realizes G. Adapts Corollary 24 of [Can20a] (JACM p. 28:59; ePrint 2000/067, p. 62) to static corruptions and a fixed Fin m session count; see the module docstring for the relation to Canetti's PPT theorem.