Documentation

CslibFrontier.Crypto.Primitives.Garbling.FoundationsAsymptotic

Asymptotic garbling security notions and BHR12 Propositions 2 and 3 #

This module completes the asymptotic security definitions of Bellare, Hoang and Rogaway [BHR12b], §§3.4–3.7 (ePrint 2012/265, pp. 8–12), in the same uniform strict-PPT two-stage style (TwoStage.IsPPT) as Cslib.Crypto.Garbling.Scheme.PrvSimSecure in CslibFrontier.Crypto.Primitives.Garbling.Asymptotic, and lifts the fixed-parameter reductions and simulators of CslibFrontier.Crypto.Primitives.Garbling.Foundations to the full asymptotic equivalences of Propositions 2 and 3 ([BHR12b], §§4.2–4.3, pp. 13–15).

For efficient schemes (Scheme.IsEfficient) with polynomial-time computable side information Φ:

Deviations from [BHR12b] match Scheme.PrvSimSecure: adversaries are uniform strict PPT two-stage programs (TwoStage.IsPPT), advantages are two-world Experiment.advantage values (the paper's 2 Pr[·] - 1 up to sign) or Experiment.succProbability for aut, and function/side-information types carry explicit encodings encFn and encΛ. Scheme.IsEfficient requires polynomial-time length readers f.n, f.m rather than the source's linear-time ones. Scheme.AutSecure also corresponds to the authenticity definition of [BS23] (version 0.6, §23.3.5, Definition 23.3, pp. 1026–1027). The obliviousness definition there (Definition 23.2, same pages) fixes one circuit with two inputs, so it corresponds to Scheme.ObvIndSecure at the side information SideInfo.circ, not for arbitrary Φ.

The *Universal conclusions (∃ S ∀ B) strengthen Propositions 2 and 3 as stated (∀ B ∃ S): the source's proofs define the simulator from the inverter M before the adversary B ([BHR12b], pp. 13–15), and the ∀ B ∃ S forms follow from them.

Main definitions #

Main results #

References #

Encodings #

theorem Cslib.Crypto.Garbling.encIndToSimState_mk_budget (Fn σ : Type) (encFn : Fn ↪ List Bool) (encσ : σ ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → σ} {x1 : γ → Bool} {x2 : γ → MessagePair (Query Fn)} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn encσ budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encBool budget) (h2 : Turing.MultiTapeTM.ComputableInSpace x2 encIn (encMessagePair (encQuery Fn encFn)) budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { state := x0 x, bit := x1 x, pair := x2 x }) encIn (encIndToSimState Fn σ encFn encσ) budget
theorem Cslib.Crypto.Garbling.encIndToSimState_state_budget (Fn σ : Type) (encFn : Fn ↪ List Bool) (encσ : σ ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → IndToSimState Fn σ} :
Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ (encIndToSimState Fn σ encFn encσ) S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).state) encIn✝ encσ S✝
theorem Cslib.Crypto.Garbling.encIndToSimState_fields_deg (Fn σ : Type) (encFn : Fn ↪ List Bool) (encσ : σ ↪ List Bool) :
Turing.MultiTapeTM.ComputableInDegree (fun (a : IndToSimState Fn σ) => (a.state, a.bit, a.pair)) (encIndToSimState Fn σ encFn encσ) (encIndToSimStateFields Fn σ encFn encσ) 1 1
theorem Cslib.Crypto.Garbling.encIndToSimState_bit_polyTime (Fn σ : Type) (encFn : Fn ↪ List Bool) (encσ : σ ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → IndToSimState Fn σ} :
theorem Cslib.Crypto.Garbling.encIndToSimState_state_inO (Fn σ : Type) (encFn : Fn ↪ List Bool) (encσ : σ ↪ List Bool) :
Turing.MultiTapeTM.ComputableInO IndToSimState.state (encIndToSimState Fn σ encFn encσ) encσ (fun (a : IndToSimState Fn σ) => ((encIndToSimState Fn σ encFn encσ) a).length) fun (a : IndToSimState Fn σ) => ((encIndToSimState Fn σ encFn encσ) a).length
theorem Cslib.Crypto.Garbling.encIndToSimState_pair_polyTime (Fn σ : Type) (encFn : Fn ↪ List Bool) (encσ : σ ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → IndToSimState Fn σ} :
Turing.MultiTapeTM.ComputableInPolyTime g✝ encIn✝ (encIndToSimState Fn σ encFn encσ) → Turing.MultiTapeTM.ComputableInPolyTime (fun (c : γ✝) => (g✝ c).pair) encIn✝ (encMessagePair (encQuery Fn encFn))
@[simp]
theorem Cslib.Crypto.Garbling.encIndToSimState_apply (Fn σ : Type) (encFn : Fn ↪ List Bool) (encσ : σ ↪ List Bool) (a : IndToSimState Fn σ) :
(encIndToSimState Fn σ encFn encσ) a = (encIndToSimStateFields Fn σ encFn encσ) (a.state, a.bit, a.pair)
theorem Cslib.Crypto.Garbling.encIndToSimState_state_length_le (Fn σ : Type) (encFn : Fn ↪ List Bool) (encσ : σ ↪ List Bool) (a : IndToSimState Fn σ) :
(encσ a.state).length ≤ ((encIndToSimState Fn σ encFn encσ) a).length
theorem Cslib.Crypto.Garbling.encIndToSimState_state_polyTime (Fn σ : Type) (encFn : Fn ↪ List Bool) (encσ : σ ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → IndToSimState Fn σ} :
Turing.MultiTapeTM.ComputableInPolyTime g✝ encIn✝ (encIndToSimState Fn σ encFn encσ) → Turing.MultiTapeTM.ComputableInPolyTime (fun (c : γ✝) => (g✝ c).state) encIn✝ encσ
theorem Cslib.Crypto.Garbling.encIndToSimState_bit_budget (Fn σ : Type) (encFn : Fn ↪ List Bool) (encσ : σ ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → IndToSimState Fn σ} :
Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ (encIndToSimState Fn σ encFn encσ) S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).bit) encIn✝ Turing.MultiTapeTM.encBool S✝
theorem Cslib.Crypto.Garbling.encIndToSimState_pair_budget (Fn σ : Type) (encFn : Fn ↪ List Bool) (encσ : σ ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → IndToSimState Fn σ} :
Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ (encIndToSimState Fn σ encFn encσ) S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).pair) encIn✝ (encMessagePair (encQuery Fn encFn)) S✝
theorem Cslib.Crypto.Garbling.encIndToSimState_pair_length_le (Fn σ : Type) (encFn : Fn ↪ List Bool) (encσ : σ ↪ List Bool) (a : IndToSimState Fn σ) :
((encMessagePair (encQuery Fn encFn)) a.pair).length ≤ ((encIndToSimState Fn σ encFn encσ) a).length
theorem Cslib.Crypto.Garbling.encIndToSimState_mk_inO (Fn σ : Type) (encFn : Fn ↪ List Bool) (encσ : σ ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → σ} {T0 S0 : γ → ℕ} {x1 : γ → Bool} {T1 S1 : γ → ℕ} {x2 : γ → MessagePair (Query Fn)} {T2 S2 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn encσ T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encBool T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn (encMessagePair (encQuery Fn encFn)) T2 S2) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { state := x0 x, bit := x1 x, pair := x2 x }) encIn (encIndToSimState Fn σ encFn encσ) (fun (x : γ) => T0 x + (T1 x + T2 x)) fun (x : γ) => S0 x + (S1 x + S2 x)
theorem Cslib.Crypto.Garbling.encIndToSimState_bit_inO (Fn σ : Type) (encFn : Fn ↪ List Bool) (encσ : σ ↪ List Bool) :
Turing.MultiTapeTM.ComputableInO IndToSimState.bit (encIndToSimState Fn σ encFn encσ) Turing.MultiTapeTM.encBool (fun (a : IndToSimState Fn σ) => ((encIndToSimState Fn σ encFn encσ) a).length) fun (a : IndToSimState Fn σ) => ((encIndToSimState Fn σ encFn encσ) a).length
theorem Cslib.Crypto.Garbling.encIndToSimState_mk_polyTime (Fn σ : Type) (encFn : Fn ↪ List Bool) (encσ : σ ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → σ} {x1 : γ → Bool} {x2 : γ → MessagePair (Query Fn)} (h0 : Turing.MultiTapeTM.ComputableInPolyTime x0 encIn encσ) (h1 : Turing.MultiTapeTM.ComputableInPolyTime x1 encIn Turing.MultiTapeTM.encBool) (h2 : Turing.MultiTapeTM.ComputableInPolyTime x2 encIn (encMessagePair (encQuery Fn encFn))) :
Turing.MultiTapeTM.ComputableInPolyTime (fun (x : γ) => { state := x0 x, bit := x1 x, pair := x2 x }) encIn (encIndToSimState Fn σ encFn encσ)
theorem Cslib.Crypto.Garbling.encIndToSimState_mk_deg (Fn σ : Type) (encFn : Fn ↪ List Bool) (encσ : σ ↪ List Bool) :
Turing.MultiTapeTM.ComputableInDegree (fun (p : σ × Bool × MessagePair (Query Fn)) => { state := p.1, bit := p.2.1, pair := p.2.2 }) (encIndToSimStateFields Fn σ encFn encσ) (encIndToSimState Fn σ encFn encσ) 1 1

