Documentation

CslibFrontier.Crypto.Protocols.UC.Composition

Subroutine replacement and statistical call-bounded UC composition #

This module proves composition for this library's novel call-bounded port-model emulation notions, in which environments, adversaries, and simulators are query-bounded with unbounded local computation: statistical, single-subroutine, static-corruption composition, a step toward Canetti's computational UC composition theorem ([Can20a], Section 2.3, Theorem 3 and Corollaries (a)–(b)) but not that theorem (#6043). A hybrid protocol ρ : UC.HybridProtocol n In Out NetQ NetR SubIn SubOut is an n-party protocol whose machines also call the party port of a subroutine with inputs SubIn and outputs SubOut. Subroutine replacement UC.compose ρ σ (written ρ^σ below) answers those calls with the protocol σ : UC.Protocol n SubIn SubOut NQ NR, run for the same parties, security parameter and corrupted parties C behind the static-corruption router UC.corruptRouter C. The network port of ρ^σ is ρ's own network port beside the routed network port of σ, so the adversary of ρ^σ schedules σ's network and plays the corrupted parties of σ. With σ = F.toProtocol this is the F-hybrid protocol ρ^F; with σ = π it is the protocol in which ρ calls π instead.

The statistical, call-bounded composition theorem (UC.Emulates.compose, #6043) says that single-subroutine replacement preserves UC.Emulates: if π emulates φ, then ρ^π emulates ρ^φ for every hybrid protocol ρ with a polynomial call budget. In particular, if π realizes F in the sense of UC.Realizes then ρ^π emulates ρ^F (UC.Realizes.compose), and if moreover ρ^F realizes G then ρ^π realizes G (UC.Realizes.compose_trans). The concrete versions keep track of budgets and errors: UC.EmulatesDummyWithin.compose turns a simulator S with budget pD for the dummy adversary of π into the simulator UC.hybridSim S with budget pD + 1 for the dummy adversary of ρ^π, with the error evaluated at the environment budget UC.absorbPoly pZ pρ, and UC.EmulatesWithin.compose is the corresponding statement for arbitrary adversaries.

The proof follows the dummy-adversary proof of the composition theorem. The environment UC.absorbHybrid C ρ Z of the subroutine runs ρ internally together with an environment Z of ρ^π. Running ρ^π with the dummy adversary is running π with the dummy adversary and this environment, as an equation of programs (UC.exec_compose_dummy). Running ρ^φ with the composed simulator, which forwards the queries for ρ and lets S answer those for the subroutine, has the same output distribution as running φ with S and the same environment (UC.eval_exec_compose_hybridSim). Here the two executions make the same calls in the same order, and differ only in the order in which the independent initial states of ρ and S are sampled; the comparison of the activations uses the state-representation lemma Cslib.Crypto.Protocols.UC.Machine.runFrom_map_state.

Scope #

As in CslibFrontier.Crypto.Protocols.UC.Execution, corruptions are static and budgets count calls, not running time, so these are composition theorems for interaction-bounded, computationally unbounded participants. The composition replaces one subroutine instance whose parties are the parties of ρ, with the same corrupted parties; a fixed number of sessions is handled in CslibFrontier.Crypto.Protocols.UC.MultiSession and dynamic ones are not covered. The corrupted parties of the composed protocol act through the outer router UC.corruptRouter C, and the adversary reaches their subroutine inputs through the routed network port of the subroutine.

The source is the journal version of Canetti's paper [Can20a]. UC.Emulates.compose adapts Theorem 3 in its Section 2.3 (universal composition for the restricted model, where a single session of the subroutine protocol is replaced), and UC.Realizes.compose and UC.Realizes.compose_trans adapt the corollaries (a) and (b) stated after that theorem. The adaptation is to typed machines, one subroutine instance fixed in advance, and statistical security against participants whose calls, not running times, are polynomially bounded. The general theorem of the paper is Theorem 22 of Section 6.1, with Corollaries 23 and 24. Its setting of probabilistic polynomial-time interactive Turing machines (running-time bounds, computational indistinguishability) is not modeled here (#6043), and neither are its dynamic-session premises (a compliant calling protocol, subroutine-respecting and subroutine-exposing protocols, identity-bounded environments) or its operation that replaces many sessions in one step.

Main definitions #

Main results #

References #

Machines that a program passes through #

theorem Cslib.Crypto.Protocols.UC.Machine.runFrom_interpret_of_forward {ιI ιE ιK : Type} {I : ιI → Type} {E : ιE → Type} {K : ιK → Type} {α : Type} (M : Machine I E) (h₁ : (q : ℕ ⊕ ιK) → ProbOracleComp E (probOracleSpec K q)) (h₂ : (q : ℕ ⊕ ιK) → ProbOracleComp I (probOracleSpec K q)) (h : ∀ (q : ℕ ⊕ ιK) (s : M.State), M.runFrom (h₁ q) s = (fun (a : probOracleSpec K q) => (a, s)) <$> h₂ q) (program : ProbOracleComp K α) (s : M.State) :
M.runFrom (OracleComp.interpret h₁ program) s = (fun (a : α) => (a, s)) <$> OracleComp.interpret h₂ program

If a machine answers each replacement call h₁ q by the program h₂ q without changing its state, then it answers every program whose calls are replaced by h₁ by the program whose calls are replaced by h₂, again without changing its state.

Hybrid protocols and subroutine replacement #

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

An n-party protocol in the hybrid model of a subroutine with party inputs SubIn and outputs SubOut: for every security parameter and set of corrupted parties, a machine with a party port and a network port that calls the party port of the subroutine.

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

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

def Cslib.Crypto.Protocols.UC.liftParty {n : ℕ} {In Out NetQ NetR α : Type} (program : ProbOracleComp (partySpec n In Out) α) :
ProbOracleComp (protocolSpec n In Out NetQ NetR) α

A program calling only the party port, as a program calling the ports of a protocol.

def Cslib.Crypto.Protocols.UC.hybridWrap {n : ℕ} {In Out NetQ NetR SubIn SubOut NQ NR : Type} (M : Machine (partySpec n SubIn SubOut) (protocolSpec n In Out NetQ NetR)) :
Machine (protocolSpec n SubIn SubOut NQ NR) (protocolSpec n In Out (NetQ ⊕ NQ) (NetR ⊕ NR))

The machine of a hybrid protocol with its subroutine calls sent to the party port of an imported protocol, whose network port is exposed beside the hybrid protocol's own.

def Cslib.Crypto.Protocols.UC.routeCorrupt {n : ℕ} {In Out NetQ NetR ιI : Type} {I : ιI → Type} (C : Finset (Fin n)) (P : Machine I (protocolSpec n In Out NetQ NetR)) :
Machine I (protocolSpec n In Out (RoutedNetQ n In NetQ) (RoutedNetR Out NetR))

Static-corruption routing in front of a machine that may make calls, as corruptRouter does for closed machines.

def Cslib.Crypto.Protocols.UC.compose {n : ℕ} {In Out NetQ NetR SubIn SubOut NQ NR : Type} (ρ : HybridProtocol n In Out NetQ NetR SubIn SubOut) (σ : Protocol n SubIn SubOut NQ NR) :
Protocol n In Out (NetQ ⊕ RoutedNetQ n SubIn NQ) (NetR ⊕ RoutedNetR SubOut NR)

Subroutine replacement ρ^σ: the hybrid protocol ρ with its subroutine calls answered by the protocol σ behind static-corruption routing, for the same parties and corruptions. The network port of ρ^σ is ρ's network port beside the routed network port of σ, through which the adversary also reaches the party port of σ for corrupted parties.

theorem Cslib.Crypto.Protocols.UC.corruptRouter_comp {n : ℕ} {In Out NetQ NetR ιJ : Type} {J : ιJ → Type} (C : Finset (Fin n)) (M : Machine J (protocolSpec n In Out NetQ NetR)) (P : Machine OracleSpec.empty J) :

Corruption routing in front of a composition routes the outer machine.

The subroutine's environment #

def Cslib.Crypto.Protocols.UC.absorbHybrid {n : ℕ} {In Out NetQ NetR SubIn SubOut NQ NR : Type} (C : Finset (Fin n)) (ρ : HybridProtocol n In Out NetQ NetR SubIn SubOut) (Z : Environment n In Out (RoutedNetQ n In (NetQ ⊕ RoutedNetQ n SubIn NQ)) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR))) :
Environment n SubIn SubOut (RoutedNetQ n SubIn NQ) (RoutedNetR SubOut NR)

