Documentation

CslibFrontier.Crypto.Protocols.PIR.SmoothCode

Private information retrieval from perfectly smooth codes #

A non-adaptive q-query decoder for a code C : (ι → Bool) → P → Γ draws coins r, reads the positions Q i r k for k < q, and outputs output i r of the symbols read (Code.nonadaptive). Give each read its own server holding the codeword C x: the user sends the position Q i r k to the server k, the server answers with the symbol C x (Q i r k), and the user runs the decoder's output function on the answers. This is PIR.ofDecoder Yekhanin, Lemma 6.2.

The source states the lemma for a perfectly smooth locally decodable code; its proof uses only that the decoder recovers x i from uncorrupted codewords, which is the hypothesis here. Decoding corrupted words is not needed. The source's databases and messages are q-ary; here they are Boolean, as in Scheme, while the code alphabet Γ is arbitrary. The decoder is non-adaptive, as in the source's proof, which sends all the queries at once.

Main definitions #

Main results #

References #

def Cslib.Crypto.Protocols.PIR.ofDecoder {ι P Γ R : Type} {q : ℕ} (C : (ι → Bool) → P → Γ) (coins : ι → ProbComp R) (Q : ι → R → Fin q → P) (output : ι → R → (Fin q → Γ) → Bool) :
Scheme ι (Fin q) R P Γ

The q-server scheme of a non-adaptive q-query decoder for the code C Yekhanin, Lemma 6.2: the servers hold the codeword C x, the server k receives the k-th position read by the decoder and answers with the symbol there, and the user runs the decoder's output function on the answers.

theorem Cslib.Crypto.Protocols.PIR.eval_run_ofDecoder {ι P Γ R : Type} {q : ℕ} (C : (ι → Bool) → P → Γ) (coins : ι → ProbComp R) (Q : ι → R → Fin q → P) (output : ι → R → (Fin q → Γ) → Bool) (x : ι → Bool) (i : ι) :
((ofDecoder C coins Q output).run x i).eval = Code.decodeLaw (Code.nonadaptive (coins i) (Q i) (output i)) (C x)

The user's output has the law of the decoder on the codeword.

theorem Cslib.Crypto.Protocols.PIR.eval_serverQuery_ofDecoder {ι P Γ R : Type} {q : ℕ} (C : (ι → Bool) → P → Γ) (coins : ι → ProbComp R) (Q : ι → R → Fin q → P) (output : ι → R → (Fin q → Γ) → Bool) (k : Fin q) (i : ι) :
((ofDecoder C coins Q output).serverQuery k i).eval = PMF.map (fun (r : R) => Q i r k) (coins i).eval

The query of the server k is the k-th position read by the decoder.

theorem Cslib.Crypto.Protocols.PIR.isCorrect_ofDecoder_iff {ι P Γ R : Type} {q : ℕ} (C : (ι → Bool) → P → Γ) (coins : ι → ProbComp R) (Q : ι → R → Fin q → P) (output : ι → R → (Fin q → Γ) → Bool) :
(ofDecoder C coins Q output).IsCorrect ↔ ∀ (x : ι → Bool) (i : ι), Code.decodeLaw (Code.nonadaptive (coins i) (Q i) (output i)) (C x) = PMF.pure (x i)

The scheme of a decoder is perfectly correct exactly when the decoder decodes every codeword with probability one.

theorem Cslib.Crypto.Protocols.PIR.isPrivate_ofDecoder_iff {ι P Γ R : Type} {q : ℕ} (C : (ι → Bool) → P → Γ) (coins : ι → ProbComp R) (Q : ι → R → Fin q → P) (output : ι → R → (Fin q → Γ) → Bool) :
(ofDecoder C coins Q output).IsPrivate ↔ ∀ (k : Fin q) (i i' : ι), PMF.map (fun (r : R) => Q i r k) (coins i).eval = PMF.map (fun (r : R) => Q i' r k) (coins i').eval

The scheme of a decoder is perfectly private exactly when the law of each position read does not depend on the index.

theorem Cslib.Crypto.Protocols.PIR.isPrivate_ofDecoder {ι P Γ R : Type} {q : ℕ} (C : (ι → Bool) → P → Γ) (coins : ι → ProbComp R) (Q : ι → R → Fin q → P) (output : ι → R → (Fin q → Γ) → Bool) [Fintype P] [Nonempty P] (huniform : ∀ (i : ι) (k : Fin q), PMF.map (fun (r : R) => Q i r k) (coins i).eval = Probability.PMF.uniformOfFintype P) :
(ofDecoder C coins Q output).IsPrivate

The scheme of a perfectly smooth decoder is private Yekhanin, Lemma 6.2: when each position read is uniform, each server receives a uniform position.

The scheme of a q-query decoder for codewords of length N over Γ communicates q (⌈log₂ N⌉ + ⌈log₂ |Γ|⌉) bits Yekhanin, Lemma 6.2.

theorem Cslib.Crypto.Protocols.PIR.hasScheme_ofDecoder {ι P Γ R : Type} {q : ℕ} (C : (ι → Bool) → P → Γ) (coins : ι → ProbComp R) (Q : ι → R → Fin q → P) (output : ι → R → (Fin q → Γ) → Bool) [Fintype P] [Nonempty P] [Fintype Γ] (huniform : ∀ (i : ι) (k : Fin q), PMF.map (fun (r : R) => Q i r k) (coins i).eval = Probability.PMF.uniformOfFintype P) (hcorrect : ∀ (x : ι → Bool) (i : ι), Code.decodeLaw (Code.nonadaptive (coins i) (Q i) (output i)) (C x) = PMF.pure (x i)) :

Private information retrieval from a perfectly smooth code Yekhanin, Lemma 6.2: a non-adaptive q-query decoder for a code of length N over Γ, each of whose reads is a uniform position and which decodes every codeword with probability one, gives a perfectly correct and perfectly private q-server scheme communicating q (⌈log₂ N⌉ + ⌈log₂ |Γ|⌉) bits.