The encoding of an IndToSimState Fn σ: state framed, bit framed, then pair encoded by encMessagePair (encQuery Fn encFn).

theorem Cslib.Crypto.Garbling.encIndToSimState_pair_inO (Fn σ : Type) (encFn : Fn ↪ List Bool) (encσ : σ ↪ List Bool) :
Turing.MultiTapeTM.ComputableInO IndToSimState.pair (encIndToSimState Fn σ encFn encσ) (encMessagePair (encQuery Fn encFn)) (fun (a : IndToSimState Fn σ) => ((encIndToSimState Fn σ encFn encσ) a).length) fun (a : IndToSimState Fn σ) => ((encIndToSimState Fn σ encFn encσ) a).length
@[reducible, inline]

The tuple of the fields of encIndToSimState.

Asymptotic security definitions #

def Cslib.Crypto.Garbling.Scheme.PrvIndSecure {Fn Λ : Type} [DecidableEq Λ] (G : Scheme Fn) (Φ : SideInfo Fn Λ) (encFn : Fn ↪ List Bool) :

Indistinguishability privacy prv.ind of [BHR12b], §3.4 (pp. 8–9): for every uniform strict PPT two-stage adversary A choosing a pair of queries encoded by encMessagePair (encQuery Fn encFn) and receiving (F, X, d) (or ⊥), its prv.ind advantage is negligible in the security parameter.

