Documentation

CslibFrontier.Crypto.Protocols.UC.DynamicMultiSession

Dynamic-SID multi-session universal composition #

This module extends the fixed-arity Fin m multi-session composition of CslibFrontier.Crypto.Protocols.UC.MultiSession to an arbitrary [DecidableEq SID] type of session identifiers with lazy first-touch session creation, bounded dynamically by the caller's polynomial query budget.

Scope and relation to [Can20a] #

These results adapt Theorem 22 and Corollaries 23–24 of [Can20a] (JACM pp. 28:58–28:59; ePrint 2000/067, rev. February 11, 2020, pp. 61–62) to dynamically chosen session identifiers sid : SID with depth-1 subroutine sessions in this library's call-bounded statistical UC model (not the full PPT ITM Theorem 22; #6043 remains open). Specifically:

  1. Dynamic first-touch SID creation vs. recursive ITI spawning. Calling protocols and environments may query arbitrary sid : SID (including when SID is infinite, e.g., ℕ or List Bool); SSP.parFinLazy and dynHybridSim initialize each session's state lazily on its first access (matching the single-functionality lazy pattern of IdealFunctionality.multiSession in CslibFrontier.Crypto.Protocols.UC.JointState), and SSP.mem_support_parFinLazy_touched_card_le / SSP.touchedSessions_transcript_card_le (in CslibFrontier.Crypto.Protocols.SSP.ParFinLazy) prove that on every supported path of a b-bounded execution at most b distinct SIDs are initialized or queried. Subroutines do not recursively spawn nested dynamic sub-sessions (depth-1 call tree).
  2. Homogeneous subroutine protocol σ. Every dynamic session instantiates the same subroutine protocol σ (or F.toProtocol), whereas fixed-arity heterogeneous families are treated in CslibFrontier.Crypto.Protocols.UC.MultiSession.
  3. Call-bounded statistical model vs. PPT ITMs and §4.4. DynHybridProtocol.PolyBounded, Protocol.PolyBounded, Adversary.PolyBounded, and Environment.PolyBounded count oracle calls and private samples per activation, leaving local computation, state size, and message length unbounded; corruptions C : Finset (Fin n) are static and shared across the calling protocol and all dynamic sessions; interfaces are pull-based. No implication to or from Canetti's PPT or §4.4 notions is claimed.

Proof strategy #

Given a b-query-bounded program over SSP.dynSessionSpec SID E, SSP.allocMachine assigns each newly touched sid : SID to the next slot in Fin (b + 1) on first access (SSP.eval_run_parFinLazy_eq_parFin_alloc), using SSP.run_parFinLazy_eq_parFin from CslibFrontier.Crypto.Protocols.SSP.ParFinLazy to pass from lazy first-touch initialization to eager SSP.parFin over Fin (b + 1), and then invoking SSP.advantage_parFin_le_sum from CslibFrontier.Crypto.Protocols.SSP.Hybrid / MultiSession. Because dynHybridSim itself initializes simulator states lazily on first touch with per-activation budget 2 * pD + 1, a single simulator serves every environment budget pZ uniformly.

Main definitions #

Main results #

References #

Dynamic-SID hybrid protocols, routers, simulator, and budgets #

structure Cslib.Crypto.Protocols.UC.DynSessionCall (SID : Type) (n : ℕ) (SubIn : Type) :

A subroutine party-port call from a dynamic-SID hybrid protocol, targeting party port party of dynamically chosen session sid : SID.

  • sid : SID

    Target subroutine session identifier.

  • party : Fin n

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

  • input : SubIn

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

@[instance_reducible]
instance Cslib.Crypto.Protocols.UC.instDecidableEqDynSessionCall {SID✝ : Type} {n✝ : ℕ} {SubIn✝ : Type} [DecidableEq SID✝] [DecidableEq SubIn✝] :
DecidableEq (DynSessionCall SID✝ n✝ SubIn✝)
def Cslib.Crypto.Protocols.UC.instDecidableEqDynSessionCall.decEq {SID✝ : Type} {n✝ : ℕ} {SubIn✝ : Type} [DecidableEq SID✝] [DecidableEq SubIn✝] (x✝ x✝¹ : DynSessionCall SID✝ n✝ SubIn✝) :
Decidable (x✝ = x✝¹)
def Cslib.Crypto.Protocols.UC.dynPartySpec (SID : Type) (n : ℕ) (SubIn SubOut : Type) :
DynSessionCall SID n SubIn → Type

