Documentation

CslibFrontier.Crypto.Protocols.PIR.Shamir

Polynomial Shamir t-private information retrieval #

Chor, Goldreich, Kushilevitz and Sudan, Section 1.1, pp. 1–2, and Section 2.2, pp. 4–5 note that polynomial-interpolation PIR extends to coalitions of up to t colluding servers (t < k): in the headline summary of Section 1.1 (whose construction was omitted from the April 21, 1998 journal version and referred back to the FOCS 1995 preliminary version), for an integer function t(n) and integer constant c > 1, they state a t(n)-private scheme for c · t(n) servers with communication O(t(n) · n ^ (1 / c)).

This module formalizes an explicit finite-field polynomial construction built on Shamir secret sharing (Shamir; Cslib.Crypto.Protocols.SecretSharing.Shamir):

Source adaptation and model boundaries #

Main definitions #

Main results #

References #

noncomputable def Cslib.Crypto.Protocols.PIR.shamir {F S : Type} [Field F] [Fintype F] [Fintype S] (ι : Type) [Fintype ι] [DecidableEq ι] (params : SecretSharing.Shamir.Params F S) :
Scheme ι S Unit (ι → F) F

Linear Shamir t-private PIR over a finite field F ([Sha79]; adapting CGKS, Sections 1.1 and 2.2, pp. 1–2 and 4–5): to read x i, the user shares the indicator vector j ↦ (if j = i then 1 else 0) entrywise with independent degree-t Shamir sharings, each server returns the field inner product with x, and the user reconstructs at 0.

noncomputable def Cslib.Crypto.Protocols.PIR.shamirCube {F S : Type} [Field F] [Fintype F] [Fintype S] (D ι : Type) [Fintype D] [DecidableEq D] [Fintype ι] [DecidableEq ι] (params : SecretSharing.Shamir.Params F S) :
Scheme (D → ι) S Unit (D → ι → F) F

Degree-d polynomial t-private PIR on the cube D → ι ([Sha79]; adapting CGKS, Sections 1.1 and 2.2, pp. 1–2 and 4–5): the user shares each coordinate indicator u ↦ (if u = i l then 1 else 0) with degree t = params.threshold, each server returns ∑ j, x j * ∏ l, a l (j l) in F (evaluating a polynomial of degree at most |D| * t whose constant term is x i), and the user interpolates the constant term from the |S| > |D| * t server answers.

theorem Cslib.Crypto.Protocols.PIR.reconstruct_shamir {F S : Type} [Field F] [Fintype F] [Fintype S] {ι : Type} [Fintype ι] [DecidableEq ι] (params : SecretSharing.Shamir.Params F S) (i : ι) (r : Unit) (ans : S → F) :
theorem Cslib.Crypto.Protocols.PIR.reconstruct_shamirCube {F S : Type} [Field F] [Fintype F] [Fintype S] {D ι : Type} [Fintype D] [DecidableEq D] [Fintype ι] [DecidableEq ι] (params : SecretSharing.Shamir.Params F S) (i : D → ι) (r : Unit) (ans : S → F) :
theorem Cslib.Crypto.Protocols.PIR.eval_coalitionQuery_shamir {F S : Type} [Field F] [Fintype F] [Fintype S] {ι : Type} [Fintype ι] [DecidableEq ι] [DecidableEq S] (params : SecretSharing.Shamir.Params F S) (T : Finset S) (hT : T.card ≤ params.threshold) (i : ι) :
((shamir ι params).coalitionQuery T i).eval = Probability.PMF.uniformOfFintype (↥T → ι → F)

Any coalition T of at most params.threshold servers in PIR.shamir sees a uniform family of query vectors, independent of the queried index.

Linear Shamir PIR is t-private for t = params.threshold.

theorem Cslib.Crypto.Protocols.PIR.reconstruct_answer_shamir {F S : Type} [Field F] [Fintype F] [Fintype S] {ι : Type} [Fintype ι] [DecidableEq ι] (params : SecretSharing.Shamir.Params F S) (x : ι → Bool) (i : ι) {r : Unit} {q : S → ι → F} (hrq : (r, q) ∈ ((shamir ι params).query Bool i).eval.support) :
(SecretSharing.Shamir.Polynomial.reconstruct params.point fun (s : S) => (shamir ι params).answer Bool s x (q s)) = if x i = true then 1 else 0

On every supported query draw of PIR.shamir, Lagrange interpolation at 0 of the honest server answers equals 1 if x i = true and 0 if x i = false.

Linear Shamir PIR is perfectly correct: Lagrange reconstruction at 0 recovers 1 when x i = true and 0 when x i = false.

Sharpness of the collusion threshold: (params.threshold + 1) servers are authorized in Shamir secret sharing and can reconstruct the target index, so PIR.shamir is not (params.threshold + 1)-private on any nontrivial database index type (|ι| ≥ 2).

theorem Cslib.Crypto.Protocols.PIR.eval_coalitionQuery_shamirCube {F S : Type} [Field F] [Fintype F] [Fintype S] {D ι : Type} [Fintype D] [DecidableEq D] [Fintype ι] [DecidableEq ι] [DecidableEq S] (params : SecretSharing.Shamir.Params F S) (T : Finset S) (hT : T.card ≤ params.threshold) (i : D → ι) :
((shamirCube D ι params).coalitionQuery T i).eval = Probability.PMF.uniformOfFintype (↥T → D → ι → F)

Any coalition T of at most params.threshold servers in PIR.shamirCube sees uniform coordinate query tables, independent of the target cube point.

Degree-d polynomial PIR is t-private for t = params.threshold.

