A C++ implementation of Private Information Retrieval (PIR) protocols
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
PIR Client

A PIR client is used to retrieve database blocks from a server.

Below we explain the steps necessary to create a PIR client using our interface.

Protocol Parameters

The first step is to create a protocol parameters object with information about our protocol and the database. This protocol parameters object will be an instantiation of one of the classes derived from PercyParams:

Goldberg's IT-PIR protocol (2007) over the integers modulo p
Goldberg's IT-PIR protocol (2007) over GF(2^E)
Chor et al.'s IT-PIR protocol (1995)
Aguilar Melchor and Gaborit's CPIR protocol (2007)
Aguilar Melchor and Gaborit's CPIR protocol (2007) with recursion
Devet and Goldberg's Hybrid PIR protocol (2014)

Client Parameters

The protocol parameters object is then encapsulated in a client parameters object. This contains information about how the client will encode the queries and decode the server replies.

If our protocol parameters object is non-recursive (one of AGParams, ChorParams, GF2EParams, or ZZ_pParams) we create a PercyClientParams object.

Otherwise, our protocol parameters object is recursive (one of HybridParams or RecursiveAGParams) and we create a RecursiveClientParams object.


Finally, we create our client object. This is done by passing our client parameters to the factory method PercyClient::make_client().

Using the Client

To retrieve database blocks from the database, we do the following:

  1. Encode the request to the server by calling PercyClient::encode_request() on the desired database block indices. The result will be a request ID that will be needed for the rest of the steps.
  2. Establish connection(s) to the server(s) and send the request to the server(s) using the PercyClient::send_request() method.
  3. Read the response(s) from the server(s) using the PercyClient::receive_replies() method.
  4. Decode the reponse(s) from the server(s) using the PercyClient::process_replies() method.
  5. Retrieve the results of decoding with the PercyClient::get_result() method.

The steps above can be done all at once using the PercyClient::fetch_blocks() method.