Robust Compilation (RC), RHP, and the UC = RC Equivalence #
This file defines three notions of security preservation and establishes their relationships at Level 1 (information-theoretic, no complexity bounds).
Three notions of robust compilation #
RobustCompilation(our notion, no simulator):∀ ρ D, sdist(D∘ρ∘π, D∘ρ∘F) ≤ εEquivalent tosdist ≤ εandContextEquiv ε.RHP(paper's notion, with simulator):∀A ∃S, RobustCompilation ε (bind π (mapSum pure A)) (bind F (mapSum pure S))Equivalent toUCEmulates ε. Reference: Patrignani, Wahby et al., "UC is RC", TOPLAS 2024.UCEmulates(Canetti-style):∀A ∃S, sdist(bind π (mapSum pure A), bind F (mapSum pure S)) ≤ ε
Relationship diagram #
sdist ≤ ε ↔ ContextEquiv ε ↔ RobustCompilation ε (no simulator)
↓ (one direction only: take S = A)
UCEmulates ε ↔ RHP ε (with ∃ simulator)
The downward arrow is strict: UC/RHP is strictly weaker than sdist/RC.
Counterexample: π = pure(.inr true), F = pure(.inr false),
S = fun b => pure (not b) gives UC with ε = 0 but sdist π F > 0.
Main definitions #
compile— substitute a subroutine implementation into a protocolContextEquiv— contextual equivalence (all distinguishers bounded)RobustCompilation— RC without simulator: all contexts boundedRHP— RC with simulator: paper's "Robust Hyperproperties Preservation"
Main results #
contextEquiv_iff_sdist—ContextEquiv ε ↔ sdist ≤ εRC_iff_sdist—RobustCompilation ε ↔ sdist ≤ εUCEmulates_iff_RHP—UCEmulates ε ↔ RHP ε(the paper's main theorem)sdist_implies_UCEmulates—sdist ≤ ε → UCEmulates ε(one direction)RC_implies_UCEmulates—RC → UC(same-interface)sdist_mapSum_le— coproduct tensor:max(ε₁, ε₂)bound
Sub-SMC structure #
Our RobustCompilation (equivalently, sdist) forms a wide sub-SMC of
Kl(SPComp) via sdist_comp_add (composition) and sdist_mapSum_le (tensor).
UC/RHP inherits this structure in the same-interface case (leak = sim_if)
via UCEmulates_trans (simulator chaining) and UCEmulates_of_sdist.
For the general case (different interfaces), the categorical structure is
richer and involves simulator composition — a 2-categorical notion.
Compile #
Substitute subroutine impl into protocol ρ:
compile ρ impl = (id ⊕ impl) ∘ₖ ρ.
Equations
- CatCrypt.Crypto.compile ρ impl a = (ρ a).bind (CatCrypt.Crypto.mapSum CatCrypt.Core.SPComp.pure impl)
Instances For
Contextual Equivalence #
Two morphisms are ε-contextually equivalent if no closing context
(distinguisher D : β → SPComp Bool) can distinguish them by more than ε.
Equations
- CatCrypt.Crypto.ContextEquiv ε f g = ∀ (D : β → CatCrypt.Core.SPComp Bool), (CatCrypt.Crypto.sdist (fun (a : α) => (f a).bind D) fun (a : α) => (g a).bind D) ≤ ε
Instances For
sdist ≤ ε → ContextEquiv ε via right PPL.
ContextEquiv ε → sdist ≤ ε: the identity distinguisher witnesses the bound.
For any f g : α → SPComp β, sdist f g = sup_D sdist (D ∘ f) (D ∘ g).
When β = Bool, D = pure gives sdist (pure ∘ f) (pure ∘ g) = sdist f g
(by bind_pure). For general β, the sdist already takes the sup over D.
Contextual equivalence iff bounded sdist.
Robust Compilation #
Robust Compilation: replacing subroutine F with π preserves security
in ALL contexts ρ and for ALL distinguishers.
Equations
- One or more equations did not get rendered due to their size.
Instances For
sdist ≤ ε → RC: both PPLs give the bound.
RC → sdist ≤ ε: specialize to ρ = pure (identity context).
RC ↔ sdist ≤ ε.
UC from sdist (Same Interface) #
sdist → UC (same-interface): the simulator is the adversary.
When sdist π F ≤ ε, UC emulation holds with S = A for any adversary A.
The reverse implication is FALSE: UC emulation allows the simulator
to transform F's leak channel, so ∃ S, sdist π (bind F (mapSum pure S)) ≤ ε
does not imply sdist π F ≤ ε.
RC → UC (same-interface): since RC ↔ sdist, RC also implies UC.
Robust Hyperproperties Preservation (RHP) #
The paper "Universal Composability is Robust Compilation" (Patrignani, Wahby et al., 2024)
defines a different notion of Robust Compilation that includes an existential simulator.
We call this RHP (Robust Hyperproperties Preservation) to distinguish it from our
simulator-free RobustCompilation.
The key difference:
- Our
RobustCompilation:∀ ρ D, dist(D∘ρ∘π, D∘ρ∘F) ≤ ε(no simulator) - Paper's RHP:
∀A ∃S, ∀ ρ D, dist(D∘ρ∘(id⊕A)∘π, D∘ρ∘(id⊕S)∘F) ≤ ε
Since RobustCompilation ↔ sdist (our RC_iff_sdist), RHP reduces to:
∀A ∃S, sdist(bind π (mapSum pure A), bind F (mapSum pure S)) ≤ ε,
which is exactly UCEmulates. Hence UC ↔ RHP at Level 1.
The relationship diagram:
sdist ≤ ε ↔ ContextEquiv ε ↔ RobustCompilation ε (no simulator)
↓ (one direction only: take S = A)
UCEmulates ε ↔ RHP ε (with ∃ simulator)
Robust Hyperproperties Preservation: the paper's notion of Robust Compilation.
Unlike our RobustCompilation (which has no simulator), RHP includes an
existential simulator (∀A ∃S), matching the quantifier structure of UC.
RHP says: for all adversaries A, there exists a simulator S such that the post-adversary views are robustly equivalent in ALL contexts.
Reference: Patrignani, Wahby et al., "Universal Composability is Robust Compilation", TOPLAS 2024.
Equations
- One or more equations did not get rendered due to their size.
Instances For
UC → RHP: UC gives sdist ≤ ε, then RC_of_sdist lifts to all contexts.
RHP → UC: specializing the RHP contexts recovers sdist ≤ ε.
UC ↔ RHP at Level 1 (information-theoretic).
This is the main theorem of Patrignani, Wahby et al. (2024): "Universal Composability is Robust Compilation".
At Level 1 (no complexity bounds), the equivalence is immediate because
RobustCompilation ↔ sdist (our RC_iff_sdist), so the ∀-context
quantification in RHP adds no strength beyond sdist.
At computational levels (Level 2/3), RHP quantifies over poly-time contexts while sdist takes a sup over ALL distinguishers. The equivalence then requires the dummy adversary theorem and becomes non-trivial.
Tensor Distance Bounds #
For coproduct tensor: distance is max, not sum, since only one branch runs.
Sequential and Parallel Composition of RC #
Sequential composition (transitivity) of robust compilation.
If π₁ ≈_{ε₁} π₂ and π₂ ≈_{ε₂} π₃, then π₁ ≈_{ε₁+ε₂} π₃.
Proof: RC ↔ sdist + triangle inequality.
Parallel composition of robust compilation via coproduct tensor.
The max bound (not sum!) reflects the coproduct structure: each input activates exactly one sub-protocol, so the distances don't accumulate.
Parallel UC Composition #
Parallel composition of UC-secure protocols (same-interface case).
Given sdist bounds for two protocols, the parallel composition mapSum π₁ π₂
UC-emulates mapSum F₁ F₂ with error max(ε₁, ε₂).
The max bound (not sum!) reflects the coproduct structure: each input activates exactly one sub-protocol, so the distances don't accumulate.
The UC spec treats the combined output β₁ ⊕ β₂ as the leak interface
(same-interface: leak = sim_if), with Unit as the honest output.
Practical use: Multi-instance security (n copies of a protocol), or independent sub-protocols running on disjoint message types.