Documentation

CslibFrontier.Crypto.Protocols.UC.DummyAdversary

The dummy adversary #

The dummy adversary UC.dummyAdversary forwards every query of the environment to the network port and every reply back. It suffices to simulate the dummy adversary: a simulator S_D for it yields, for every adversary A, the black-box simulator UC.compSim S_D A that runs A on top of S_D. The reason is an exact identity of executions: running A with environment Z is running the dummy adversary with the environment UC.absorbAdversary C A Z that runs A internally (UC.exec_eq_exec_dummy), and likewise running UC.compSim S_D A with Z is running S_D with the absorbed environment (UC.exec_compSim). Both identities are equations of programs, by associativity of linking (Cslib.Crypto.Protocols.UC.Machine.link_comp).

With call budgets, absorbing an adversary with budget pA into an environment with budget pZ gives an environment with budget UC.absorbPoly pZ pA = pA + 1 + pZ * (pA + 2), and the black-box simulator has budget pA * (pD + 1) + pD, which is bounded by UC.compSimPoly pD = X * (pD + 1) + pD at κ + pA κ. Hence concrete emulation of the dummy adversary (UC.EmulatesDummyWithin) implies concrete emulation (UC.EmulatesDummyWithin.emulatesWithin) with the error evaluated at the absorbed environment budget, and conversely (UC.EmulatesWithin.emulatesDummyWithin). Black-box emulation (UC.EmulatesBlackBoxWithin), with one simulator S_D used as UC.compSim S_D A for every adversary, sits between the two. With negligible error, simulating the dummy adversary (UC.EmulatesDummy) is equivalent to emulation (UC.emulates_iff_emulatesDummy).

Budgets count calls (Cslib.Crypto.Protocols.UC.Machine.IsBounded); they bound interaction, not running time.

Main definitions #

Main results #

References #

Dummy adversary, black-box simulators and absorbed environments #

def Cslib.Crypto.Protocols.UC.dummyAdversary (n : ℕ) (NetQ NetR : Type) :
Adversary n NetQ NetR NetQ NetR

The dummy adversary forwards the environment's queries to the network port.

def Cslib.Crypto.Protocols.UC.compSim {n : ℕ} {NetQ NetR AdvQ AdvR BackQ BackR : Type} (S_D : Adversary n NetQ NetR BackQ BackR) (A : Adversary n AdvQ AdvR NetQ NetR) :
Adversary n AdvQ AdvR BackQ BackR

The black-box simulator: the adversary A run on top of a simulator S_D for the dummy adversary.

def Cslib.Crypto.Protocols.UC.absorbAdversary {n : ℕ} {In Out NetQ NetR AdvQ AdvR : Type} (C : Finset (Fin n)) (A : Adversary n AdvQ AdvR NetQ NetR) (Z : Environment n In Out AdvQ AdvR) :
Environment n In Out NetQ NetR

The environment that runs the adversary A internally, for the corrupted parties C, and talks to the network through the dummy adversary.

@[simp]
theorem Cslib.Crypto.Protocols.UC.exec_dummyAdversary {n : ℕ} {In Out NetQ NetR : Type} (π : Protocol n In Out NetQ NetR) (C : Finset (Fin n)) (Z : Environment n In Out (RoutedNetQ n In NetQ) (RoutedNetR Out NetR)) (κ : ℕ) (z : List Bool) :
exec π (dummyAdversary n (RoutedNetQ n In NetQ) (RoutedNetR Out NetR)) C Z κ z = (corruptRouter C (π κ C)).run (Z κ z)

Running the UC execution with dummyAdversary is running the environment directly against corruptRouter C (π κ C).

theorem Cslib.Crypto.Protocols.UC.exec_eq_exec_dummy {n : ℕ} {In Out NetQ NetR AdvQ AdvR : Type} (π : Protocol n In Out NetQ NetR) (A : ExecAdversary n In Out NetQ NetR AdvQ AdvR) (C : Finset (Fin n)) (Z : Environment n In Out AdvQ AdvR) (κ : ℕ) (z : List Bool) :
exec π A C Z κ z = exec π (dummyAdversary n (RoutedNetQ n In NetQ) (RoutedNetR Out NetR)) C (absorbAdversary C A Z) κ z

Running an adversary is running the dummy adversary with the adversary absorbed into the environment.

