Contextual emulation and UC security #
This file defines the core judgments for Universally Composable (UC) security
at the abstract OpenTheory level.
Main definitions #
Observation Tbundles a binary relation on closed systems together with a proof that it is an equivalence relation. UC judgments are parameterized uniformly overObservation Tso that reflexivity, symmetry, and transitivity are always available without per-call hypotheses.Emulates real ideal Obssays that the open systemrealemulatesidealwhenever, for every valid plug (context), the resulting closed systems are related byObs.rel.UCSecure protocol ideal Obs SimSpace simulateis the existential simulator variant: there exists a simulator that transforms any context so that the closed ideal system (with the simulated context) isObs.rel-related to the closed real system.
The canonical Observation.eq T instantiates the framework with perfect
syntactic equality on closed systems; downstream layers (e.g. open process
isos, asymptotic computational indistinguishability) supply their own
Observation constructors.
Basic properties #
Emulates.reflandEmulates.transare immediate consequences of the bundledEquivalenceproof inObservation.Emulates.map_invarianceshows that adapting both sides of an emulation along the same boundary morphism preserves the emulation (requires a lawful theory).Emulates.plug_invarianceshows that plugging both sides of an emulation with the same additional context preserves the emulation.
UC composition theorems #
Emulates.par_compose: parallel composition preserves emulation.Emulates.wire_compose: wired composition preserves emulation.Emulates.plug_compose: both protocol and environment emulation compose to yield observational equivalence of the closed systems.
These rely on structural factorization lemmas
(close_par_left, close_par_right, close_wire_left,
close_wire_right, plug_comm) that capture monoidal coherence
identities, derived from the CompactClosed axioms.
Design note: why Observation requires a full Equivalence #
Bundling the equivalence proof into Observation lets every UC theorem
quantify over a single parameter Obs : Observation T rather than threading
a relation plus separate hRefl/hTrans/hSymm hypotheses. The cost is
that observation relations which are not equivalences (e.g. the fixed-ε
computational distinguishability relation
fun c₁ c₂ => distAdvantage (sem c₁) (sem c₂) ≤ ε, which fails transitivity
because the triangle inequality only gives 2ε) cannot be packaged as
Observation T. The intended bridge from computational security to abstract
Emulates therefore lives at the asymptotic level (where negligible
distance is closed under sums and is a genuine equivalence), not at the
fixed-ε level.
Observation T bundles a binary relation on the closed systems of an open
theory T together with a proof that it is an equivalence relation.
This is the parameter slot through which different security flavors
(perfect, statistical, asymptotic computational) plug into the abstract UC
judgments Emulates and UCSecure.
The underlying binary relation on closed systems.
- equiv : Equivalence self.rel
The relation is an equivalence (reflexive, symmetric, transitive).
Instances For
Perfect syntactic equality on closed systems is an observation relation.
Instances For
Emulates real ideal Obs asserts that real contextually emulates
ideal in the open-composition theory T, judged by the observation
relation Obs : Observation T.
For every plug K : T.Plug Δ, the closed compositions T.close real K
and T.close ideal K are related by Obs.rel.
This is the definitional core of UC security: no environment can
distinguish real from ideal under the chosen observation.
Instances For
Every open system emulates itself.
Emulation is symmetric.
Emulation composes transitively.
Adapting both sides of an emulation along the same boundary morphism
preserves the emulation, provided the theory has lawful map and plug.
The key identity used is plug (map f W) K = plug W (map (swap f) K),
which is the map_plug naturality law.
Plugging both sides of an emulation with the same additional context preserves the emulation.
If real emulates ideal and we close both against the same plug K,
the resulting closed systems are still observationally equivalent. This is
immediate from the definition.
Structural factorization of close under composition #
The effective plug for the left component of a parallel composition.
Given W₂ : T.Obj Δ₂ and K : T.Plug (tensor Δ₁ Δ₂), wire them
together through the Δ₂ boundary to obtain a plug for Δ₁ alone.
Instances For
The effective plug for the right component of a parallel composition.
Given W₁ : T.Obj Δ₁ and K : T.Plug (tensor Δ₁ Δ₂), wire them
together through the Δ₁ boundary to obtain a plug for Δ₂ alone.
Instances For
Closing a parallel composition factors through the left component.
This captures the string-diagram identity: plugging par W₁ W₂ against
K is the same as plugging W₁ against the residual context formed by
wiring W₂ into K.
Closing a parallel composition factors through the right component.
The effective plug for the left factor of a wiring.
Given W₂ : T.Obj (tensor (swap Γ) Δ₂) and
K : T.Plug (tensor Δ₁ Δ₂), wire them together through the Δ₂
boundary to obtain a plug for tensor Δ₁ Γ.
Instances For
The effective plug for the right factor of a wiring.
Given W₁ : T.Obj (tensor Δ₁ Γ) and K : T.Plug (tensor Δ₁ Δ₂),
wire them together through the Δ₁ boundary to obtain a plug for
tensor (swap Γ) Δ₂.
Instances For
Closing a wired composition factors through the left component.
Closing a wired composition factors through the right component.
plug is symmetric: the protocol and context roles are interchangeable.
This follows from plug_eq_wire plus commutativity of wire via
par_comm.
UC composition theorems #
Replacing the left component of a parallel composition preserves emulation, with the right component and environment held fixed.
Replacing the right component of a parallel composition preserves emulation, with the left component and environment held fixed.
UC composition theorem for par: if each component emulates its
ideal, then their parallel composition emulates the parallel composition
of ideals.
The proof uses a hybrid argument through T.par ideal₁ real₂, with
each step reducing to emulation of a single component via
close_par_left / close_par_right.
Replacing the left factor of a wiring preserves emulation.
Replacing the right factor of a wiring preserves emulation.
UC composition theorem for wire: if each factor emulates its
ideal, then their wired composition emulates the wired ideal.
Replacing the plug (environment) while keeping the protocol fixed
preserves observational equivalence, using plug_comm to swap
the protocol/environment roles.
UC composition theorem for plug: if the protocol emulates its
ideal and the environment emulates its ideal, then the closed real-world
execution is observationally equivalent to the closed ideal-world
execution.
The proof uses a hybrid through T.close ideal K_real:
step 1 is plug_invariance (same environment, different protocol) and
step 2 is plug_right (same protocol, different environment).
UCSecure protocol ideal Obs SimSpace simulate is the UC security statement
with an existential simulator.
There exists a simulator parameter s : SimSpace such that for every
context K, the closed real-world execution T.close protocol K is
related (under Obs.rel) to the closed ideal-world execution
T.close ideal (simulate s K).
The simulator simulate s transforms the context rather than the ideal
functionality, following the standard UC convention: the simulator acts as
a wrapper around the honest context to make the ideal world look like the
real world.
Instances For
Emulation implies UC security with the trivial (identity) simulator.
UC security with identity simulation recovers emulation.