The environment of the subroutine that runs the hybrid protocol ρ internally, for the corrupted parties C, together with an environment Z of ρ^σ. It talks to the party port of the subroutine on behalf of ρ and forwards Z's queries for the subroutine's routed network port.

theorem Cslib.Crypto.Protocols.UC.exec_compose_dummy {n : ℕ} {In Out NetQ NetR SubIn SubOut NQ NR : Type} (ρ : HybridProtocol 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 (NetQ ⊕ RoutedNetQ n SubIn NQ)) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR))) (κ : ℕ) (z : List Bool) :
exec (compose ρ π) (dummyAdversary n (RoutedNetQ n In (NetQ ⊕ RoutedNetQ n SubIn NQ)) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR))) C Z κ z = exec π (dummyAdversary n (RoutedNetQ n SubIn NQ) (RoutedNetR SubOut NR)) C (absorbHybrid C ρ Z) κ z

Running ρ^π with the dummy adversary is running π with the dummy adversary and the hybrid protocol absorbed into the environment. This is an equation of programs.

The composed simulator #

def Cslib.Crypto.Protocols.UC.subReply {Out NetR SubOut NR : Type} :
RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR) → RoutedNetR SubOut NR

A reply of the composed network port, read as a reply of the subroutine's routed network port. Replies of ρ's own ports do not occur where it is used.