def Cslib.Crypto.Garbling.Scheme.ObvIndSecure {Fn Λ : Type} [DecidableEq Λ] (G : Scheme Fn) (Φ : SideInfo Fn Λ) (encFn : Fn ↪ List Bool) :

Indistinguishability obliviousness obv.ind of [BHR12b], §3.5 (pp. 9–10): for every uniform strict PPT two-stage adversary A choosing a pair of queries encoded by encMessagePair (encQuery Fn encFn) and receiving (F, X) (or ⊥), its obv.ind advantage is negligible in the security parameter. At the side information SideInfo.circ it is the obliviousness of [BS23] (version 0.6, §23.3.5, Definition 23.2, pp. 1026–1027), which fixes one circuit with two inputs.

def Cslib.Crypto.Garbling.Scheme.ObvSimSecure {Fn Λ : Type} (G : Scheme Fn) (Φ : SideInfo Fn Λ) (encFn : Fn ↪ List Bool) (encΛ : Λ ↪ List Bool) :

Simulation obliviousness obv.sim of [BHR12b], §3.5 (pp. 9–10), with side information Φ: for every uniform strict PPT adversary B there is a simulator S, uniform strict PPT on (1^k, φ), whose obv.sim advantage against B is negligible.

def Cslib.Crypto.Garbling.Scheme.ObvSimSecureUniversal {Fn Λ : Type} (G : Scheme Fn) (Φ : SideInfo Fn Λ) (encFn : Fn ↪ List Bool) (encΛ : Λ ↪ List Bool) :