theorem Cslib.Crypto.Protocols.UC.exec_compSim {n : ℕ} {In Out NetQ₁ NetR₁ NetQ₂ NetR₂ AdvQ AdvR : Type} (φ : Protocol n In Out NetQ₂ NetR₂) (S_D : Adversary n (RoutedNetQ n In NetQ₁) (RoutedNetR Out NetR₁) (RoutedNetQ n In NetQ₂) (RoutedNetR Out NetR₂)) (A : ExecAdversary n In Out NetQ₁ NetR₁ AdvQ AdvR) (C : Finset (Fin n)) (Z : Environment n In Out AdvQ AdvR) (κ : ℕ) (z : List Bool) :
exec φ (compSim S_D A) C Z κ z = exec φ S_D C (absorbAdversary C A Z) κ z

Running the black-box simulator is running the dummy-adversary simulator with the adversary absorbed into the environment.

@[simp]
theorem Cslib.Crypto.Protocols.UC.absorbAdversary_dummy {n : ℕ} {In Out NetQ NetR : Type} (C : Finset (Fin n)) (Z : Environment n In Out NetQ NetR) :
absorbAdversary C (dummyAdversary n NetQ NetR) Z = Z

Absorbing the dummy adversary leaves the environment unchanged.

theorem Cslib.Crypto.Protocols.UC.advantage_compSim {n : ℕ} {In Out NetQ₁ NetR₁ NetQ₂ NetR₂ AdvQ AdvR : Type} (π : Protocol n In Out NetQ₁ NetR₁) (φ : Protocol n In Out NetQ₂ NetR₂) (S_D : Adversary n (RoutedNetQ n In NetQ₁) (RoutedNetR Out NetR₁) (RoutedNetQ n In NetQ₂) (RoutedNetR Out NetR₂)) (A : ExecAdversary n In Out NetQ₁ NetR₁ AdvQ AdvR) (C : Finset (Fin n)) (Z : Environment n In Out AdvQ AdvR) (κ : ℕ) (z : List Bool) :
advantage π φ A (compSim S_D A) C Z κ z = advantage π φ (dummyAdversary n (RoutedNetQ n In NetQ₁) (RoutedNetR Out NetR₁)) S_D C (absorbAdversary C A Z) κ z

The advantage against an adversary and its black-box simulator is the advantage against the dummy adversary and the core simulator, for the absorbed environment.

theorem Cslib.Crypto.Protocols.UC.advantage_compSim_dummy {n : ℕ} {In Out NetQ₁ NetR₁ NetQ₂ NetR₂ : Type} (π : Protocol n In Out NetQ₁ NetR₁) (φ : Protocol n In Out NetQ₂ NetR₂) (S_D : Adversary n (RoutedNetQ n In NetQ₁) (RoutedNetR Out NetR₁) (RoutedNetQ n In NetQ₂) (RoutedNetR Out NetR₂)) (C : Finset (Fin n)) (Z : Environment n In Out (RoutedNetQ n In NetQ₁) (RoutedNetR Out NetR₁)) (κ : ℕ) (z : List Bool) :
advantage π φ (dummyAdversary n (RoutedNetQ n In NetQ₁) (RoutedNetR Out NetR₁)) (compSim S_D (dummyAdversary n (RoutedNetQ n In NetQ₁) (RoutedNetR Out NetR₁))) C Z κ z = advantage π φ (dummyAdversary n (RoutedNetQ n In NetQ₁) (RoutedNetR Out NetR₁)) S_D C Z κ z

The black-box simulator for the dummy adversary is the core simulator.

Budgets #

The budget pA + 1 + pZ * (pA + 2) of an environment with budget pZ that absorbs an adversary with budget pA.

The absorbed budget is monotone in both budgets.

Library infrastructure (no cited result): the call-budget overhead X * (pD + 1) + pD of the black-box simulator compSim S_D A on a core simulator with budget pD, as a polynomial in κ + pA κ.

Library infrastructure (no cited result): the black-box simulator overhead is monotone in the core budget.

The dummy adversary makes one call per activation.

theorem Cslib.Crypto.Protocols.UC.compSim_polyBounded {n : ℕ} {NetQ NetR AdvQ AdvR BackQ BackR : Type} {S_D : Adversary n NetQ NetR BackQ BackR} {A : Adversary n AdvQ AdvR NetQ NetR} {pD pA : Polynomial ℕ} (hS : S_D.PolyBounded pD) (hA : A.PolyBounded pA) :
(compSim S_D A).PolyBounded (pA * (pD + 1) + pD)

