Documentation

CslibFrontier.Crypto.Protocols.PIR.Block

Private block retrieval #

Chor, Goldreich, Kushilevitz and Sudan, Section 4 generalizes private information retrieval from single bits to databases of n blocks of ℓ bits each (PIR_k(n, ℓ)), hiding the block index i while amortizing communication across the block.

In our one-round framework (PIR.Basic, PIR.Collusion, PIR.SingleServer), block schemes reuse Scheme ι S R Q A β, HasScheme ι k c β, HasTPrivateScheme ι t k c β, and PIR.download ι β directly by instantiating the payload type β with κ → Bool (ℓ = |κ|).

Main definitions #

Main results #

References #

Reduction of block lower bounds to single-bit PIR #

def Cslib.Crypto.Protocols.PIR.Scheme.toBitScheme {ι S R Q A κ : Type} (P : Scheme ι S R Q A (κ → Bool)) :
Scheme (ι × κ) S R Q A

View a block scheme retrieving κ → Bool blocks as a single-bit scheme on ι × κ that sends the block query for ib.1 and extracts bit ib.2 from the reconstructed block.

theorem Cslib.Crypto.Protocols.PIR.Scheme.query_toBitScheme {ι S R Q A κ : Type} (P : Scheme ι S R Q A (κ → Bool)) (ib : ι × κ) :
theorem Cslib.Crypto.Protocols.PIR.Scheme.answer_toBitScheme {ι S R Q A κ : Type} (P : Scheme ι S R Q A (κ → Bool)) (s : S) (x : ι × κ → Bool) (q : Q) :
P.toBitScheme.answer Bool s x q = P.answer s (fun (i : ι) (b : κ) => x (i, b)) q
theorem Cslib.Crypto.Protocols.PIR.Scheme.reconstruct_toBitScheme {ι S R Q A κ : Type} (P : Scheme ι S R Q A (κ → Bool)) (ib : ι × κ) (r : R) (a : S → A) :
P.toBitScheme.reconstruct Bool ib r a = P.reconstruct ib.1 r a ib.2
theorem Cslib.Crypto.Protocols.PIR.Scheme.IsTPrivate.toBitScheme {ι S R Q A κ : Type} {P : Scheme ι S R Q A (κ → Bool)} {t : ℕ} (h : P.IsTPrivate t) :
theorem Cslib.Crypto.Protocols.PIR.Scheme.card_mul_le_communication_of_card_le {ι S R Q A κ : Type} [Fintype S] [Fintype ι] [Fintype κ] [Fintype Q] [Fintype A] {P : Scheme ι S R Q A (κ → Bool)} {t : ℕ} (hcorrect : P.IsCorrect) (hprivate : P.IsTPrivate t) (hcard : Fintype.card S ≤ t) :

Full-coalition (|S| ≤ t) private block retrieval of |ι| blocks of |κ| bits requires at least |ι| * |κ| bits of communication.

theorem Cslib.Crypto.Protocols.PIR.Scheme.card_mul_le_communication {ι S R Q A κ : Type} [Fintype S] [Unique S] [Fintype ι] [Fintype κ] [Fintype Q] [Fintype A] {P : Scheme ι S R Q A (κ → Bool)} (hcorrect : P.IsCorrect) (hprivate : P.IsPrivate) :

One-server private block retrieval of |ι| blocks of |κ| bits requires at least |ι| * |κ| bits of communication.

theorem Cslib.Crypto.Protocols.PIR.HasTPrivateScheme.toBitScheme {ι κ : Type} {t k c : ℕ} (h : HasTPrivateScheme ι t k c (κ → Bool)) :
HasTPrivateScheme (ι × κ) t k c

Every t-private block scheme for κ → Bool blocks induces a t-private single-bit scheme on ι × κ with the same server count and communication bound.

theorem Cslib.Crypto.Protocols.PIR.HasScheme.toBitScheme {ι κ : Type} {k c : ℕ} (h : HasScheme ι k c (κ → Bool)) :
HasScheme (ι × κ) k c

Every block scheme for κ → Bool blocks induces a single-bit scheme on ι × κ with the same server count and communication bound.

theorem Cslib.Crypto.Protocols.PIR.HasTPrivateScheme.card_mul_le_of_le {ι κ : Type} [Fintype ι] [Fintype κ] {t k c : ℕ} (h : HasTPrivateScheme ι t k c (κ → Bool)) (hkt : k ≤ t) :

One-server block retrieval needs exactly |ι| * |κ| bits, attained by PIR.download.

Proposition 4: single-entry PIR to κ-coordinate block PIR #

def Cslib.Crypto.Protocols.PIR.Scheme.toBlock {ι S R Q A β : Type} (κ : Type) (P : Scheme ι S R Q A β) :
Scheme ι S R Q (κ → A) (κ → β)