The party-port interface of dynamic-SID subroutine sessions of n parties: each DynSessionCall receives an optional output of the subroutine.

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

An n-party protocol in the dynamic-SID hybrid model calling depth-1 subroutine sessions indexed by SID.

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

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

inductive Cslib.Crypto.Protocols.UC.DynNetQ (SID NetQ SubRoutedQ : Type) :

Network-side query to a dynamic-SID composed protocol: either a query to the outer calling protocol ρ's own network port, or a query to dynamic subroutine session sid's routed network port.

  • outer {SID NetQ SubRoutedQ : Type} (query : NetQ) : DynNetQ SID NetQ SubRoutedQ

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

  • sub {SID NetQ SubRoutedQ : Type} (sid : SID) (query : SubRoutedQ) : DynNetQ SID NetQ SubRoutedQ

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

@[instance_reducible]
instance Cslib.Crypto.Protocols.UC.instDecidableEqDynNetQ {SID✝ NetQ✝ SubRoutedQ✝ : Type} [DecidableEq SID✝] [DecidableEq NetQ✝] [DecidableEq SubRoutedQ✝] :
DecidableEq (DynNetQ SID✝ NetQ✝ SubRoutedQ✝)
def Cslib.Crypto.Protocols.UC.instDecidableEqDynNetQ.decEq {SID✝ NetQ✝ SubRoutedQ✝ : Type} [DecidableEq SID✝] [DecidableEq NetQ✝] [DecidableEq SubRoutedQ✝] (x✝ x✝¹ : DynNetQ SID✝ NetQ✝ SubRoutedQ✝) :
Decidable (x✝ = x✝¹)
def Cslib.Crypto.Protocols.UC.dynSessionRouter {SID : Type} [DecidableEq SID] {n : ℕ} {SubIn SubOut NQ NR : Type} (C : Finset (Fin n)) (σ : Machine OracleSpec.empty (protocolSpec n SubIn SubOut NQ NR)) :
Machine OracleSpec.empty (SSP.dynSessionSpec SID (protocolSpec n SubIn SubOut (RoutedNetQ n SubIn NQ) (RoutedNetR SubOut NR)))

Lazy first-touch parallel router for dynamic-SID subroutine sessions of σ sharing the static corruption set C. Each session sid : SID is initialized on first access inside SSP.parFinLazy.

def Cslib.Crypto.Protocols.UC.liftDynParty {SID : Type} {n : ℕ} {SubIn SubOut NQ NR α : Type} (program : ProbOracleComp (dynPartySpec SID n SubIn SubOut) α) :
ProbOracleComp (SSP.dynSessionSpec SID (protocolSpec n SubIn SubOut NQ NR)) α

Lift a program calling only dynPartySpec to call SSP.dynSessionSpec SID (protocolSpec ...).

def Cslib.Crypto.Protocols.UC.dynHybridWrap {SID : Type} {n : ℕ} {In Out NetQ NetR SubIn SubOut NQ NR : Type} (M : Machine (dynPartySpec SID n SubIn SubOut) (protocolSpec n In Out NetQ NetR)) :
Machine (SSP.dynSessionSpec SID (protocolSpec n SubIn SubOut NQ NR)) (protocolSpec n In Out (DynNetQ SID NetQ NQ) (NetR ⊕ NR))

Wrap a dynamic-SID hybrid protocol machine so its subroutine party calls target SSP.dynSessionSpec SID and each session's network port is exposed under DynNetQ.sub sid.

def Cslib.Crypto.Protocols.UC.composeDyn {SID : Type} [DecidableEq SID] {n : ℕ} {In Out NetQ NetR SubIn SubOut NQ NR : Type} (ρ : DynHybridProtocol SID n In Out NetQ NetR SubIn SubOut) (σ : Protocol n SubIn SubOut NQ NR) :
Protocol n In Out (DynNetQ SID NetQ (RoutedNetQ n SubIn NQ)) (NetR ⊕ RoutedNetR SubOut NR)

Dynamic-SID homogeneous subroutine replacement: ρ calling lazily initialized independent instances of σ indexed by SID.