def Cslib.Crypto.Protocols.UC.outerReply {Out NetR SubOut NR₁ NR₂ : Type} :
RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR₂) → RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR₁)

A reply of ρ^φ's network port to a query for ρ, read as a reply of ρ^π's network port. Replies of the subroutine part do not occur where it is used.

def Cslib.Crypto.Protocols.UC.liftSubNet {n : ℕ} {In Out NetQ NetR SubIn SubOut NQ NR α : Type} (program : ProbOracleComp (netSpec (RoutedNetQ n SubIn NQ) (RoutedNetR SubOut NR)) α) :
ProbOracleComp (netSpec (RoutedNetQ n In (NetQ ⊕ RoutedNetQ n SubIn NQ)) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR))) α

A program calling the subroutine's routed network port, as a program calling the composed network port: the call q becomes .inr (.inr q).

def Cslib.Crypto.Protocols.UC.hybridSimMachine {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 (NetQ ⊕ RoutedNetQ n SubIn NQ₂)) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR₂))) (netSpec (RoutedNetQ n In (NetQ ⊕ RoutedNetQ n SubIn NQ₁)) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR₁)))

The composed simulator's machine: queries for ρ are forwarded, and queries for the subroutine are answered by the subroutine simulator S.

def Cslib.Crypto.Protocols.UC.hybridSim {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 (NetQ ⊕ RoutedNetQ n SubIn NQ₁)) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR₁)) (RoutedNetQ n In (NetQ ⊕ RoutedNetQ n SubIn NQ₂)) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR₂))

The composed simulator for ρ^π against ρ^φ, built from a simulator S for the dummy adversary of π against φ.

Moving the subroutine simulator past the hybrid protocol #

