Documentation

CslibFrontier.Crypto.Protocols.PIR.Interactive

Interactive single-server private information retrieval #

With one server, even interaction does not help: a perfectly private and perfectly correct protocol must exchange n bits Chor, Goldreich, Kushilevitz and Sudan, Section 5.1. PIR.SingleServer proves the one-round case; this file proves the interactive one.

An interactive scheme P : PIR.InteractiveScheme ι C D β (by default β = Bool, or multi-bit blocks in Section 4) is a deterministic two-party protocol P.protocol (Cslib.Communication.Protocol) between the server, holding the database x : ι → β and its coins d : D, and the user, holding the index i : ι and its coins c : C. The protocol may use any number of rounds, and the coins are drawn by the probabilistic programs P.serverCoins and P.userCoins i (the latter may depend on i). The transcript P.transcript x i is the leaf the protocol reaches. It determines every bit sent, so it is everything the server sees besides its own input. The user's output P.run x i is the label of that leaf applied to the user's view (i, c).

The user's output depends on its view, not only on the transcript. Perfect privacy (InteractiveScheme.IsPrivate) says that for every database, the transcript has the same distribution for all indices. If the output were a function of the transcript alone, it would therefore have the same distribution for all indices, and no scheme could be correct for a database with two different entries. So leaves are labelled by functions ι × C → β, and the user's output may depend on its private coins as well as on the communication. In this generality, the source's step "on the same communication C, the user must output the same bit" is replaced by the rectangle property of protocols (Communication.Protocol.leaf_eq_iff). Suppose that a leaf is reached on (x, d₁) with user view (j, c₁), and on (y, d₂) with user view (j, c₂). Then it is also reached on (y, d₂) with user view (j, c₁). On that one view, correctness forces the label to output both x j and y j.

With that step, the source's counting argument goes through (InteractiveScheme.injective_leaf): for fixed coins, the transcript determines the database. Over a finite payload β, every index has at least |β| ^ |ι| possible transcripts (InteractiveScheme.card_pow_card_le_ncard_transcripts, specializing to 2 ^ n in InteractiveScheme.two_pow_card_le_ncard_transcripts), the protocol tree has at least |β| ^ |ι| leaves (InteractiveScheme.card_pow_card_le_leafCount, InteractiveScheme.two_pow_card_le_leafCount), Boolean databases need depth at least n (InteractiveScheme.card_le_depth), and (κ → Bool) block databases need depth at least |ι| · |κ| (InteractiveScheme.card_mul_le_depth). Communication is measured by Protocol.depth, the worst-case number of bits over all branches of the protocol tree, reachable or not. The privacy hypothesis asks only that the transcript law be independent of i. This is weaker than privacy of the server's whole view, since the server's own coins do not depend on i anyway. The proofs use privacy only through supports: a transcript possible for (x, i) is possible for (x, j). The server sending the database attains both bounds (InteractiveScheme.download, InteractiveScheme.blockDownload), giving tight depth characterizations for both single-bit and ℓ-bit block databases (InteractiveScheme.exists_iff, InteractiveScheme.exists_block_iff).

The server is Alice and the user is Bob in Communication.Protocol. With uniform bit-string coins and leaves labelled by Bool, a scheme would be a Communication.PrivateCoin protocol. Here the leaves are labelled by functions of the user's view, and the user's coins may depend on its index, so InteractiveScheme is a separate structure.

Main definitions #

Main results #

References #

An interactive single-server private information retrieval scheme for databases x : ι → β (by default β = Bool, or multi-bit blocks in Section 4), with user coins C and server coins D CGKS, Sections 4 and 5.1. The server (Alice) holds the database and its coins, and the user (Bob) holds the index and its coins. Each leaf of the protocol is labelled by the user's output as a function of its view.

  • userCoins : ι → ProbComp C

    The user's coins for the index i.

  • serverCoins : ProbComp D

    The server's coins.

  • protocol : Communication.Protocol ((ι → β) × D) (ι × C) (ι × C → β)

    The protocol; its leaves are labelled by the user's output as a function of its view.

def Cslib.Crypto.Protocols.PIR.InteractiveScheme.coins {ι C D β : Type} (P : InteractiveScheme ι C D β) (i : ι) :
ProbComp (C × D)

The coins of the user, for the index i, and of the server, drawn independently.

def Cslib.Crypto.Protocols.PIR.InteractiveScheme.transcript {ι C D β : Type} (P : InteractiveScheme ι C D β) (x : ι → β) (i : ι) :

The transcript of the protocol on the database x and the index i: the leaf it reaches. The leaf determines every bit sent, in order.

def Cslib.Crypto.Protocols.PIR.InteractiveScheme.run {ι C D β : Type} (P : InteractiveScheme ι C D β) (x : ι → β) (i : ι) :

The user's output on the database x and the index i: the label of the leaf reached, applied to the user's view.

Perfect correctness: on every database, the user outputs the entry it asks for with probability one.

Perfect privacy: for every database, the transcript has the same distribution for all indices.

noncomputable def Cslib.Crypto.Protocols.PIR.InteractiveScheme.transcripts {ι C D β : Type} (P : InteractiveScheme ι C D β) (i : ι) :