The black-box simulator of an adversary with budget pA on a core simulator with budget pD has budget pA * (pD + 1) + pD.

The black-box simulator's budget is bounded by compSimPoly pD at κ + pA κ.

theorem Cslib.Crypto.Protocols.UC.absorbAdversary_polyBounded {n : ℕ} {In Out NetQ NetR AdvQ AdvR : Type} (C : Finset (Fin n)) {A : Adversary n AdvQ AdvR NetQ NetR} {Z : Environment n In Out AdvQ AdvR} {pA pZ : Polynomial ℕ} (hA : A.PolyBounded pA) (hZ : Z.PolyBounded pZ) :

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

Emulation of the dummy adversary and black-box emulation #

def Cslib.Crypto.Protocols.UC.EmulatesDummyWithin {n : ℕ} {In Out NetQ₁ NetR₁ NetQ₂ NetR₂ : Type} (π : Protocol n In Out NetQ₁ NetR₁) (φ : Protocol n In Out NetQ₂ NetR₂) (pD : Polynomial ℕ) (ε : Polynomial ℕ → ℕ → NNReal) :

Concrete emulation of the dummy adversary: a simulator with budget pD such that every environment with budget pZ distinguishes π with the dummy adversary from φ with the simulator with advantage at most ε pZ κ, whatever the corrupted parties.

Source. This is UC emulation with respect to the dummy adversary of [Can20a] (Cryptology ePrint Archive 2000/067, revision of February 11, 2020), Definition 10, p. 44, whose Claim 11 on the same page shows it equivalent to UC emulation (here emulates_iff_emulatesDummy), stated with an explicit simulator budget pD and error ε as in Definition 15, p. 51. It differs from the source as EmulatesWithin does: call budgets in place of running time, with otherwise unbounded computation (the statistical setting of Section 4.4, p. 50); static corruptions; no identity bound on environments; a fixed set of n parties; and a bound at every κ and for every auxiliary input. Like EmulatesWithin, it is novel to this library: it is not source-identical, and no implication to or from the source's notion is established here. It is equivalent to EmulatesWithin up to budgets and errors (EmulatesDummyWithin.emulatesWithin, EmulatesWithin.emulatesDummyWithin), as Claim 11 is for the source's notions, so it is plausible for the same reasons; not_emulatesDummyWithin_fcom gives plain commitment schemes that fail it.

def Cslib.Crypto.Protocols.UC.EmulatesBlackBoxWithin {n : ℕ} {In Out NetQ₁ NetR₁ NetQ₂ NetR₂ : Type} (π : Protocol n In Out NetQ₁ NetR₁) (φ : Protocol n In Out NetQ₂ NetR₂) (pD : Polynomial ℕ) (ε : Polynomial ℕ → Polynomial ℕ → ℕ → NNReal) :

Concrete black-box emulation: one simulator S_D with budget pD such that, for every adversary A with budget pA, the black-box simulator compSim S_D A has advantage at most ε pA pZ κ against every environment with budget pZ.

Source. This is UC emulation with black-box simulation of [Can20a] (Cryptology ePrint Archive 2000/067, revision of February 11, 2020), Definition 12, p. 48: one black-box simulator S such that, for every adversary A, the composite adversary S^A, whose main program S runs A as a subroutine, simulates A. Its Claim 13, p. 49, shows it equivalent to UC emulation. It is stated with an explicit budget pD and error ε, as in Definition 15, p. 51, and differs from the source as EmulatesWithin does: call budgets in place of running time, with otherwise unbounded computation (the statistical setting of Section 4.4, p. 50); static corruptions; no identity bound on environments; a fixed set of n parties; and a bound at every κ and for every auxiliary input. Like EmulatesWithin, it is novel to this library: it is not source-identical, and no implication to or from the source's notion is established here. It is equivalent to EmulatesDummyWithin up to budgets and errors (EmulatesDummyWithin.emulatesBlackBoxWithin, EmulatesBlackBoxWithin.emulatesDummyWithin), as Claim 13 is for the source's notions, and implies EmulatesWithin (EmulatesBlackBoxWithin.emulatesWithin), so it is plausible for the same reasons.

