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 #
Cslib.Crypto.Protocols.UC.HybridProtocol,Cslib.Crypto.Protocols.UC.HybridProtocol.PolyBounded: protocols calling a subroutine, and their budgets.Cslib.Crypto.Protocols.UC.routeCorrupt: static-corruption routing for machines with imports.Cslib.Crypto.Protocols.UC.hybridWrap,Cslib.Crypto.Protocols.UC.compose: subroutine replacement.Cslib.Crypto.Protocols.UC.absorbHybrid: the subroutine's environment that runs the hybrid protocol internally.Cslib.Crypto.Protocols.UC.hybridSim: the composed simulator.
Main results #
Cslib.Crypto.Protocols.UC.corruptRouter_comp: routing in front of a composition routes the outer machine.Cslib.Crypto.Protocols.UC.exec_compose_dummy,Cslib.Crypto.Protocols.UC.eval_exec_compose_hybridSim,Cslib.Crypto.Protocols.UC.advantage_compose: absorbing the hybrid protocol into the environment.Cslib.Crypto.Protocols.UC.absorbHybrid_polyBounded,Cslib.Crypto.Protocols.UC.hybridSim_polyBounded,Cslib.Crypto.Protocols.UC.compose_polyBounded: budgets.Cslib.Crypto.Protocols.UC.EmulatesDummyWithin.compose,Cslib.Crypto.Protocols.UC.EmulatesWithin.compose,Cslib.Crypto.Protocols.UC.Emulates.compose: statistical, call-bounded single-subroutine static-corruption composition (#6043).Cslib.Crypto.Protocols.UC.Realizes.compose,Cslib.Crypto.Protocols.UC.Realizes.compose_trans: statistical, call-bounded single-subroutine ideal-functionality replacement (#6043).Cslib.Crypto.Protocols.UC.RealizesWithin.compose_trans: concrete single-subroutine modular ideal-functionality composition (#6043).
References #
- R. Canetti, Universally Composable Security, J. ACM 67(5), Article 28, 2020: Section 2.3 (Theorem 3 and the corollaries after it, with the dummy-adversary proof sketch), which the composition theorems here adapt, and Section 6.1 (Theorem 22 and Corollaries 23 and 24), the general statement whose polynomial-time and dynamic-session premises are not modeled here.
Machines that a program passes through #
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 #
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.
Every activation of the hybrid protocol at security parameter κ makes at most p.eval κ
calls, counting private samples and subroutine calls.
A program calling only the party port, as a program calling the ports of a protocol.
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.
Static-corruption routing in front of a machine that may make calls, as corruptRouter does
for closed machines.
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.
Corruption routing in front of a composition routes the outer machine.
The subroutine's environment #
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.
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 #
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.
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.
A program calling the subroutine's routed network port, as a program calling the composed
network port: the call q becomes .inr (.inr q).
The composed simulator's machine: queries for ρ are forwarded, and queries for the
subroutine are answered by the subroutine simulator S.
The composed simulator for ρ^π against ρ^φ, built from a simulator S for the dummy
adversary of π against φ.
Moving the subroutine simulator past the hybrid protocol #
A private sample of a program run against a machine stays a private sample.
Activations, one case at a time #
Linking a program against X₁.comp Y₁, or against Y₂.comp X₂ with the component state
spaces reversed via fX and fY, gives the same closed behaviour behind any closed machine R,
provided fX <$> X₂.init = X₁.init, fY <$> Y₂.init = Y₁.init, and the activations agree under
(fX s.2, fY s.1).
Running ρ^φ with the composed simulator hybridSim S has the same output distribution as
running φ with S and the hybrid protocol absorbed into the environment.
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 #
Lifting to the party port makes the same number of calls.
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.
Corruption routing adds no call.
Absorbing a hybrid protocol with budget pρ into an environment with budget pZ gives an
environment with budget absorbPoly pZ pρ.
The composed simulator of a subroutine simulator with budget pS has budget pS + 1.
Subroutine replacement preserves polynomial budgets.
The composition theorem #
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ρ.
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.
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.
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.
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.
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.