theorem Cslib.Crypto.Protocols.UC.runFrom_query_sample {ιI ιE : Type} {I : ιI → Type} {E : ιE → Type} (M : Machine I E) (k : ℕ) (s : M.State) :

A private sample of a program run against a machine stays a private sample.

Activations, one case at a time #

theorem Cslib.Crypto.Protocols.UC.liftAdversary_handle_inl {n : ℕ} {In Out NetQ NetR AdvQ AdvR : Type} (A : Machine (netSpec NetQ NetR) (netSpec AdvQ AdvR)) (p : Fin n × In) (s : A.State) :
((liftAdversary A).handle (Sum.inl p)).run s = (fun (a : protocolSpec n In Out NetQ NetR (Sum.inl p)) => (a, s)) <$> ProbOracleComp.query (Sum.inl p)
theorem Cslib.Crypto.Protocols.UC.liftAdversary_handle_inr {n : ℕ} {In Out NetQ NetR AdvQ AdvR : Type} (A : Machine (netSpec NetQ NetR) (netSpec AdvQ AdvR)) (q : AdvQ) (s : A.State) :
theorem Cslib.Crypto.Protocols.UC.routeCorrupt_handle_inl {n : ℕ} {In Out NetQ NetR ιI : Type} {I : ιI → Type} (C : Finset (Fin n)) (P : Machine I (protocolSpec n In Out NetQ NetR)) (i : Fin n) (x : In) (s : P.State) :
theorem Cslib.Crypto.Protocols.UC.routeCorrupt_handle_inr_inl {n : ℕ} {In Out NetQ NetR ιI : Type} {I : ιI → Type} (C : Finset (Fin n)) (P : Machine I (protocolSpec n In Out NetQ NetR)) (i : Fin n) (x : In) (s : P.State) :
((routeCorrupt C P).handle (Sum.inr (Sum.inl (i, x)))).run s = if i ∈ C then (fun (p : protocolSpec n In Out NetQ NetR (Sum.inl (i, x)) × P.State) => (Sum.inl p.1, p.2)) <$> (P.handle (Sum.inl (i, x))).run s else pure (Sum.inl none, s)
theorem Cslib.Crypto.Protocols.UC.routeCorrupt_handle_inr_inr {n : ℕ} {In Out NetQ NetR ιI : Type} {I : ιI → Type} (C : Finset (Fin n)) (P : Machine I (protocolSpec n In Out NetQ NetR)) (q : NetQ) (s : P.State) :
((routeCorrupt C P).handle (Sum.inr (Sum.inr q))).run s = (fun (p : protocolSpec n In Out NetQ NetR (Sum.inr q) × P.State) => (Sum.inr p.1, p.2)) <$> (P.handle (Sum.inr q)).run s
theorem Cslib.Crypto.Protocols.UC.liftParty_map {n : ℕ} {In Out NetQ NetR α β : Type} (f : α → β) (program : ProbOracleComp (partySpec n In Out) α) :
liftParty (f <$> program) = f <$> liftParty program

Mapping over a party-interface program commutes with liftParty.

theorem Cslib.Crypto.Protocols.UC.eval_exec_compose_hybridSim {n : ℕ} {In Out NetQ NetR SubIn SubOut NQ₁ NR₁ NQ₂ NR₂ : Type} (ρ : HybridProtocol 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 (NetQ ⊕ RoutedNetQ n SubIn NQ₁)) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR₁))) (κ : ℕ) (z : List Bool) :
(exec (compose ρ φ) (hybridSim S) C Z κ z).eval = (exec φ S C (absorbHybrid C ρ Z) κ z).eval

Running ρ^φ with the composed simulator hybridSim S has the same output distribution as running φ with S and the hybrid protocol absorbed into the environment.

