Documentation

CslibFrontier.Crypto.Protocols.PIR.Cube

Subcube schemes for private information retrieval #

The schemes of Chor, Goldreich, Kushilevitz and Sudan, Section 3 ask each server for the exclusive or of the database bits over a set of positions.

Flipping one coordinate of a server changes its query in a single set (PIR.query_update_cube). The covering-code schemes of Section 3.3 (PIR.CoveringCode) use this to let fewer servers emulate all 2 ^ d.

Main definitions #

Main results #

References #

Two servers #

noncomputable def Cslib.Crypto.Protocols.PIR.twoServer (ι : Type) [Fintype ι] [DecidableEq ι] :
Scheme ι Bool Unit (ι → Bool) Bool

The basic two-server scheme CGKS, Section 3.1. The servers are false and true. For the index i, the user draws a uniform t : ι → Bool and sends t to the server false and t + eᵢ to the server true. Each server answers with the parity x ⬝ᵥ a of the database on the set a it receives, and the user adds the two answers.

Each server of the two-server scheme receives a uniform set, whatever the index.

theorem Cslib.Crypto.Protocols.PIR.query_add_query_twoServer {ι : Type} [Fintype ι] [DecidableEq ι] {i : ι} {r : Unit} {q : Bool → ι → Bool} (hrq : (r, q) ∈ ((twoServer ι).query Bool i).eval.support) :

The two queries of the two-server scheme add up to eᵢ: together, the servers know i.

The two-server scheme is correct CGKS, Section 3.1: the answers x ⬝ᵥ t and x ⬝ᵥ (t + eᵢ) add up to x i.

The two-server scheme sends n bits to each server and receives one bit from each.

The rows transformation of the two-server scheme reads an m × n matrix with 2 (m + n) bits CGKS, Section 3.4.

2 ^ d servers #

noncomputable def Cslib.Crypto.Protocols.PIR.cube (D ι : Type) [Fintype D] [DecidableEq D] [Fintype ι] [DecidableEq ι] :
Scheme (D → ι) (D → Bool) Unit (D → ι → Bool) Bool

The subcube scheme with 2 ^ |D| servers CGKS, Section 3.2 for databases indexed by the cube D → ι. The servers are σ : D → Bool. For the index i, the user draws uniform sets t l : ι → Bool and sends the server σ the sets t l + σ l • e_{i l}. The server answers with the exclusive or ∑ j, x j * ∏ l, a l (j l) of the database over the subcube ∏ l, a l it receives, and the user adds all the answers.

theorem Cslib.Crypto.Protocols.PIR.eval_serverQuery_cube {D ι : Type} [Fintype D] [DecidableEq D] [Fintype ι] [DecidableEq ι] (σ : D → Bool) (i : D → ι) :

Each server of the subcube scheme receives |D| uniform independent sets, whatever the index.

The subcube scheme is private CGKS, Section 3.2.

The subcube scheme is correct CGKS, Section 3.2: the position i lies in exactly one of the 2 ^ d subcubes and every other position in an even number of them.

The subcube scheme sends d sets of ℓ bits to each of the 2 ^ d servers and receives one bit from each: 2 ^ d (d ℓ + 1) bits CGKS, Section 3.2.

theorem Cslib.Crypto.Protocols.PIR.answer_cube {D ι : Type} [Fintype D] [DecidableEq D] [Fintype ι] [DecidableEq ι] (σ : D → Bool) (x : (D → ι) → Bool) (a : D → ι → Bool) :
(cube D ι).answer Bool σ x a = ∑ j : D → ι, x j * ∏ l : D, a l (j l)

The server σ of the subcube scheme answers with the sum of the database over its subcube.

theorem Cslib.Crypto.Protocols.PIR.reconstruct_cube {D ι : Type} [Fintype D] [DecidableEq D] [Fintype ι] [DecidableEq ι] (i : D → ι) (r : Unit) (a : (D → Bool) → Bool) :
(cube D ι).reconstruct Bool i r a = ∑ σ : D → Bool, a σ

The user of the subcube scheme adds the answers of all 2 ^ d servers.

theorem Cslib.Crypto.Protocols.PIR.query_update_cube {D ι : Type} [Fintype D] [DecidableEq D] [Fintype ι] [DecidableEq ι] {i : D → ι} {r : Unit} {q : (D → Bool) → D → ι → Bool} (hrq : (r, q) ∈ ((cube D ι).query Bool i).eval.support) (σ : D → Bool) (l : D) :
q (Function.update σ l !σ l) = Function.update (q σ) l (q σ l + Pi.single (i l) true)

Flipping the coordinate l of a server of the subcube scheme flips the membership of i l in its l-th set: the query of update σ l (!σ l) is that of σ with e_{i l} added at l. This is what lets one server emulate its neighbours CGKS, Section 3.3.

Schemes for n-bit databases #

Two servers with 4 m bits CGKS, Corollary 3: every n ≤ m ^ 2 has a perfectly correct and perfectly private two-server scheme for n-bit databases communicating 4 m bits.

Two servers with 4 (⌊√n⌋ + 1) bits.

theorem Cslib.Crypto.Protocols.PIR.hasScheme_two_pow_of_le_pow {n d ℓ : ℕ} (h : n ≤ ℓ ^ d) :
HasScheme (Fin n) (2 ^ d) (2 ^ d * (d * ℓ + 1))

2 ^ d servers with 2 ^ d (d ℓ + 1) bits CGKS, Section 3.2: every n ≤ ℓ ^ d has a perfectly correct and perfectly private 2 ^ d-server scheme for n-bit databases communicating 2 ^ d (d ℓ + 1) bits. With ℓ = ⌈n ^ (1/d)⌉ this is the source's 2 ^ d (d n ^ (1/d) + 1).