Documentation

CslibFrontier.Crypto.Protocols.PIR.LinearSummation

Lower bound for two-server linear-summation schemes #

A two-server scheme is of linear-summation type when each query is a set q : ι → Bool, each server answers with the parity x ⬝ᵥ q = ⊕_{j ∈ q} x j of the database on its set, and the user outputs the sum b₀ + b₁ of the two answer bits (Scheme.IsLinearSummation). The basic scheme PIR.twoServer is of this type (PIR.isLinearSummation_twoServer). For such schemes, Chor, Goldreich, Kushilevitz and Sudan, Section 5.2 shows that privacy forces long queries: each server can receive at least 2 ^ (n - 1) different sets.

The bound is tight, as the note at the end of Section 5.2 observes. In the even-set scheme PIR.evenTwoServer, the user draws a uniform set of even size, so each server receives one of the 2 ^ (n - 1) sets of a given parity (PIR.ncard_support_evenTwoServer). These sets have an injective encoding by n - 1 bits (PIR.exists_injOn_evenTwoServer).

The proofs use privacy only through supports: a set possible for the server s and the index j is possible for s and every index h, as in observation 1 of the source.

Only linear-summation schemes are covered. Lower bounds for general two-server schemes are open in the source and are not formalized here.

Main definitions #

Main results #

References #

A two-server scheme is of linear-summation type CGKS, Section 5.2 when the queries are sets q : ι → Bool, each server answers with the parity x ⬝ᵥ q of the database on its set, and the user outputs the sum of the two answer bits.

theorem Cslib.Crypto.Protocols.PIR.Scheme.IsLinearSummation.isCorrect_iff {ι R : Type} [Fintype ι] [DecidableEq ι] {P : Scheme ι Bool R (ι → Bool) Bool} (hP : P.IsLinearSummation) :
P.IsCorrect ↔ ∀ (i : ι) (r : R) (q : Bool → ι → Bool), (r, q) ∈ (P.query Bool i).eval.support → q false + q true = Pi.single i true

A linear-summation scheme is correct exactly when the two queries always add up to eᵢ.

theorem Cslib.Crypto.Protocols.PIR.Scheme.IsLinearSummation.query_add_query {ι R : Type} [Fintype ι] [DecidableEq ι] {P : Scheme ι Bool R (ι → Bool) Bool} (hP : P.IsLinearSummation) (hcorrect : P.IsCorrect) {i : ι} {r : R} {q : Bool → ι → Bool} (hrq : (r, q) ∈ (P.query Bool i).eval.support) :

In a correct linear-summation scheme, the two queries add up to eᵢ.

theorem Cslib.Crypto.Protocols.PIR.Scheme.IsLinearSummation.add_single_mem {ι R : Type} [Fintype ι] [DecidableEq ι] {P : Scheme ι Bool R (ι → Bool) Bool} (hP : P.IsLinearSummation) (hcorrect : P.IsCorrect) (hprivate : P.IsPrivate) {s : Bool} {i : ι} {v : ι → Bool} (hv : v ∈ (P.serverQuery s i).eval.support) (h : ι) :

Flipping one position of a set that the server s can receive gives a set that the other server can receive CGKS, Section 5.2. By privacy, v can be sent to s for the index h, and then the other query is v + e_h.

theorem Cslib.Crypto.Protocols.PIR.Scheme.IsLinearSummation.mem_support_add {ι R : Type} [Fintype ι] {P : Scheme ι Bool R (ι → Bool) Bool} (hP : P.IsLinearSummation) (hcorrect : P.IsCorrect) (hprivate : P.IsPrivate) {s : Bool} {i : ι} {v : ι → Bool} (hv : v ∈ (P.serverQuery s i).eval.support) (w : ι → Bool) :
w ∈ (P.serverQuery (s + ∑ h : ι, (w h + v h)) i).eval.support

The Claim of CGKS, Section 5.2. In a correct, private linear-summation scheme, if the server s can receive v, then every set w can be received by the server s if its Hamming distance to v is even and by the other server if it is odd: by the server s + ∑ h, (w h + v h).

In a correct, private linear-summation scheme, the server s can receive at least half of all sets.

theorem Cslib.Crypto.Protocols.PIR.Scheme.IsLinearSummation.two_pow_le_ncard_support {ι R : Type} [Fintype ι] {P : Scheme ι Bool R (ι → Bool) Bool} (hP : P.IsLinearSummation) (hcorrect : P.IsCorrect) (hprivate : P.IsPrivate) (s : Bool) (i : ι) :

Each server of a correct, private linear-summation scheme can receive at least 2 ^ (n - 1) sets CGKS, Section 5.2.

theorem Cslib.Crypto.Protocols.PIR.Scheme.IsLinearSummation.card_sub_one_le {ι R : Type} [Fintype ι] {P : Scheme ι Bool R (ι → Bool) Bool} (hP : P.IsLinearSummation) (hcorrect : P.IsCorrect) (hprivate : P.IsPrivate) (s : Bool) (i : ι) {ℓ : ℕ} {enc : (ι → Bool) → BitString ℓ} (henc : Set.InjOn enc (P.serverQuery s i).eval.support) :
Fintype.card ι - 1 ≤ ℓ

The queries of each server of a correct, private linear-summation scheme need n - 1 bits CGKS, Section 5.2: an encoding by ℓ-bit strings that is injective on the sets the server can receive has n - 1 ≤ ℓ.

The basic two-server scheme is of linear-summation type.

The even-set scheme #

noncomputable def Cslib.Crypto.Protocols.PIR.evenTwoServer {ι : Type} [Fintype ι] [DecidableEq ι] (h₀ : ι) :
Scheme ι Bool Unit (ι → Bool) Bool

The even-set variant of the basic two-server scheme CGKS, Section 5.2. The user draws a uniform set t of even size (by making a uniform set even at h₀), sends t to the server false and t + eᵢ to the server true, and adds the answers x ⬝ᵥ t and x ⬝ᵥ (t + eᵢ).

The even-set scheme is correct: the two queries add up to eᵢ.

The even-set scheme is private: the server σ receives the uniform even set made odd at h₀ if σ = true, whatever the index.

theorem Cslib.Crypto.Protocols.PIR.sum_of_mem_support_evenTwoServer {ι : Type} [Fintype ι] [DecidableEq ι] (h₀ : ι) {σ : Bool} {i : ι} {v : ι → Bool} (hv : v ∈ ((evenTwoServer h₀).serverQuery σ i).eval.support) :
∑ h : ι, v h = σ

The sets that the server σ of the even-set scheme receives have parity σ.

theorem Cslib.Crypto.Protocols.PIR.ncard_support_evenTwoServer {ι : Type} [Fintype ι] [DecidableEq ι] (h₀ : ι) (σ : Bool) (i : ι) :

The lower bound is attained CGKS, Section 5.2: each server of the even-set scheme receives exactly 2 ^ (n - 1) sets.

theorem Cslib.Crypto.Protocols.PIR.exists_injOn_evenTwoServer {ι : Type} [Fintype ι] [DecidableEq ι] (h₀ : ι) (σ : Bool) :
∃ (enc : (ι → Bool) → BitString (Fintype.card ι - 1)), ∀ (i : ι), Set.InjOn enc ((evenTwoServer h₀).serverQuery σ i).eval.support

n - 1 bits encode the queries of each server of the even-set scheme: one encoding, for every index.