theorem Cslib.Crypto.Protocols.UC.advantage_compose {n : ℕ} {In Out NetQ NetR SubIn SubOut NQ₁ NR₁ NQ₂ NR₂ : Type} (ρ : HybridProtocol 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 (NetQ ⊕ RoutedNetQ n SubIn NQ₁)) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR₁))) (κ : ℕ) (z : List Bool) :
advantage (compose ρ π) (compose ρ φ) (dummyAdversary n (RoutedNetQ n In (NetQ ⊕ RoutedNetQ n SubIn NQ₁)) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR₁))) (hybridSim S) C Z κ z = advantage π φ (dummyAdversary n (RoutedNetQ n SubIn NQ₁) (RoutedNetR SubOut NR₁)) S C (absorbHybrid C ρ Z) κ z

The advantage of an environment against ρ^π with the dummy adversary and ρ^φ with the composed simulator is the advantage of the absorbed environment against π with the dummy adversary and φ with the subroutine simulator.

Budgets #

theorem Cslib.Crypto.Protocols.UC.isQueryBounded_liftParty {n : ℕ} {In Out NetQ NetR α : Type} {program : ProbOracleComp (partySpec n In Out) α} {m : ℕ} (h : OracleComp.IsQueryBounded program m) :

Lifting to the party port makes the same number of calls.

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

Wrapping a hybrid protocol with t calls per activation gives at most t + 1 calls per activation: a query for the subroutine's network port is one call.

theorem Cslib.Crypto.Protocols.UC.isBounded_routeCorrupt {n : ℕ} {In Out NetQ NetR ιI : Type} {I : ιI → Type} (C : Finset (Fin n)) {P : Machine I (protocolSpec n In Out NetQ NetR)} {t : ℕ} (h : P.IsBounded t) :

Corruption routing adds no call.

theorem Cslib.Crypto.Protocols.UC.absorbHybrid_polyBounded {n : ℕ} {In Out NetQ NetR SubIn SubOut NQ NR : Type} (C : Finset (Fin n)) {ρ : HybridProtocol n In Out NetQ NetR SubIn SubOut} {Z : Environment n In Out (RoutedNetQ n In (NetQ ⊕ RoutedNetQ n SubIn NQ)) (RoutedNetR Out (NetR ⊕ RoutedNetR SubOut NR))} {pρ pZ : Polynomial ℕ} (hρ : ρ.PolyBounded pρ) (hZ : Z.PolyBounded pZ) :

Absorbing a hybrid protocol with budget pρ into an environment with budget pZ gives an environment with budget absorbPoly pZ pρ.