def Cslib.Crypto.Protocols.UC.dynHybridSimMachine {SID : Type} [DecidableEq SID] {n : ℕ} {In Out NetQ NetR SubIn SubOut NQ₁ NR₁ NQ₂ NR₂ : Type} (S : Machine (netSpec (RoutedNetQ n SubIn NQ₂) (RoutedNetR SubOut NR₂)) (netSpec (RoutedNetQ n SubIn NQ₁) (RoutedNetR SubOut NR₁))) :
Machine (netSpec (RoutedNetQ n In (DynNetQ SID NetQ (RoutedNetQ n SubIn NQ₂))) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR₂))) (netSpec (RoutedNetQ n In (DynNetQ SID NetQ (RoutedNetQ n SubIn NQ₁))) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR₁)))

Lazy parallel machine combining dynamic-SID copies of a single-session simulator S on the composed network interface, initializing session sid's simulator state on first network query .inr (.sub sid q).

def Cslib.Crypto.Protocols.UC.dynHybridSim {SID : Type} [DecidableEq SID] {n : ℕ} {In Out NetQ NetR SubIn SubOut NQ₁ NR₁ NQ₂ NR₂ : Type} (S : Adversary n (RoutedNetQ n SubIn NQ₁) (RoutedNetR SubOut NR₁) (RoutedNetQ n SubIn NQ₂) (RoutedNetR SubOut NR₂)) :
Adversary n (RoutedNetQ n In (DynNetQ SID NetQ (RoutedNetQ n SubIn NQ₁))) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR₁)) (RoutedNetQ n In (DynNetQ SID NetQ (RoutedNetQ n SubIn NQ₂))) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR₂))

Lazy parallel simulator for composeDyn ρ π against composeDyn ρ φ, creating an independent instance of S on first network touch of each sid : SID. Because session states are created lazily, one fixed simulator serves environments of every polynomial call budget.

def Cslib.Crypto.Protocols.UC.absorbDynHybrid {SID : Type} {n : ℕ} {In Out NetQ NetR SubIn SubOut NQ NR : Type} (C : Finset (Fin n)) (ρ : DynHybridProtocol SID n In Out NetQ NetR SubIn SubOut) (Z : Environment n In Out (RoutedNetQ n In (DynNetQ SID NetQ (RoutedNetQ n SubIn NQ))) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR))) (κ : ℕ) (z : List Bool) :
ProbOracleComp (SSP.dynSessionSpec SID (protocolSpec n SubIn SubOut (RoutedNetQ n SubIn NQ) (RoutedNetR SubOut NR))) Bool

Absorbing ρ κ C into an environment Z produces a distinguisher against the dynamic-SID subroutine interface SSP.dynSessionSpec SID (protocolSpec n SubIn SubOut ...).

def Cslib.Crypto.Protocols.UC.dynSessionHopEnv {SID : Type} [DecidableEq SID] {n : ℕ} {In Out NetQ NetR SubIn SubOut NQ₁ NR₁ NQ₂ NR₂ : Type} (C : Finset (Fin n)) (ρ : DynHybridProtocol SID n In Out NetQ NetR SubIn SubOut) (π : Protocol n SubIn SubOut NQ₁ NR₁) (φ : Protocol n SubIn SubOut NQ₂ NR₂) (S : Adversary n (RoutedNetQ n SubIn NQ₁) (RoutedNetR SubOut NR₁) (RoutedNetQ n SubIn NQ₂) (RoutedNetR SubOut NR₂)) (Z : Environment n In Out (RoutedNetQ n In (DynNetQ SID NetQ (RoutedNetQ n SubIn NQ₁))) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR₁))) (κ : ℕ) (z : List Bool) (b : ℕ) (j₀ : Fin (b + 1)) :
Environment n SubIn SubOut (RoutedNetQ n SubIn NQ₁) (RoutedNetR SubOut NR₁)

Single-hop reduction environment for dynamic-SID composition at (κ, z) with b + 1 allocated slots and hop index j₀ : Fin (b + 1): at (κ, z) it runs absorbDynHybrid C ρ Z κ z reindexed through SSP.allocMachine SID b _ against SSP.hybridDistinguisher (ideal simulated sessions below j₀, external challenge at j₀, real sessions above j₀), and outputs pure false elsewhere.

Polynomial query budget of each single-hop hybrid distinguisher dynSessionHopEnv when at most absorbPoly pZ pρ + 1 dynamic slots are needed.

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