Simulation obliviousness with one simulator for every adversary, with side information Φ: one simulator S, uniform strict PPT on (1^k, φ), whose obv.sim advantage against every uniform strict PPT adversary is negligible, in the game ObvSim of [BHR12b], §3.5 (pp. 9–10).

For arbitrary Φ this quantifier order (∃ S ∀ B) is novel to this library: [BHR12b], §3.5, quantifies ∀ B ∃ S, and Scheme.ObvSimSecureUniversal.obvSimSecure recovers that standard notion. It is plausible because the standard inverter-based construction obvSimFromInverter yields a single universal simulator from ObvIndSecure (Scheme.ObvIndSecure.obvSimSecureUniversal).

theorem Cslib.Crypto.Garbling.Scheme.ObvSimSecureUniversal.obvSimSecure {Fn Λ : Type} {G : Scheme Fn} {Φ : SideInfo Fn Λ} {encFn : Fn ↪ List Bool} {encΛ : Λ ↪ List Bool} (h : G.ObvSimSecureUniversal Φ encFn encΛ) :
G.ObvSimSecure Φ encFn encΛ

One simulator for every adversary gives a simulator for each adversary: Scheme.ObvSimSecureUniversal (∃ S ∀ B) implies Scheme.ObvSimSecure (∀ B ∃ S).

Authenticity aut of [BHR12b], §3.6 (p. 10) and [BS23] (version 0.6, §23.3.5, Definition 23.3, pp. 1026–1027): for every uniform strict PPT two-stage adversary A choosing a query encoded by encQuery Fn encFn and receiving (F, X), its probability of producing a valid forgery differing from Ev(F, X) is negligible in the security parameter.

Strict-PPT execution of efficient schemes #

Library infrastructure (no cited result): garbling G.garble k f is uniform strict PPT on (1^k, f) whenever G is efficient.

Library infrastructure (no cited result): sampling the real privacy view G.prvView k q is uniform strict PPT on (1^k, q) whenever G is efficient.

Library infrastructure (no cited result): sampling the real obliviousness view G.obvView k q is uniform strict PPT on (1^k, q) whenever G is efficient.

Strict-PPT efficiency witnesses for BHR12 reductions and simulators #

Library infrastructure (no cited result): prvIndToSim preserves uniform strict PPT when G is efficient and Φ.phi is polynomial-time computable.

Library infrastructure (no cited result): obvIndToSim preserves uniform strict PPT when G is efficient and Φ.phi is polynomial-time computable.

Library infrastructure (no cited result): the simulator prvSimFromInverter built from a polynomial-time (Φ, ev)-inverter M is uniform strict PPT on (1^k, y, φ) when G is efficient.

Library infrastructure (no cited result): prvSimToInd preserves uniform strict PPT when G is efficient and Φ.phi and M are polynomial-time computable.

theorem Cslib.Crypto.Garbling.isPPTOn_obvSimFromInverter {Fn Λ : Type} {G : Scheme Fn} {encFn : Fn ↪ List Bool} {encΛ : Λ ↪ List Bool} {M : Λ → Fn} (heff : G.IsEfficient encFn) (hM : Turing.MultiTapeTM.ComputableInPolyTime M encΛ encFn) :

