Documentation

CslibFrontier.Crypto.Protocols.UC.AdaptiveToStatic

Static emulation from adaptive emulation (AdaptiveToStatic) #

Derives .static-mode emulation inside the snapshot router (AdaptiveEmulatesWithin .static, AdaptiveEmulates .static) from .adaptive-mode emulation by clamping adversaries (AdaptiveAdversary.clampStatic) and inspecting post-execution corruption sets via .status (AdaptiveEmulatesWithin.static_of_adaptive, AdaptiveEmulates.static_of_adaptive).

These reductions are a sanity bridge checking consistency between the .adaptive and .static modes inside the snapshot corruption router (UC.Adaptive), rather than a theorem stated in [Can20a]: checking whether the simulator corrupted any party outside A.initial κ costs one environment query, shifting the environment-budget argument in AdaptiveEmulatesWithin from pZ to pZ + 1. Note that .static inside the snapshot router is distinct from ordinary static UC execution (UC.Emulates / UC.exec): in snapshot .static mode, queries .corrupt i for already-corrupted parties i ∈ A.initial κ still return corruption reports (and environments may query .status), whereas Adaptive.lean's static specialization (adaptiveExec_static_ofStatic) relates only an explicitly lifted, report-free static adversary (AdaptiveAdversary.ofStatic) and a status-free static environment (Environment.toAdaptive) and does not translate an arbitrary snapshot simulator into an ordinary static one.

Lifting a private uniform-choice query past adaptivePartySpec n In Out yields the corresponding ProbOracleComp.sample.

def Cslib.Crypto.Protocols.UC.clampNetProgram {n : ℕ} {In Out NetQ NetR View : Type} (C₀ : Finset (Fin n)) {α : Type} (program : ProbOracleComp (netSpec (AdaptiveNetQ n In NetQ) (AdaptiveNetR Out NetR View)) α) :
ProbOracleComp (netSpec (AdaptiveNetQ n In NetQ) (AdaptiveNetR Out NetR View)) α

Rewrite an adaptive network program to drop .corrupt i queries for i ∉ C₀ (returning pure (.corrupt none)), matching .static router behavior.

def Cslib.Crypto.Protocols.UC.AdaptiveAdversary.clampStatic {n : ℕ} {In Out NetQ NetR View AdvQ AdvR : Type} (A : AdaptiveAdversary n In Out NetQ NetR View AdvQ AdvR) :
AdaptiveAdversary n In Out NetQ NetR View AdvQ AdvR

Clamp an adaptive adversary so it drops any .corrupt i query for i ∉ A.initial κ.

theorem Cslib.Crypto.Protocols.UC.AdaptiveAdversary.noNewCorrupt_clampStatic {n : ℕ} {In Out NetQ NetR View AdvQ AdvR : Type} (A : AdaptiveAdversary n In Out NetQ NetR View AdvQ AdvR) :

A clamped adaptive adversary never queries .corrupt i for i ∉ A.initial κ.

theorem Cslib.Crypto.Protocols.UC.AdaptiveAdversary.PolyBounded.clampStatic {n : ℕ} {In Out NetQ NetR View AdvQ AdvR : Type} {A : AdaptiveAdversary n In Out NetQ NetR View AdvQ AdvR} {pA : Polynomial ℕ} (hA : A.PolyBounded pA) :

Clamping an adaptive adversary preserves its call budget.

theorem Cslib.Crypto.Protocols.UC.adaptiveExec_static_clampStatic {n : ℕ} {In Out NetQ NetR View AdvQ AdvR : Type} (P : AdaptiveProtocol n In Out NetQ NetR View) (A : AdaptiveAdversary n In Out NetQ NetR View AdvQ AdvR) (Z : AdaptiveEnvironment n In Out AdvQ AdvR) (κ : ℕ) (z : List Bool) :

Clamping A does not change .static execution.

theorem Cslib.Crypto.Protocols.UC.adaptiveExec_static_eq_adaptive_clampStatic {n : ℕ} {In Out NetQ NetR View AdvQ AdvR : Type} (P : AdaptiveProtocol n In Out NetQ NetR View) (A : AdaptiveAdversary n In Out NetQ NetR View AdvQ AdvR) (Z : AdaptiveEnvironment n In Out AdvQ AdvR) (κ : ℕ) (z : List Bool) :

In .static mode, any adversary A executes identically to A.clampStatic in .adaptive mode.

Closing and evaluating joint router states for static_of_adaptive #

theorem Cslib.Crypto.Protocols.UC.corrupted_subset_of_mem_support_router {n : ℕ} {In Out NetQ NetR View α : Type} (P : AdaptiveProtocol n In Out NetQ NetR View) (κ : ℕ) (C₀ : Finset (Fin n)) (netProg : ProbOracleComp (netSpec (AdaptiveNetQ n In NetQ) (AdaptiveNetR Out NetR View)) α) (rs : AdaptiveRouterState (P.machine κ).State View n) {x : α × AdaptiveRouterState (P.machine κ).State View n} (hx : x ∈ (Machine.closeEval ((adaptiveRouter CorruptionMode.adaptive P κ C₀).runFrom (liftAdaptiveNet netProg) rs)).support) :
rs.corrupted ⊆ x.2.corrupted

Any support state of adaptiveRouter .adaptive P κ C₀ run on liftAdaptiveNet netProg contains the starting corruption set rs.corrupted.

theorem Cslib.Crypto.Protocols.UC.AdaptiveEmulatesWithin.static_of_adaptive {n : ℕ} {In Out NetQ₁ NetR₁ View₁ NetQ₂ NetR₂ View₂ : Type} {P : AdaptiveProtocol n In Out NetQ₁ NetR₁ View₁} {Q : AdaptiveProtocol n In Out NetQ₂ NetR₂ View₂} {g : Polynomial ℕ} {ε : Polynomial ℕ → Polynomial ℕ → ℕ → NNReal} (h : AdaptiveEmulatesWithin CorruptionMode.adaptive P Q g ε) :
AdaptiveEmulatesWithin CorruptionMode.static P Q g fun (pA pZ : Polynomial ℕ) => ε pA (pZ + 1)

Adaptive emulation implies .static-mode emulation inside the snapshot router (sanity bridge, not a theorem of [Canetti2020]; distinct from ordinary static UC.Emulates, since snapshot .static mode still answers .corrupt i for already-corrupted i ∈ A.initial κ with corruption reports). Checking whether the simulator corrupted any party outside A.initial κ via .status costs one environment query, shifting the error's environment-budget argument from pZ to pZ + 1.

theorem Cslib.Crypto.Protocols.UC.AdaptiveEmulates.static_of_adaptive {n : ℕ} {In Out NetQ₁ NetR₁ View₁ NetQ₂ NetR₂ View₂ : Type} {P : AdaptiveProtocol n In Out NetQ₁ NetR₁ View₁} {Q : AdaptiveProtocol n In Out NetQ₂ NetR₂ View₂} (h : AdaptiveEmulates CorruptionMode.adaptive P Q) :

Asymptotic adaptive emulation implies asymptotic .static-mode emulation inside the snapshot router (sanity bridge, not a theorem of [Canetti2020]; distinct from ordinary static UC.Emulates, since snapshot .static mode still returns corruption reports for already-corrupted parties and does not translate arbitrary snapshot simulators to ordinary static ones).