Wrapping a t-bounded dynamic-SID hybrid machine yields a (t + 1)-bounded machine.

theorem Cslib.Crypto.Protocols.UC.absorbDynHybrid_polyBounded {SID : Type} {n : ℕ} {In Out NetQ NetR SubIn SubOut NQ NR : Type} (C : Finset (Fin n)) {ρ : DynHybridProtocol SID n In Out NetQ NetR SubIn SubOut} {Z : Environment n In Out (RoutedNetQ n In (DynNetQ SID 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 dynamic-SID hybrid protocol into a pZ-bounded environment gives query bound (absorbPoly pZ pρ).eval κ.

theorem Cslib.Crypto.Protocols.UC.composeDyn_polyBounded {SID : Type} [DecidableEq SID] {n : ℕ} {In Out NetQ NetR SubIn SubOut NQ NR : Type} {ρ : DynHybridProtocol SID n In Out NetQ NetR SubIn SubOut} {σ : Protocol n SubIn SubOut NQ NR} {pρ pσ : Polynomial ℕ} (hρ : ρ.PolyBounded pρ) (hσ : σ.PolyBounded pσ) :
(composeDyn ρ σ).PolyBounded ((pρ + 1) * (2 * pσ + 1) + 2 * pσ)

Composing a pρ-bounded dynamic-SID hybrid protocol with a pσ-bounded protocol yields a ((pρ + 1) * (2 * pσ + 1) + 2 * pσ)-bounded composed protocol, independent of the number of sessions touched.

theorem Cslib.Crypto.Protocols.UC.dynHybridSim_polyBounded {SID : Type} [DecidableEq SID] {n : ℕ} {In Out NetQ NetR SubIn SubOut NQ₁ NR₁ NQ₂ NR₂ : Type} {S : Adversary n (RoutedNetQ n SubIn NQ₁) (RoutedNetR SubOut NR₁) (RoutedNetQ n SubIn NQ₂) (RoutedNetR SubOut NR₂)} {pS : Polynomial ℕ} (hS : S.PolyBounded pS) :

The lazy dynamic-SID simulator dynHybridSim S for a pS-bounded simulator S has polynomial call budget 2 * pS + 1, independent of any session count.

theorem Cslib.Crypto.Protocols.UC.dynSessionHopEnv_polyBounded {SID : Type} [DecidableEq SID] {n : ℕ} {In Out NetQ NetR SubIn SubOut NQ₁ NR₁ NQ₂ NR₂ : Type} (C : Finset (Fin n)) {ρ : DynHybridProtocol SID n In Out NetQ NetR SubIn SubOut} {π : Protocol n SubIn SubOut NQ₁ NR₁} {φ : Protocol n SubIn SubOut NQ₂ NR₂} {S : Adversary n (RoutedNetQ n SubIn NQ₁) (RoutedNetR SubOut NR₁) (RoutedNetQ n SubIn NQ₂) (RoutedNetR SubOut NR₂)} {Z : Environment n In Out (RoutedNetQ n In (DynNetQ SID NetQ (RoutedNetQ n SubIn NQ₁))) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR₁))} {pρ pπ pφ pD pZ : Polynomial ℕ} (hρ : ρ.PolyBounded pρ) (hπ : π.PolyBounded pπ) (hφ : φ.PolyBounded pφ) (hS : S.PolyBounded pD) (hZ : Z.PolyBounded pZ) (κ : ℕ) (z : List Bool) (j₀ : Fin (Polynomial.eval κ (absorbPoly pZ pρ) + 1)) :
(dynSessionHopEnv C ρ π φ S Z κ z (Polynomial.eval κ (absorbPoly pZ pρ)) j₀).PolyBounded (dynSessionHopPoly pZ pρ pπ pφ pD)

Each single-hop hybrid reduction environment dynSessionHopEnv C ρ π φ S Z κ z ((absorbPoly pZ pρ).eval κ) j₀ has polynomial call budget dynSessionHopPoly pZ pρ pπ pφ pD.

Execution identities and reduction to SSP.parFin #

theorem Cslib.Crypto.Protocols.UC.exec_composeDyn_dummy {SID : Type} [DecidableEq SID] {n : ℕ} {In Out NetQ NetR SubIn SubOut NQ NR : Type} (ρ : DynHybridProtocol SID n In Out NetQ NetR SubIn SubOut) (π : Protocol n SubIn SubOut NQ NR) (C : Finset (Fin n)) (Z : Environment n In Out (RoutedNetQ n In (DynNetQ SID NetQ (RoutedNetQ n SubIn NQ))) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR))) (κ : ℕ) (z : List Bool) :
exec (composeDyn ρ π) (dummyAdversary n (RoutedNetQ n In (DynNetQ SID NetQ (RoutedNetQ n SubIn NQ))) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR))) C Z κ z = (dynSessionRouter C (π κ C)).run (absorbDynHybrid C ρ Z κ z)