Sharpness of the collusion threshold for PIR.shamirCube: even when |S| > |D| * t servers are used for degree-d t reconstruction, any params.threshold + 1 colluding servers can reconstruct coordinate indicators and learn i, so PIR.shamirCube is not (params.threshold + 1)-private whenever D is nonempty (d ≥ 1) and ι is nontrivial (|ι| ≥ 2).

theorem Cslib.Crypto.Protocols.PIR.reconstruct_answer_shamirCube {F S : Type} [Field F] [Fintype F] [Fintype S] {D ι : Type} [Fintype D] [DecidableEq D] [Fintype ι] [DecidableEq ι] (params : SecretSharing.Shamir.Params F S) (hdeg : Fintype.card D * params.threshold < Fintype.card S) (x : (D → ι) → Bool) (i : D → ι) {r : Unit} {q : S → D → ι → F} (hrq : (r, q) ∈ ((shamirCube D ι params).query Bool i).eval.support) :
(SecretSharing.Shamir.Polynomial.reconstruct params.point fun (s : S) => (shamirCube D ι params).answer Bool s x (q s)) = if x i = true then 1 else 0

On every supported query draw of PIR.shamirCube, when |D| * params.threshold < |S|, Lagrange interpolation at 0 of the honest server answers equals 1 if x i = true and 0 if x i = false.

Degree-d polynomial PIR is perfectly correct whenever |D| * params.threshold < |S|: each server evaluates a polynomial of degree at most |D| * t whose constant term is 1 if x i and 0 otherwise.

Communication upper bound for shamirCube: each server receives |D| * |ι| field elements and sends 1 field element.

Communication upper bound for rows-balanced shamirCube (CGKS, Section 3.4, p. 11): each server receives |D| * |ι| field elements and sends |ρ| field elements.

Communication upper bound for matrix-balanced linear Shamir PIR ((shamir ι params).rows ρ).

(t + 1)-server O(√n) t-private PIR: applying Scheme.rows to PIR.shamir solves any n ≤ m ^ 2 with |S| servers (params.threshold < |S|) and |S| * 2 m * ⌈log₂ |F|⌉ bits.

theorem Cslib.Crypto.Protocols.PIR.hasTPrivateScheme_of_le_pow {F S : Type} [Field F] [Fintype F] [Fintype S] (params : SecretSharing.Shamir.Params F S) {n d ℓ : ℕ} (hdeg : d * params.threshold < Fintype.card S) (h : n ≤ ℓ ^ d) :

Unbalanced (d t + 1)-server O(n ^ (1 / d)) t-private PIR: whenever d * params.threshold < |S| and n ≤ ℓ ^ d, PIR.shamirCube gives a perfectly correct t-private scheme communicating at most |S| * ((d * ℓ + 1) * ⌈log₂ |F|⌉) bits.

theorem Cslib.Crypto.Protocols.PIR.hasTPrivateScheme_rows_of_le_pow {F S : Type} [Field F] [Fintype F] [Fintype S] (params : SecretSharing.Shamir.Params F S) {n d ℓ : ℕ} (hdeg : d * params.threshold < Fintype.card S) (h : n ≤ ℓ ^ (d + 1)) :

Balanced c t-server finite-field t-private PIR (weaker finite-field communication variant of CGKS, Section 1.1, pp. 1–2, via Section 3.4, p. 11): applying Scheme.rows (Fin ℓ) to PIR.shamirCube (Fin d) (Fin ℓ) solves any n ≤ ℓ ^ (d + 1) whenever d * params.threshold < |S|, using |S| * ((d + 1) * ℓ * ⌈log₂ |F|⌉) bits. For c = d + 1 ≥ 2 and t = params.threshold ≥ 1, (c - 1) * t < c * t holds with exact |S| = c * t servers, retaining the field bit-width factor ⌈log₂ |F|⌉ (|F| > c * t).

Canonical Shamir parameters for k servers over ZMod p using evaluation points 1, …, k when t < k < p for a prime p.

@[simp]
theorem Cslib.Crypto.Protocols.PIR.threshold_zmodShamirParams {t k p : ℕ} [Fact (Nat.Prime p)] (htk : t < k) (hkp : k < p) :
@[simp]
theorem Cslib.Crypto.Protocols.PIR.point_zmodShamirParams {t k p : ℕ} [Fact (Nat.Prime p)] (htk : t < k) (hkp : k < p) (s : Fin k) :
(zmodShamirParams htk hkp).point s = ↑(↑s + 1)
theorem Cslib.Crypto.Protocols.PIR.hasTPrivateScheme_prime_of_le_pow {n d ℓ t k p : ℕ} [Fact (Nat.Prime p)] (hdeg : d * t < k) (hd : 0 < d) (hkp : k < p) (hn : n ≤ ℓ ^ d) :
HasTPrivateScheme (Fin n) t k (k * ((d * ℓ + 1) * Nat.clog 2 p))

Concrete prime-field t-private k-server polynomial PIR for d * t < k < p and n ≤ ℓ ^ d.

theorem Cslib.Crypto.Protocols.PIR.hasTPrivateScheme_prime_rows_of_le_pow {n d ℓ t k p : ℕ} [Fact (Nat.Prime p)] (htk : t < k) (hdeg : d * t < k) (hkp : k < p) (hn : n ≤ ℓ ^ (d + 1)) :
HasTPrivateScheme (Fin n) t k (k * ((d + 1) * ℓ * Nat.clog 2 p))

Concrete prime-field rows-balanced t-private k-server polynomial PIR for d * t < k < p and n ≤ ℓ ^ (d + 1) (weaker finite-field communication variant of CGKS, Section 1.1, pp. 1–2, via Section 3.4, p. 11, achieving exact k = c * t servers at d = c - 1 when 1 < c and 0 < t with factor ⌈log₂ p⌉).