Proposition 4 CGKS, Section 4.1, p. 11: lift a scheme P to retrieve κ-indexed blocks κ → β by sending one query of P for the block index i and answering it once for each coordinate b : κ of the block.

theorem Cslib.Crypto.Protocols.PIR.Scheme.query_toBlock {ι S R Q A β : Type} (κ : Type) (P : Scheme ι S R Q A β) (i : ι) :
(toBlock κ P).query i = P.query i
theorem Cslib.Crypto.Protocols.PIR.Scheme.answer_toBlock {ι S R Q A β : Type} (κ : Type) (P : Scheme ι S R Q A β) (s : S) (x : ι → κ → β) (q : Q) (b : κ) :
(toBlock κ P).answer s x q b = P.answer s (fun (i' : ι) => x i' b) q
theorem Cslib.Crypto.Protocols.PIR.Scheme.reconstruct_toBlock {ι S R Q A β : Type} (κ : Type) (P : Scheme ι S R Q A β) (i : ι) (r : R) (a : S → κ → A) (b : κ) :
(toBlock κ P).reconstruct i r a b = P.reconstruct i r fun (s : S) => a s b
theorem Cslib.Crypto.Protocols.PIR.Scheme.IsCorrect.toBlock {ι S R Q A β : Type} (κ : Type) {P : Scheme ι S R Q A β} (h : P.IsCorrect) :
theorem Cslib.Crypto.Protocols.PIR.Scheme.IsPrivate.toBlock {ι S R Q A β : Type} (κ : Type) {P : Scheme ι S R Q A β} (h : P.IsPrivate) :
theorem Cslib.Crypto.Protocols.PIR.Scheme.IsTPrivate.toBlock {ι S R Q A β : Type} (κ : Type) {P : Scheme ι S R Q A β} {t : ℕ} (h : P.IsTPrivate t) :

Proposition 5 and the Abelian-group homomorphism reduction #

A one-bit-answer scheme has XOR-sum reconstruction when the user reconstructs the desired bit as ∑ s : S, a s over Bool (BooleanRing addition = exclusive-or), independent of i and r CGKS, Section 4.1, Proposition 5.

theorem Cslib.Crypto.Protocols.PIR.Scheme.hasXorReconstruct_iff {ι S R Q : Type} [Fintype S] (P : Scheme ι S R Q Bool) :
P.HasXorReconstruct ↔ ∀ (i : ι) (r : R) (a : S → Bool), P.reconstruct Bool i r a = ∑ s : S, a s
def Cslib.Crypto.Protocols.PIR.Scheme.mapAnswerHom {ι S R Q A : Type} [Fintype S] {G : Type} [AddCommGroup G] (P : Scheme ι S R Q A) (f : S → A → G) (g : G →+ Bool) :
Scheme ι S R Q Bool

Abelian-group homomorphism reduction to XOR-sum reconstruction CGKS, Section 4.1, p. 12: if P reconstructs via g (∑ s, f s (a s)) for fixed maps f : S → A → G into an AddCommGroup G and an additive homomorphism g : G →+ Bool (independent of i and r), letting each server send the single bit g (f s (P.answer s x q)) produces a one-bit-answer scheme satisfying HasXorReconstruct.

theorem Cslib.Crypto.Protocols.PIR.Scheme.hasXorReconstruct_mapAnswerHom {ι S R Q A : Type} [Fintype S] {G : Type} [AddCommGroup G] (P : Scheme ι S R Q A) (f : S → A → G) (g : G →+ Bool) :
theorem Cslib.Crypto.Protocols.PIR.Scheme.IsCorrect.mapAnswerHom {ι S R Q A : Type} [Fintype S] {G : Type} [AddCommGroup G] {P : Scheme ι S R Q A} (hcorrect : P.IsCorrect) (f : S → A → G) (g : G →+ Bool) (hrec : ∀ (i : ι) (r : R) (a : S → A), P.reconstruct Bool i r a = g (∑ s : S, f s (a s))) :
theorem Cslib.Crypto.Protocols.PIR.Scheme.IsTPrivate.mapAnswerHom {ι S R Q A : Type} [Fintype S] {G : Type} [AddCommGroup G] {P : Scheme ι S R Q A} {t : ℕ} (hprivate : P.IsTPrivate t) (f : S → A → G) (g : G →+ Bool) :
theorem Cslib.Crypto.Protocols.PIR.Scheme.IsPrivate.mapAnswerHom {ι S R Q A : Type} [Fintype S] {G : Type} [AddCommGroup G] {P : Scheme ι S R Q A} (hprivate : P.IsPrivate) (f : S → A → G) (g : G →+ Bool) :
def Cslib.Crypto.Protocols.PIR.Scheme.sumChunks {ι S R Q : Type} [Fintype S] (m : ℕ) (P : Scheme (Option ι) S R Q Bool) :
Scheme (Fin m × ι) S Unit (Fin m → Q) Bool

Proposition 5 CGKS, Section 4.1, pp. 11–12: given a scheme P on Option ι (n real positions some i plus one dummy zero position none) with one-bit answers and XOR-sum reconstruction, P.sumChunks m solves Fin m × ι (m * n bits) by running m independent instances (querying some i₀ in chunk j₀ and the dummy none in every other chunk) and having each server XOR its m answer bits into a single reply bit.

theorem Cslib.Crypto.Protocols.PIR.Scheme.IsCorrect.sumChunks {ι S R Q : Type} [Fintype S] (m : ℕ) {P : Scheme (Option ι) S R Q Bool} (hcorrect : P.IsCorrect) (hxor : P.HasXorReconstruct) :

Correctness of Proposition 5: in chunk j = ji.1 the servers' answers sum to x ji, and in every other chunk j ≠ ji.1 they sum to the dummy zero bit false.

theorem Cslib.Crypto.Protocols.PIR.Scheme.IsTPrivate.sumChunks {ι S R Q : Type} [Fintype S] (m : ℕ) {P : Scheme (Option ι) S R Q Bool} {t : ℕ} (hprivate : P.IsTPrivate t) :

sumChunks preserves t-privacy for every t (and hence single-server IsPrivate at t = 1), without any finiteness assumptions on R or Q.

Communication bounds and Corollaries 6, 7 and 8 #

General Proposition 4 communication bound for arbitrary finite answer alphabet A (including non-power-of-two field answers such as ZMod p).

Proposition 4 multiplies b-bit server answers (|A| = 2 ^ b) by |κ|.

Proposition 5 uses m queries and a 1-bit answer per server.

theorem Cslib.Crypto.Protocols.PIR.hasTPrivateBlockScheme_of_xorReconstruct {S R Q : Type} [Fintype S] [Fintype Q] {n m N ℓ t : ℕ} {P : Scheme (Option (Fin n)) S R Q Bool} (hcorrect : P.IsCorrect) (hprivate : P.IsTPrivate t) (hxor : P.HasXorReconstruct) (hN : N ≤ m * n) :

t-private Corollary 6 CGKS, Section 4.1, p. 13: combining Proposition 5 (sumChunks) and Proposition 4 (toBlock) preserves t-privacy while achieving |S| * (m * ⌈log₂ |Q|⌉ + ℓ) bits for N ≤ m * n blocks of ℓ bits.

theorem Cslib.Crypto.Protocols.PIR.hasBlockScheme_of_xorReconstruct {S R Q : Type} [Fintype S] [Fintype Q] {n m N ℓ : ℕ} {P : Scheme (Option (Fin n)) S R Q Bool} (hcorrect : P.IsCorrect) (hprivate : P.IsPrivate) (hxor : P.HasXorReconstruct) (hN : N ≤ m * n) :
HasScheme (Fin N) (Fintype.card S) (Fintype.card S * (m * Nat.clog 2 (Fintype.card Q) + ℓ)) (Fin ℓ → Bool)

Corollary 6 CGKS, Section 4.1, p. 13: combining Proposition 5 (sumChunks) and Proposition 4 (toBlock), an XOR-reconstruction single-bit scheme P on Option (Fin n) (n + 1 bits) yields an ℓ-bit block scheme for any N ≤ m * n blocks with communication at most |S| * (m * ⌈log₂ |Q|⌉ + ℓ).

theorem Cslib.Crypto.Protocols.PIR.hasBlockScheme_two_of_le {n ℓ : ℕ} (h : n ≤ ℓ) :
HasScheme (Fin n) 2 (4 * ℓ) (Fin ℓ → Bool)

Corollary 7 CGKS, Section 4.2, p. 13: when n ≤ ℓ, two servers retrieve an ℓ-bit block from n blocks with at most 4 * ℓ bits of communication (a constant factor of 4 over the block length).

theorem Cslib.Crypto.Protocols.PIR.hasBlockScheme_four_of_le_sq {n m ℓ : ℕ} (hn : n ≤ m * m) (hm : 2 * m ≤ ℓ) :
HasScheme (Fin n) 4 (8 * ℓ) (Fin ℓ → Bool)

Corollary 8 CGKS, Section 4.2, p. 13: when n ≤ m ^ 2 and 2 * m ≤ ℓ, four servers (d = 2 subcube PIR lifted via Proposition 4) retrieve an ℓ-bit block from n blocks with at most 8 * ℓ bits of communication.

theorem Cslib.Crypto.Protocols.PIR.hasBlockScheme_four_of_le_half_sq {n ℓ : ℕ} (h : n ≤ (ℓ / 2) ^ 2) :
HasScheme (Fin n) 4 (8 * ℓ) (Fin ℓ → Bool)

Closed-form specialization of Corollary 8 for n ≤ (ℓ / 2) ^ 2 (replacing the paper's unrounded n ≤ ℓ ^ 2 / 4, and matching it whenever ℓ is even).