The possible transcripts for the index i: the leaves reached with positive probability on some database.

theorem Cslib.Crypto.Protocols.PIR.InteractiveScheme.eval_coins {ι C D β : Type} (P : InteractiveScheme ι C D β) (i : ι) :
(P.coins i).eval = (P.userCoins i).eval.bind fun (c : C) => PMF.map (fun (d : D) => (c, d)) P.serverCoins.eval
theorem Cslib.Crypto.Protocols.PIR.InteractiveScheme.eval_transcript {ι C D β : Type} (P : InteractiveScheme ι C D β) (x : ι → β) (i : ι) :
(P.transcript x i).eval = PMF.map (fun (cd : C × D) => P.protocol.leaf (x, cd.2) (i, cd.1)) (P.coins i).eval
theorem Cslib.Crypto.Protocols.PIR.InteractiveScheme.eval_run {ι C D β : Type} (P : InteractiveScheme ι C D β) (x : ι → β) (i : ι) :
(P.run x i).eval = PMF.map (fun (cd : C × D) => P.protocol.leafOutput (P.protocol.leaf (x, cd.2) (i, cd.1)) (i, cd.1)) (P.coins i).eval
theorem Cslib.Crypto.Protocols.PIR.InteractiveScheme.mem_support_transcript_iff {ι C D β : Type} (P : InteractiveScheme ι C D β) {x : ι → β} {i : ι} {t : Fin P.protocol.leafCount} :
t ∈ (P.transcript x i).eval.support ↔ ∃ c ∈ (P.userCoins i).eval.support, ∃ d ∈ P.serverCoins.eval.support, P.protocol.leaf (x, d) (i, c) = t
theorem Cslib.Crypto.Protocols.PIR.InteractiveScheme.isCorrect_iff {ι C D β : Type} (P : InteractiveScheme ι C D β) :
P.IsCorrect ↔ ∀ (x : ι → β) (i : ι), ∀ c ∈ (P.userCoins i).eval.support, ∀ d ∈ P.serverCoins.eval.support, P.protocol.leafOutput (P.protocol.leaf (x, d) (i, c)) (i, c) = x i

Perfect correctness holds exactly when the user outputs the right entry on all coins that can be drawn.

theorem Cslib.Crypto.Protocols.PIR.InteractiveScheme.isPrivate_iff {ι C D β : Type} (P : InteractiveScheme ι C D β) :
P.IsPrivate ↔ ∀ (x : ι → β) (i i' : ι), (P.transcript x i).eval = (P.transcript x i').eval
theorem Cslib.Crypto.Protocols.PIR.InteractiveScheme.IsCorrect.leafOutput_eq {ι C D β : Type} {P : InteractiveScheme ι C D β} (h : P.IsCorrect) (x : ι → β) {i : ι} {c : C} {d : D} (hc : c ∈ (P.userCoins i).eval.support) (hd : d ∈ P.serverCoins.eval.support) :

A correct scheme outputs the right entry on all coins that can be drawn.

theorem Cslib.Crypto.Protocols.PIR.InteractiveScheme.injective_leaf {ι C D β : Type} {P : InteractiveScheme ι C D β} (hcorrect : P.IsCorrect) (hprivate : P.IsPrivate) {i : ι} {c : C} {d : D} (hc : c ∈ (P.userCoins i).eval.support) (hd : d ∈ P.serverCoins.eval.support) :
Function.Injective fun (x : ι → β) => P.protocol.leaf (x, d) (i, c)

For fixed coins, the transcript determines the database CGKS, Section 5.1. If two databases x ≠ y reached the same leaf, then by privacy that leaf would also be reached for an index j with x j ≠ y j, on both databases. By the rectangle property, it is then reached on y with the user's view from the run on x, and on that view the user would have to output both x j and y j.

Every index has at least |β| ^ |ι| possible transcripts.

Every index has at least 2 ^ n possible transcripts CGKS, Section 5.1.

A perfectly correct and perfectly private interactive scheme over payload β has at least |β| ^ |ι| transcripts.

A perfectly correct and perfectly private interactive scheme for n-bit databases has at least 2 ^ n transcripts.

A perfectly correct and perfectly private single-server block scheme for n blocks of ℓ bits has protocol depth at least n · ℓ, even with interaction CGKS, Sections 4 and 5.1.

A perfectly correct and perfectly private single-server scheme for n-bit databases has protocol depth at least n, even with interaction CGKS, Section 5.1. The depth is the worst-case number of bits over all branches of the protocol tree.

The trivial scheme #

The server sends its database, with no coins on either side, and the user reads the bit it wants.

One server needs exactly n bits, with or without interaction: a perfectly correct and perfectly private interactive scheme for n-bit databases of protocol depth at most c (the worst case over all branches of the protocol tree) exists exactly when n ≤ c CGKS, Section 5.1.

Trivial interactive block download: the server sends all n · ℓ bits of the n blocks, and the user outputs block i.

One server needs n · ℓ bits for ℓ-bit blocks, with or without interaction: a perfectly correct and perfectly private interactive block scheme of protocol depth at most c exists iff n · ℓ ≤ c CGKS, Sections 4 and 5.1.