Running composeDyn ρ π with the dummy adversary is running dynSessionRouter against absorbDynHybrid.

theorem Cslib.Crypto.Protocols.UC.eval_exec_composeDyn_dynHybridSim_eq_parFin {SID : Type} [DecidableEq SID] {n : ℕ} {In Out NetQ NetR SubIn SubOut NQ₁ NR₁ NQ₂ NR₂ : Type} (ρ : DynHybridProtocol SID n In Out NetQ NetR SubIn SubOut) (φ : Protocol n SubIn SubOut NQ₂ NR₂) (S : 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 (DynNetQ SID NetQ (RoutedNetQ n SubIn NQ₁))) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR₁))) (κ : ℕ) (z : List Bool) {b : ℕ} (hb : OracleComp.IsQueryBounded (absorbDynHybrid C ρ Z κ z) b) :
(exec (composeDyn ρ φ) (dynHybridSim S) C Z κ z).eval = ((SSP.parFin fun (x : Fin (b + 1)) => execMachine φ S κ C).run ((SSP.allocMachine SID b (execSpec n SubIn SubOut (RoutedNetQ n SubIn NQ₁) (RoutedNetR SubOut NR₁))).link (absorbDynHybrid C ρ Z κ z))).eval

Running composeDyn ρ φ with dynHybridSim S against an environment whose absorbed program absorbDynHybrid C ρ Z κ z is b-query-bounded has the same output distribution as running b + 1 eager parallel ideal-world executions execMachine φ S κ C against the first-touch reindexed program (SSP.allocMachine SID b _).link (absorbDynHybrid C ρ Z κ z).

theorem Cslib.Crypto.Protocols.UC.advantage_composeDyn_le_sum {SID : Type} [DecidableEq SID] {n : ℕ} {In Out NetQ NetR SubIn SubOut NQ₁ NR₁ NQ₂ NR₂ : Type} (ρ : DynHybridProtocol SID n In Out NetQ NetR SubIn SubOut) (π : Protocol n SubIn SubOut NQ₁ NR₁) (φ : Protocol n SubIn SubOut NQ₂ NR₂) (S : 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 (DynNetQ SID NetQ (RoutedNetQ n SubIn NQ₁))) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR₁))) (κ : ℕ) (z : List Bool) {b : ℕ} (hb : OracleComp.IsQueryBounded (absorbDynHybrid C ρ Z κ z) b) :
advantage (composeDyn ρ π) (composeDyn ρ φ) (dummyAdversary n (RoutedNetQ n In (DynNetQ SID NetQ (RoutedNetQ n SubIn NQ₁))) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR₁))) (dynHybridSim S) C Z κ z ≤ ∑ j : Fin (b + 1), advantage π φ (dummyAdversary n (RoutedNetQ n SubIn NQ₁) (RoutedNetR SubOut NR₁)) S C (dynSessionHopEnv C ρ π φ S Z κ z b j) κ z

Hybrid telescoping bound for dynamic-SID sessions: for any b-query-bounded absorbed environment absorbDynHybrid C ρ Z κ z, the dummy-adversary distinguishing advantage between composeDyn ρ π and composeDyn ρ φ (under dynHybridSim S) is at most the sum over j : Fin (b + 1) of single-session advantages against dynSessionHopEnv.

Dynamic-SID UC composition theorems #

theorem Cslib.Crypto.Protocols.UC.EmulatesDummyWithin.composeDyn {SID : Type} [DecidableEq SID] {n : ℕ} {In Out NetQ NetR SubIn SubOut NQ₁ NR₁ NQ₂ NR₂ : Type} {ρ : DynHybridProtocol SID 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.composeDyn ρ π) (UC.composeDyn ρ φ) (2 * pD + 1) fun (pZ : Polynomial ℕ) (κ : ℕ) => (Polynomial.eval κ (absorbPoly pZ pρ) + 1) • ε (dynSessionHopPoly pZ pρ pπ pφ pD) κ