theorem Cslib.Crypto.Protocols.UC.EmulatesDummyWithin.emulatesBlackBoxWithin {n : ℕ} {In Out NetQ₁ NetR₁ NetQ₂ NetR₂ : Type} {π : Protocol n In Out NetQ₁ NetR₁} {φ : Protocol n In Out NetQ₂ NetR₂} {pD : Polynomial ℕ} {ε : Polynomial ℕ → ℕ → NNReal} (h : EmulatesDummyWithin π φ pD ε) :
EmulatesBlackBoxWithin π φ pD fun (pA pZ : Polynomial ℕ) => ε (absorbPoly pZ pA)

Simulating the dummy adversary gives black-box simulation of every adversary, with the error evaluated at the absorbed environment's budget.

theorem Cslib.Crypto.Protocols.UC.EmulatesBlackBoxWithin.emulatesWithin {n : ℕ} {In Out NetQ₁ NetR₁ NetQ₂ NetR₂ : Type} {π : Protocol n In Out NetQ₁ NetR₁} {φ : Protocol n In Out NetQ₂ NetR₂} {pD : Polynomial ℕ} {ε : Polynomial ℕ → Polynomial ℕ → ℕ → NNReal} (h : EmulatesBlackBoxWithin π φ pD ε) :

Black-box emulation is emulation, with the black-box simulator's budget.

theorem Cslib.Crypto.Protocols.UC.EmulatesDummyWithin.emulatesWithin {n : ℕ} {In Out NetQ₁ NetR₁ NetQ₂ NetR₂ : Type} {π : Protocol n In Out NetQ₁ NetR₁} {φ : Protocol n In Out NetQ₂ NetR₂} {pD : Polynomial ℕ} {ε : Polynomial ℕ → ℕ → NNReal} (h : EmulatesDummyWithin π φ pD ε) :
EmulatesWithin π φ (compSimPoly pD) fun (pA pZ : Polynomial ℕ) => ε (absorbPoly pZ pA)

Completeness of the dummy adversary: simulating it gives emulation, with simulator overhead compSimPoly pD and the error evaluated at the absorbed environment's budget.

theorem Cslib.Crypto.Protocols.UC.EmulatesWithin.emulatesDummyWithin {n : ℕ} {In Out NetQ₁ NetR₁ NetQ₂ NetR₂ : Type} {π : Protocol n In Out NetQ₁ NetR₁} {φ : Protocol n In Out NetQ₂ NetR₂} {g : Polynomial ℕ} {ε : Polynomial ℕ → Polynomial ℕ → ℕ → NNReal} (h : EmulatesWithin π φ g ε) :
∃ (pD : Polynomial ℕ), SimPolyBound g 1 pD ∧ EmulatesDummyWithin π φ pD fun (pZ : Polynomial ℕ) => ε 1 pZ

Emulation gives a simulator for the dummy adversary, whose budget is bounded by g at κ + 1.

theorem Cslib.Crypto.Protocols.UC.EmulatesBlackBoxWithin.emulatesDummyWithin {n : ℕ} {In Out NetQ₁ NetR₁ NetQ₂ NetR₂ : Type} {π : Protocol n In Out NetQ₁ NetR₁} {φ : Protocol n In Out NetQ₂ NetR₂} {pD : Polynomial ℕ} {ε : Polynomial ℕ → Polynomial ℕ → ℕ → NNReal} (h : EmulatesBlackBoxWithin π φ pD ε) :
EmulatesDummyWithin π φ pD fun (pZ : Polynomial ℕ) => ε 1 pZ

Black-box emulation gives emulation of the dummy adversary with the same core simulator.

Negligible error #

def Cslib.Crypto.Protocols.UC.EmulatesDummy {n : ℕ} {In Out NetQ₁ NetR₁ NetQ₂ NetR₂ : Type} (π : Protocol n In Out NetQ₁ NetR₁) (φ : Protocol n In Out NetQ₂ NetR₂) :

Simulation of the dummy adversary with negligible error: a simulator with a polynomial budget such that, for each polynomial environment budget, one negligible function bounds the advantage of every such environment, for all corrupted parties and auxiliary inputs.

theorem Cslib.Crypto.Protocols.UC.emulates_iff_emulatesDummy {n : ℕ} {In Out NetQ₁ NetR₁ NetQ₂ NetR₂ : Type} (π : Protocol n In Out NetQ₁ NetR₁) (φ : Protocol n In Out NetQ₂ NetR₂) :

Completeness of the dummy adversary: UC emulation with negligible error is equivalent to simulating the dummy adversary with negligible error.