Library infrastructure (no cited result): the simulator obvSimFromInverter built from a polynomial-time Φ-inverter M is uniform strict PPT on (1^k, φ) when G is efficient.

Library infrastructure (no cited result): obvSimToInd preserves uniform strict PPT when G is efficient and Φ.phi and M are polynomial-time computable.

BHR12 Propositions 2 and 3 #

theorem Cslib.Crypto.Garbling.Scheme.PrvSimSecure.prvIndSecure {Fn Λ : Type} [DecidableEq Λ] {G : Scheme Fn} {Φ : SideInfo Fn Λ} {encFn : Fn ↪ List Bool} {encΛ : Λ ↪ List Bool} (hCompat : Φ.Compatible G) (heff : G.IsEfficient encFn) (hphi : Turing.MultiTapeTM.ComputableInPolyTime Φ.phi encFn encΛ) (hsec : G.PrvSimSecure Φ encFn encΛ) :
G.PrvIndSecure Φ encFn

BHR12 Proposition 2 (prv.sim → prv.ind) ([BHR12b], §4.2, pp. 13–14): for an efficient garbling scheme G with compatible polynomial-time side information Φ, simulation privacy PrvSimSecure implies indistinguishability privacy PrvIndSecure. The factor of 2 in prvIndAdvantage_eq_two_mul_prvSimAdvantage_prvIndToSim is absorbed by Negligible.

theorem Cslib.Crypto.Garbling.Scheme.PrvIndSecure.prvSimSecureUniversal {Fn Λ : Type} [DecidableEq Λ] {G : Scheme Fn} {Φ : SideInfo Fn Λ} {encFn : Fn ↪ List Bool} {encΛ : Λ ↪ List Bool} (hCompat : Φ.Compatible G) (heff : G.IsEfficient encFn) (hphi : Turing.MultiTapeTM.ComputableInPolyTime Φ.phi encFn encΛ) {M : Λ → List Bool → Query Fn} (hInv : Φ.IsEvInverter G M) (hM : Turing.MultiTapeTM.ComputableInPolyTime (fun (p : Λ × List Bool) => M p.1 p.2) (Turing.MultiTapeTM.encPair encΛ Turing.MultiTapeTM.encBits) (encQuery Fn encFn)) (hsec : G.PrvIndSecure Φ encFn) :
G.PrvSimSecureUniversal Φ encFn encΛ

BHR12 Proposition 2 (prv.ind → prv.sim with a universal simulator) ([BHR12b], §4.2, pp. 13–14): for an efficient garbling scheme G with compatible polynomial-time side information Φ and a polynomial-time (Φ, ev)-inverter M, PrvIndSecure implies PrvSimSecureUniversal, because prvSimFromInverter G k M does not depend on the adversary. This universal form (∃ S ∀ B) strengthens Proposition 2 as stated (∀ B ∃ S, which is Scheme.PrvIndSecure.prvSimSecure); the source's proof yields it, since its simulator is defined from M before the adversary (pp. 13–14).

theorem Cslib.Crypto.Garbling.Scheme.PrvIndSecure.prvSimSecure {Fn Λ : Type} [DecidableEq Λ] {G : Scheme Fn} {Φ : SideInfo Fn Λ} {encFn : Fn ↪ List Bool} {encΛ : Λ ↪ List Bool} (hCompat : Φ.Compatible G) (heff : G.IsEfficient encFn) (hphi : Turing.MultiTapeTM.ComputableInPolyTime Φ.phi encFn encΛ) {M : Λ → List Bool → Query Fn} (hInv : Φ.IsEvInverter G M) (hM : Turing.MultiTapeTM.ComputableInPolyTime (fun (p : Λ × List Bool) => M p.1 p.2) (Turing.MultiTapeTM.encPair encΛ Turing.MultiTapeTM.encBits) (encQuery Fn encFn)) (hsec : G.PrvIndSecure Φ encFn) :
G.PrvSimSecure Φ encFn encΛ