theorem Cslib.Crypto.Protocols.UC.hybridSim_polyBounded {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 composed simulator of a subroutine simulator with budget pS has budget pS + 1.

theorem Cslib.Crypto.Protocols.UC.compose_polyBounded {n : ℕ} {In Out NetQ NetR SubIn SubOut NQ NR : Type} {ρ : HybridProtocol n In Out NetQ NetR SubIn SubOut} {σ : Protocol n SubIn SubOut NQ NR} {pρ pσ : Polynomial ℕ} (hρ : ρ.PolyBounded pρ) (hσ : σ.PolyBounded pσ) :
(compose ρ σ).PolyBounded ((pρ + 1) * (pσ + 1) + pσ)

Subroutine replacement preserves polynomial budgets.

The composition theorem #

theorem Cslib.Crypto.Protocols.UC.EmulatesDummyWithin.compose {n : ℕ} {In Out NetQ NetR SubIn SubOut NQ₁ NR₁ NQ₂ NR₂ : Type} {ρ : HybridProtocol n In Out NetQ NetR SubIn SubOut} {π : Protocol n SubIn SubOut NQ₁ NR₁} {φ : Protocol n SubIn SubOut NQ₂ NR₂} {pρ pD : Polynomial ℕ} {ε : Polynomial ℕ → ℕ → NNReal} (hρ : ρ.PolyBounded pρ) (h : EmulatesDummyWithin π φ pD ε) :
EmulatesDummyWithin (UC.compose ρ π) (UC.compose ρ φ) (pD + 1) fun (pZ : Polynomial ℕ) => ε (absorbPoly pZ pρ)

Composition for EmulatesDummyWithin, this library's novel call-bounded, fixed-n-party, port-model emulation of the dummy adversary, a step toward Canetti's computational UC composition theorem but not that theorem (#6043): if S simulates the dummy adversary of π in φ with budget pD and error ε, then the composed simulator simulates the dummy adversary of ρ^π in ρ^φ with budget pD + 1 and error ε evaluated at the absorbed environment's budget absorbPoly pZ pρ.

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

Concrete composition for EmulatesWithin, this library's novel call-bounded, fixed-n-party, port-model emulation notion, a step toward Canetti's computational UC composition theorem but not that theorem (#6043): if π emulates φ with simulator overhead g and error ε, then ρ^π emulates ρ^φ with the overhead below and error ε 1 evaluated at the environment budget that absorbs both the adversary and the hybrid protocol.

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

Composition for Emulates, this library's novel call-bounded, fixed-n-party, port-model emulation notion, which is related to but is not UC emulation (Definition 9 of [Can20a]): a step toward the computational UC composition theorem, Theorem 3 of Section 2.3, but not that theorem (#6043; see the module docstring for the model). If π emulates φ, then ρ^π emulates ρ^φ for every hybrid protocol ρ with a polynomial budget.

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

Replacing an ideal functionality by a protocol that realizes it in the sense of Realizes, this library's novel call-bounded, fixed-n-party, port-model notion: a step after corollary (a) of Theorem 3 of Section 2.3 of [Can20a], not that corollary (#6043). If π realizes F, then ρ^π emulates the F-hybrid protocol ρ^F in the sense of Emulates.

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

Modular protocol design for Realizes, this library's novel call-bounded, fixed-n-party, port-model notion: a step after corollary (b) of Theorem 3 of Section 2.3 of [Can20a], not that corollary (#6043). If ρ^F realizes G in the F-hybrid model and π realizes F, then ρ^π realizes G.

theorem Cslib.Crypto.Protocols.UC.RealizesWithin.compose_trans {n : ℕ} {In Out NetQ NetR SubIn SubOut NQ NR : Type} {ρ : HybridProtocol n In Out NetQ NetR SubIn SubOut} {BackQ BackR GQ GR : Type} {π : Protocol n SubIn SubOut NQ NR} {F : IdealFunctionality n SubIn SubOut BackQ BackR} {G : IdealFunctionality n In Out GQ GR} {pρ g g' : Polynomial ℕ} {ε ε' : Polynomial ℕ → Polynomial ℕ → ℕ → NNReal} (hρ : ρ.PolyBounded pρ) (hπ : RealizesWithin π F g ε) (hρG : RealizesWithin (compose ρ F.toProtocol) G g' ε') (hmono : ∀ (p p' pZ : Polynomial ℕ) (κ : ℕ), (∀ (κ' : ℕ), Polynomial.eval κ' p ≤ Polynomial.eval κ' p') → ε' p pZ κ ≤ ε' p' pZ κ) :
RealizesWithin (compose ρ π) G (g'.comp (Polynomial.X + compSimPoly (g.comp (Polynomial.X + 1) + 1))) fun (pA pZ : Polynomial ℕ) (κ : ℕ) => ε 1 (absorbPoly (absorbPoly pZ pA) pρ) κ + ε' ((compSimPoly (g.comp (Polynomial.X + 1) + 1)).comp (Polynomial.X + pA)) pZ κ

Concrete modular protocol design for RealizesWithin, this library's novel call-bounded, fixed-n-party, port-model notion: a step after corollary (b) of Theorem 3 of Section 2.3 of [Can20a], not that corollary (#6043). If ρ^F realizes G with overhead g' and error ε' (monotone in the adversary's budget), and π realizes F with overhead g and error ε, then ρ^π realizes G.