Documentation

CslibFrontier.Crypto.Protocols.UC.AdaptiveDummyAdversary

The adaptive dummy adversary #

The adaptive dummy adversary UC.adaptiveDummyAdversary forwards every query of the environment to the routed adaptive network port AdaptiveNetQ/AdaptiveNetR—including party inputs, .net network messages, and .corrupt i queries—and returns every reply and CorruptionReport verbatim.

As in the static setting (CslibFrontier.Crypto.Protocols.UC.DummyAdversary), simulating the adaptive dummy adversary suffices for general adaptive UC emulation (UC.adaptiveEmulates_iff_adaptiveEmulatesDummy). The key subtlety relative to static UC is that an AdaptiveAdversary carries its initial corruption set initial : ℕ → Finset (Fin n): since the environment can inspect corrupted via AdaptivePartyQ.status (passed straight through by UC.liftAdaptiveAdversary), UC.AdaptiveEmulatesDummy and UC.AdaptiveEmulatesDummyWithin quantify S_D per C₀ : ℕ → Finset (Fin n) (∀ C₀, ∃ S_D, ...). Given A, composing A on top dummy simulator S_D obtained for C₀ := A.initial yields UC.compAdaptiveSim S_D A with initial := S_D.initial.

Budgets count oracle calls per activation (Cslib.Crypto.Protocols.UC.Machine.IsBounded), not running time; these theorems are call-bounded statistical adaptations of Claim 11 (p. 28:43) of [Can20a] to the snapshot adaptive-corruption model of UC.Adaptive (inspired by Section 7.1.1, p. 28:71; §7.1.1's write-once storage restriction remains open).

Main definitions #

Main results #

References #

Adaptive dummy adversary, black-box simulators, and absorbed environments #

def Cslib.Crypto.Protocols.UC.adaptiveDummyAdversary {n : ℕ} {In Out View : Type} (C₀ : ℕ → Finset (Fin n)) (NetQ NetR : Type) :
AdaptiveAdversary n In Out NetQ NetR View (AdaptiveNetQ n In NetQ) (AdaptiveNetR Out NetR View)

The adaptive dummy adversary with initial corruption set C₀, forwarding all network, party, and .corrupt queries and returning all replies and CorruptionReports verbatim.

def Cslib.Crypto.Protocols.UC.compAdaptiveSim {n : ℕ} {In Out AdvQ AdvR NetQ₁ NetR₁ View₁ NetQ₂ NetR₂ View₂ : Type} (S_D : AdaptiveAdversary n In Out NetQ₂ NetR₂ View₂ (AdaptiveNetQ n In NetQ₁) (AdaptiveNetR Out NetR₁ View₁)) (A : AdaptiveAdversary n In Out NetQ₁ NetR₁ View₁ AdvQ AdvR) :
AdaptiveAdversary n In Out NetQ₂ NetR₂ View₂ AdvQ AdvR

Compose an adversary A on top of a dummy-adversary simulator S_D, inheriting S_D's initial corruption set.

def Cslib.Crypto.Protocols.UC.absorbAdaptiveAdversary {n : ℕ} {In Out NetQ NetR View AdvQ AdvR : Type} (A : AdaptiveAdversary n In Out NetQ NetR View AdvQ AdvR) (Z : AdaptiveEnvironment n In Out AdvQ AdvR) :
AdaptiveEnvironment n In Out (AdaptiveNetQ n In NetQ) (AdaptiveNetR Out NetR View)

Absorb an adaptive adversary A into the environment Z. Party and .status queries from Z pass through unchanged to adaptiveRouter.

@[simp]
theorem Cslib.Crypto.Protocols.UC.adaptiveExec_dummyAdversary {n : ℕ} {In Out NetQ NetR View : Type} (mode : CorruptionMode) (P : AdaptiveProtocol n In Out NetQ NetR View) (C₀ : ℕ → Finset (Fin n)) (Z : AdaptiveEnvironment n In Out (AdaptiveNetQ n In NetQ) (AdaptiveNetR Out NetR View)) (κ : ℕ) (z : List Bool) :
adaptiveExec mode P (adaptiveDummyAdversary C₀ NetQ NetR) Z κ z = (adaptiveRouter mode P κ (C₀ κ)).run (Z κ z)

Running the adaptive execution with adaptiveDummyAdversary runs Z directly against adaptiveRouter.

theorem Cslib.Crypto.Protocols.UC.adaptiveExec_eq_adaptiveExec_dummy {n : ℕ} {In Out NetQ NetR View AdvQ AdvR : Type} (mode : CorruptionMode) (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) :
adaptiveExec mode P A Z κ z = adaptiveExec mode P (adaptiveDummyAdversary A.initial NetQ NetR) (absorbAdaptiveAdversary A Z) κ z

Running any adaptive adversary A with Z equals running adaptiveDummyAdversary with initial set A.initial against the absorbed environment absorbAdaptiveAdversary A Z.

theorem Cslib.Crypto.Protocols.UC.adaptiveExec_compAdaptiveSim {n : ℕ} {In Out AdvQ AdvR NetQ₁ NetR₁ View₁ NetQ₂ NetR₂ View₂ : Type} (mode : CorruptionMode) (Q : AdaptiveProtocol n In Out NetQ₂ NetR₂ View₂) (S_D : AdaptiveAdversary n In Out NetQ₂ NetR₂ View₂ (AdaptiveNetQ n In NetQ₁) (AdaptiveNetR Out NetR₁ View₁)) (A : AdaptiveAdversary n In Out NetQ₁ NetR₁ View₁ AdvQ AdvR) (Z : AdaptiveEnvironment n In Out AdvQ AdvR) (κ : ℕ) (z : List Bool) :
adaptiveExec mode Q (compAdaptiveSim S_D A) Z κ z = adaptiveExec mode Q S_D (absorbAdaptiveAdversary A Z) κ z

Running compAdaptiveSim S_D A with Z equals running S_D with the absorbed environment absorbAdaptiveAdversary A Z.

theorem Cslib.Crypto.Protocols.UC.adaptiveAdvantage_compAdaptiveSim {n : ℕ} {In Out AdvQ AdvR NetQ₁ NetR₁ View₁ NetQ₂ NetR₂ View₂ : Type} (mode : CorruptionMode) (P : AdaptiveProtocol n In Out NetQ₁ NetR₁ View₁) (Q : AdaptiveProtocol n In Out NetQ₂ NetR₂ View₂) (S_D : AdaptiveAdversary n In Out NetQ₂ NetR₂ View₂ (AdaptiveNetQ n In NetQ₁) (AdaptiveNetR Out NetR₁ View₁)) (A : AdaptiveAdversary n In Out NetQ₁ NetR₁ View₁ AdvQ AdvR) (Z : AdaptiveEnvironment n In Out AdvQ AdvR) (κ : ℕ) (z : List Bool) :
adaptiveAdvantage mode P Q A (compAdaptiveSim S_D A) Z κ z = adaptiveAdvantage mode P Q (adaptiveDummyAdversary A.initial NetQ₁ NetR₁) S_D (absorbAdaptiveAdversary A Z) κ z

Advantage of Z against (P, A) and (Q, compAdaptiveSim S_D A) equals the advantage of absorbAdaptiveAdversary A Z against (P, adaptiveDummyAdversary A.initial) and (Q, S_D).

@[simp]
theorem Cslib.Crypto.Protocols.UC.absorbAdaptiveAdversary_dummy {n : ℕ} {In Out View : Type} (C₀ : ℕ → Finset (Fin n)) (NetQ NetR : Type) (Z : AdaptiveEnvironment n In Out (AdaptiveNetQ n In NetQ) (AdaptiveNetR Out NetR View)) :

Absorbing the dummy adversary leaves an environment unchanged.

Budgets #

theorem Cslib.Crypto.Protocols.UC.adaptiveDummyAdversary_polyBounded {n : ℕ} {In Out View : Type} (C₀ : ℕ → Finset (Fin n)) (NetQ NetR : Type) :

The adaptive dummy adversary makes at most one call per activation.

theorem Cslib.Crypto.Protocols.UC.compAdaptiveSim_polyBounded {n : ℕ} {In Out AdvQ AdvR NetQ₁ NetR₁ View₁ NetQ₂ NetR₂ View₂ : Type} {S_D : AdaptiveAdversary n In Out NetQ₂ NetR₂ View₂ (AdaptiveNetQ n In NetQ₁) (AdaptiveNetR Out NetR₁ View₁)} {A : AdaptiveAdversary n In Out NetQ₁ NetR₁ View₁ AdvQ AdvR} {pD pA : Polynomial ℕ} (hS : S_D.PolyBounded pD) (hA : A.PolyBounded pA) :
(compAdaptiveSim S_D A).PolyBounded (pA * (pD + 1) + pD)

Composing A (budget pA) on top of S_D (budget pD) gives budget pA * (pD + 1) + pD.

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

Absorbing an adaptive adversary with budget pA into an environment with budget pZ gives budget absorbPoly pZ pA.

Completeness of the adaptive dummy adversary #

def Cslib.Crypto.Protocols.UC.AdaptiveEmulatesDummyWithin {n : ℕ} {In Out NetQ₁ NetR₁ View₁ NetQ₂ NetR₂ View₂ : Type} (mode : CorruptionMode) (P : AdaptiveProtocol n In Out NetQ₁ NetR₁ View₁) (Q : AdaptiveProtocol n In Out NetQ₂ NetR₂ View₂) (pD : Polynomial ℕ) (ε : Polynomial ℕ → ℕ → NNReal) :

Concrete emulation of the adaptive dummy adversary under mode in the snapshot adaptive-corruption model of UC.Adaptive (statistical, call-bounded adaptation of [Can20a], Definition 10 and Claim 11, p. 28:43; §7.1.1 write-once storage remains open): for every initial corruption schedule C₀, there exists a simulator S_D with call budget pD such that every environment Z with budget pZ has advantage at most ε pZ κ. Quantifying C₀ outside S_D lets S_D.initial match C₀, which .status makes observable.

theorem Cslib.Crypto.Protocols.UC.AdaptiveEmulatesDummyWithin.emulatesWithin {n : ℕ} {In Out NetQ₁ NetR₁ View₁ NetQ₂ NetR₂ View₂ : Type} {mode : CorruptionMode} {P : AdaptiveProtocol n In Out NetQ₁ NetR₁ View₁} {Q : AdaptiveProtocol n In Out NetQ₂ NetR₂ View₂} {pD : Polynomial ℕ} {ε : Polynomial ℕ → ℕ → NNReal} (h : AdaptiveEmulatesDummyWithin mode P Q pD ε) :
AdaptiveEmulatesWithin mode P Q (compSimPoly pD) fun (pA pZ : Polynomial ℕ) => ε (absorbPoly pZ pA)

Completeness of the adaptive dummy adversary (concrete): simulating the dummy adversary implies general adaptive emulation with simulator overhead compSimPoly pD and error evaluated at the absorbed environment budget absorbPoly pZ pA.

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

Concrete adaptive emulation implies concrete dummy-adversary emulation with budget g.comp (X + 1).

def Cslib.Crypto.Protocols.UC.AdaptiveEmulatesDummy {n : ℕ} {In Out NetQ₁ NetR₁ View₁ NetQ₂ NetR₂ View₂ : Type} (mode : CorruptionMode) (P : AdaptiveProtocol n In Out NetQ₁ NetR₁ View₁) (Q : AdaptiveProtocol n In Out NetQ₂ NetR₂ View₂) :

Negligible-error emulation of the adaptive dummy adversary under mode in the snapshot adaptive-corruption model of UC.Adaptive (statistical, call-bounded adaptation of [Can20a], Claim 11, p. 28:43; §7.1.1 write-once storage remains open).

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

Completeness of the adaptive dummy adversary (negligible error) in the snapshot adaptive-corruption model of UC.Adaptive: adaptive UC emulation is equivalent to simulating the adaptive dummy adversary (call-bounded adaptation of [Can20a], Claim 11, p. 28:43).