BHR12 Proposition 2 (prv.ind → prv.sim) ([BHR12b], §4.2, pp. 13–14): for an efficient garbling scheme G with compatible polynomial-time side information Φ and a polynomial-time (Φ, ev)-inverter M, indistinguishability privacy PrvIndSecure implies simulation privacy PrvSimSecure.

theorem Cslib.Crypto.Garbling.Scheme.ObvSimSecure.obvIndSecure {Fn Λ : Type} [DecidableEq Λ] {G : Scheme Fn} {Φ : SideInfo Fn Λ} {encFn : Fn ↪ List Bool} {encΛ : Λ ↪ List Bool} (hCompat : Φ.Compatible G) (heff : G.IsEfficient encFn) (hphi : Turing.MultiTapeTM.ComputableInPolyTime Φ.phi encFn encΛ) (hsec : G.ObvSimSecure Φ encFn encΛ) :
G.ObvIndSecure Φ encFn

BHR12 Proposition 3 (obv.sim → obv.ind) ([BHR12b], §4.3, pp. 14–15): for an efficient garbling scheme G with compatible polynomial-time side information Φ, simulation obliviousness ObvSimSecure implies indistinguishability obliviousness ObvIndSecure.

theorem Cslib.Crypto.Garbling.Scheme.ObvIndSecure.obvSimSecureUniversal {Fn Λ : Type} [DecidableEq Λ] {G : Scheme Fn} {Φ : SideInfo Fn Λ} {encFn : Fn ↪ List Bool} {encΛ : Λ ↪ List Bool} (hCompat : Φ.Compatible G) (heff : G.IsEfficient encFn) (hphi : Turing.MultiTapeTM.ComputableInPolyTime Φ.phi encFn encΛ) {M : Λ → Fn} (hInv : Φ.IsInverter M) (hM : Turing.MultiTapeTM.ComputableInPolyTime M encΛ encFn) (hsec : G.ObvIndSecure Φ encFn) :
G.ObvSimSecureUniversal Φ encFn encΛ

BHR12 Proposition 3 (obv.ind → obv.sim with a universal simulator) ([BHR12b], §4.3, pp. 14–15): for an efficient garbling scheme G with compatible polynomial-time side information Φ and a polynomial-time Φ-inverter M, ObvIndSecure implies ObvSimSecureUniversal, because obvSimFromInverter G k M does not depend on the adversary. This universal form (∃ S ∀ B) strengthens Proposition 3 as stated (∀ B ∃ S, which is Scheme.ObvIndSecure.obvSimSecure); the source's proof yields it, since its simulator is defined from M before the adversary (pp. 14–15).

theorem Cslib.Crypto.Garbling.Scheme.ObvIndSecure.obvSimSecure {Fn Λ : Type} [DecidableEq Λ] {G : Scheme Fn} {Φ : SideInfo Fn Λ} {encFn : Fn ↪ List Bool} {encΛ : Λ ↪ List Bool} (hCompat : Φ.Compatible G) (heff : G.IsEfficient encFn) (hphi : Turing.MultiTapeTM.ComputableInPolyTime Φ.phi encFn encΛ) {M : Λ → Fn} (hInv : Φ.IsInverter M) (hM : Turing.MultiTapeTM.ComputableInPolyTime M encΛ encFn) (hsec : G.ObvIndSecure Φ encFn) :
G.ObvSimSecure Φ encFn encΛ

BHR12 Proposition 3 (obv.ind → obv.sim) ([BHR12b], §4.3, pp. 14–15): for an efficient garbling scheme G with compatible polynomial-time side information Φ and a polynomial-time Φ-inverter M, indistinguishability obliviousness ObvIndSecure implies simulation obliviousness ObvSimSecure.