20 #ifndef __ITCLIENT_H__
21 #define __ITCLIENT_H__
23 #include <vec_vec_ZZ_p.h>
25 #include "percyclient.h"
29 #include "rsdecoder.h"
32 #include "spirclient.h"
62 nservers_t
t, sid_t * sids,
PercyStats * stats = NULL);
69 virtual void encode_request_impl (nqueries_t request_identifier);
70 virtual dbsize_t send_request_impl (nqueries_t request_identifier,
71 vector<ostream*> &osvec,
bool send_num_queries =
true);
72 virtual dbsize_t receive_replies_impl (nqueries_t request_identifier,
73 vector<istream*> &isvec);
74 virtual nqueries_t process_replies_impl (nservers_t h,
75 vector<vector<PercyResult> >& results);
80 virtual void choose_indices(sid_t *sids);
81 virtual void choose_interp_indices(nqueries_t qbs);
86 vec_ZZ_p interp_indices;
87 vector<vec_ZZ_p> vecs_interp_indices;
88 map<nqueries_t, vec_vec_ZZ_p *> queries;
90 map<nqueries_t, SPIRClientQuery *> spir_query_info;
92 map<nqueries_t, vec_ZZ_p> randmults;
93 vector<vector<vec_ZZ_p> > answers;
94 vector<vector<DecoderResult<ZZ_p> > > unfinished_results;
95 vector<std::set<dbsize_t> > decoded;
118 virtual void encode_request_impl (nqueries_t request_identifier);
119 virtual dbsize_t send_request_impl (nqueries_t request_identifier,
120 vector<ostream*> &osvec,
bool send_num_queries =
true);
121 virtual dbsize_t receive_replies_impl (nqueries_t request_identifier,
122 vector<istream*> &isvec);
123 virtual nqueries_t process_replies_impl (nservers_t h,
124 vector<vector<PercyResult> >& results);
128 map<nqueries_t, unsigned char *> queries;
129 vector<unsigned char *> answers;
146 template<
typename GF2E_Element>
159 nservers_t
t, sid_t * sids,
PercyStats * stats = NULL);
166 virtual void encode_request_impl (nqueries_t request_identifier);
167 virtual dbsize_t send_request_impl (nqueries_t request_identifier,
168 vector<ostream*> &osvec,
bool send_num_queries =
true);
169 virtual dbsize_t receive_replies_impl (nqueries_t request_identifier,
170 vector<istream*> &isvec);
171 virtual nqueries_t process_replies_impl (nservers_t h,
172 vector<vector<PercyResult> >& results);
174 virtual void choose_indices(sid_t *sids);
175 virtual void choose_interp_indices(nqueries_t qbs);
178 bool try_fast_recover (nservers_t h, vector<vector<PercyResult> > &results);
180 void construct_lagrange_coeffs(GF2E_Element *coeffs, GF2E_Element alpha,
181 nservers_t firstpoint, nservers_t numpoints);
182 inline GF2E_Element interpolate(
const GF2E_Element *word_answers,
183 const GF2E_Element *coeffs, nservers_t firstpoint,
184 nservers_t numpoints);
188 GF2E_Element * indices;
189 GF2E_Element * interp_indices;
190 vec_GF2E vec_interp_indices;
191 vector<vec_GF2E> vecs_interp_indices;
192 vec_GF2E indices_ntl;
193 map<nqueries_t, vector<GF2E_Element> > randmults;
194 map<nqueries_t, GF2E_Element *> stored_shares;
195 vector<GF2E_Element *> answers;
196 vector<vector<vec_GF2E> > answers_ntl;
197 map<nqueries_t, vector<dbsize_t> > undecoded_indices;
198 vector<vector<DecoderResult<GF2E> > > unfinished_results;
199 vector<std::set<dbsize_t> > decoded;
202 #include "itclient_impl.h"
PercyClient_ZZ_p(const PercyClientParams *params, nservers_t num_servers, nservers_t t, sid_t *sids, PercyStats *stats=NULL)
Constructor.
Client parameters.
Definition: percyparams.h:189
Definition: percystats.h:66
nservers_t t
The privacy level.
Definition: percyclient.h:186
A PIR client for the IT-PIR protocol by Goldberg (2007) over GF(2^E).
Definition: itclient.h:147
virtual ~PercyClient_GF2E()
Destructor.
Definition: itclient_impl.h:84
virtual ~PercyClient_ZZ_p()
Destructor.
nservers_t num_servers
The number of servers.
Definition: percyclient.h:183
Definition: itparams.h:162
Definition: itparams.h:33
A PIR client for the IT-PIR protocol by Chor et al. (1995).
Definition: itclient.h:103
A PIR client for the IT-PIR protocol by Goldberg (2007) over the integers modulo p.
Definition: itclient.h:50
PercyClient_Chor(const PercyClientParams *params, nservers_t num_servers, PercyStats *stats=NULL)
Constructor.
An abstract base class for a PIR client.
Definition: percyclient.h:35
PercyClient_GF2E(const PercyClientParams *params, nservers_t num_servers, nservers_t t, sid_t *sids, PercyStats *stats=NULL)
Constructor.
Definition: itclient_impl.h:58
Defines the basic structure of protocol parameters (PercyParams), client parameters (PercyClientParam...
virtual ~PercyClient_Chor()
Destructor.
Definition: itparams.h:144