Dynamic-SID composition step for EmulatesDummyWithin, extending EmulatesDummyWithin.composeMulti from fixed Fin m to an arbitrary [DecidableEq SID] with lazy first-touch session creation (dynHybridSim). Adapts Theorem 22 of [Can20a] (JACM p. 28:58; ePrint 2000/067, p. 61) to static corruptions, depth-1 dynamic sessions, and this library's call-bounded statistical model; not the full PPT ITM theorem (#6043 remains open).

theorem Cslib.Crypto.Protocols.UC.EmulatesWithin.composeDyn {SID : Type} [DecidableEq SID] {n : ℕ} {In Out NetQ NetR SubIn SubOut NQ₁ NR₁ NQ₂ NR₂ : Type} {ρ : DynHybridProtocol SID 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.composeDyn ρ π) (UC.composeDyn ρ φ) (Polynomial.X * (2 * g.comp (Polynomial.X + 1) + 1 + 1) + (2 * g.comp (Polynomial.X + 1) + 1)) fun (pA pZ : Polynomial ℕ) (κ : ℕ) => (Polynomial.eval κ (absorbPoly (absorbPoly pZ pA) pρ) + 1) • ε 1 (dynSessionHopPoly (absorbPoly pZ pA) pρ pπ pφ (g.comp (Polynomial.X + 1))) κ

Dynamic-SID concrete quantitative composition step for EmulatesWithin with lazy first-touch session creation over an arbitrary [DecidableEq SID]. Adapts Theorem 22 of [Can20a] (JACM p. 28:58; ePrint 2000/067, p. 61) to static corruptions, depth-1 dynamic sessions, and this library's call-bounded statistical model; not the full PPT ITM theorem (#6043 remains open).

theorem Cslib.Crypto.Protocols.UC.Emulates.composeDyn {SID : Type} [DecidableEq SID] {n : ℕ} {In Out NetQ NetR SubIn SubOut NQ₁ NR₁ NQ₂ NR₂ : Type} {ρ : DynHybridProtocol SID 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 π φ) :

Dynamic-SID composition step for Emulates with lazy first-touch session creation over an arbitrary [DecidableEq SID]: if π emulates φ and ρ, π, φ are polynomially call-bounded, then composeDyn ρ π emulates composeDyn ρ φ. Adapts Theorem 22 of [Can20a] (JACM p. 28:58; ePrint 2000/067, p. 61) to static corruptions, depth-1 dynamic sessions, and this library's call-bounded statistical model; not the full PPT ITM theorem (#6043 remains open).

theorem Cslib.Crypto.Protocols.UC.Realizes.composeDyn {SID : Type} [DecidableEq SID] {n : ℕ} {In Out NetQ NetR SubIn SubOut NQ NR BackQ BackR : Type} {ρ : DynHybridProtocol SID 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) :

Dynamic-SID composition step for Realizes, replacing dynamically created instances of F in composeDyn ρ F.toProtocol with a protocol π realizing F. Adapts Corollary 23 of [Can20a] (JACM p. 28:59; ePrint 2000/067, p. 62) to static corruptions, depth-1 dynamic sessions, and this library's call-bounded statistical model; not the full PPT ITM corollary (#6043 remains open).

theorem Cslib.Crypto.Protocols.UC.Realizes.composeDyn_trans {SID : Type} [DecidableEq SID] {n : ℕ} {In Out NetQ NetR SubIn SubOut NQ NR BackQ BackR GQ GR : Type} {ρ : DynHybridProtocol SID 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.composeDyn ρ F.toProtocol) G) :

Dynamic-SID transitive hybrid replacement step for Realizes, this library's own call-bounded emulation relation against an ideal functionality: if π realizes F and composeDyn ρ F.toProtocol realizes G, then composeDyn ρ π realizes G. Adapts Corollary 24 of [Can20a] (JACM p. 28:59; ePrint 2000/067, p. 62) to static corruptions, depth-1 dynamic sessions, and this library's call-bounded statistical model; not the full PPT ITM corollary (#6043 remains open).