Percy++
A C++ implementation of Private Information Retrieval (PIR) protocols
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
recursiveclient.h
1 // Percy++ Copyright 2007,2012,2013,2014
2 // Ian Goldberg <iang@cs.uwaterloo.ca>,
3 // Casey Devet <cjdevet@uwaterloo.ca>
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of version 2 of the GNU General Public License as
7 // published by the Free Software Foundation.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // There is a copy of the GNU General Public License in the COPYING file
15 // packaged with this plugin; if you cannot find it, write to the Free
16 // Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 // 02110-1301 USA
18 
19 #ifndef __HYBRIDCLIENT_H__
20 #define __HYBRIDCLIENT_H__
21 
22 #include <set>
23 #include "percyclient.h"
24 #include "recursiveparams.h"
25 
26 NTL_CLIENT
27 
29 
30 class RecursiveClient : public PercyClient {
31 public:
41  nservers_t num_servers, nservers_t t, sid_t * sids = NULL,
42  PercyStats * stats = NULL);
43 
46 
47 private:
49  const RecursiveParams * params;
50 
51  // Virtual members as described in PercyClient class
52  virtual void encode_request_impl (nqueries_t request_identifier);
53  virtual dbsize_t send_request_impl (nqueries_t request_identifier,
54  vector<ostream*> &osvec, bool send_num_queries = true);
55  virtual dbsize_t receive_replies_impl (nqueries_t request_identifier,
56  vector<istream*> &isvec);
57  virtual nqueries_t process_replies_impl (nservers_t h,
58  vector<vector<PercyResult> >& results);
59 
60  // Clients used for each iteration.
61  std::vector<PercyClient*> iteration_clients;
62 
63  // inner request identifiers (by req_id, then query index, then iteration
64  // index)
65  std::map<nqueries_t, std::vector<std::vector<nqueries_t> > > req_ids;
66 
67  // For each request_id and query index, the depth at which the reply was
68  // fully processed.
69  std::map<nqueries_t, std::vector<nqueries_t> > unprocessed;
70 };
71 
72 #endif
Definition: recursiveparams.h:24
Definition: percystats.h:66
const PercyClientParams * clientparams
Parameters for the client.
Definition: percyclient.h:181
RecursiveClient(const RecursiveClientParams *clientparams, nservers_t num_servers, nservers_t t, sid_t *sids=NULL, PercyStats *stats=NULL)
Constructor.
nservers_t t
The privacy level.
Definition: percyclient.h:186
Definition: recursiveparams.h:73
A PIR client for recursive PIR protocols.
Definition: recursiveclient.h:30
~RecursiveClient()
Destructor.
nservers_t num_servers
The number of servers.
Definition: percyclient.h:183
An abstract base class for a PIR client.
Definition: percyclient.h:35