20 #ifndef __ITSERVER_H__
21 #define __ITSERVER_H__
24 #include "percyserver.h"
57 virtual bool handle_request_impl (
58 const std::vector<unsigned char*> &requests,
59 const std::vector<unsigned char*> &responses);
61 virtual void combine_results (
unsigned char * result,
62 const std::vector<unsigned char*> &worker_results);
66 #ifdef STRASSEN_COUNT_OPERATIONS
67 long nr_multiplications;
71 void compute_one(
const unsigned char * data, ZZ_p * value,
72 bool hybrid_protection, dbsize_t num_blocks,
73 dbsize_t words_per_block, dbsize_t bytes_per_word,
74 nqueries_t num_queries,
const vec_ZZ_p *inputvector, dbsize_t c);
75 void compute_all(
const unsigned char * data, vec_ZZ_p * responses,
76 bool hybrid_protection, dbsize_t num_blocks,
77 dbsize_t words_per_block, dbsize_t bytes_per_word,
78 dbsize_t last_block_words, nqueries_t num_queries,
79 const vec_ZZ_p * inputvector);
80 void compute_mult_strassen(
const unsigned char * data,
81 vec_ZZ_p * responses, dbsize_t num_blocks,
82 dbsize_t words_per_block, dbsize_t bytes_per_word,
83 dbsize_t last_block_words, nqueries_t num_queries,
84 const vec_ZZ_p * inputvector);
85 void matrix_mult_naive(
const vec_ZZ_p * matrix_a,
86 dbsize_t num_rows_a,
const vec_ZZ_p * matrix_b,
87 dbsize_t num_cols_b, vec_ZZ_p * matrix_res,
88 dbsize_t row_offset = 0, dbsize_t col_offset = 0,
89 dbsize_t inner_offset = 0, dbsize_t inner_dim = 0);
90 nqueries_t optimal_strassen_depth( nqueries_t num_queries,
91 dbsize_t num_blocks, dbsize_t words_per_block,
92 dbsize_t bytes_per_word);
93 void strassen_split(
const vec_ZZ_p * matrix_a, dbsize_t num_rows_a,
94 const vec_ZZ_p * matrix_b, dbsize_t num_cols_b,
95 vec_ZZ_p * matrix_res, nqueries_t depth);
96 void strassen_mult(
const vec_ZZ_p * matrix_a, dbsize_t num_rows_a,
97 const vec_ZZ_p * matrix_b, dbsize_t num_cols_b,
98 vec_ZZ_p * matrix_res, nqueries_t depth);
119 virtual bool handle_request_impl (
120 const std::vector<unsigned char*> &requests,
121 const std::vector<unsigned char*> &responses);
123 virtual void combine_results (
unsigned char * result,
124 const std::vector<unsigned char*> &worker_results);
142 template <
typename GF2E_Element>
160 dbsize_t depth, GF2E_Element * memory);
165 dbsize_t depth, GF2E_Element * memory);
167 GF2E_Element * alloc_strassen_memory(nqueries_t res_rows,
168 dbsize_t inner_dim, dbsize_t res_cols);
169 void free_strassen_memory(GF2E_Element * memory);
171 nqueries_t optimal_strassen_num_queries(nqueries_t num_queries);
172 inline nqueries_t optimal_strassen_depth(nqueries_t res_rows,
173 dbsize_t inner_dim, dbsize_t res_cols);
175 nqueries_t strassen_real_max_depth;
177 virtual bool handle_request_impl (
178 const std::vector<unsigned char*> &requests,
179 const std::vector<unsigned char*> &responses);
181 virtual void combine_results (
unsigned char * result,
182 const std::vector<unsigned char*> &worker_results);
187 #include "itserver_impl.h"
virtual ~PercyServer_ZZ_p()
Destructor.
Definition: percystats.h:66
A simple database object.
Definition: datastore.h:34
virtual ~PercyServer_Chor()
Destructor.
A PIR server for the IT-PIR protocol by Goldberg (2007) over GF(2^E).
Definition: itserver.h:143
PercyStats * stats
Statistics collection object.
Definition: percyserver.h:141
An abstract base class for a PIR server.
Definition: percyserver.h:34
PercyServer_Chor(DataStore *datastore, const PercyServerParams *params, PercyStats *stats=NULL)
Constructor.
A PIR server for the IT-PIR protocol by Chor et al. (1995).
Definition: itserver.h:105
A PIR server for the IT-PIR protocol by Goldberg (2007) over the integers modulo p.
Definition: itserver.h:43
Definition: itparams.h:162
PercyServer_ZZ_p(DataStore *datastore, const PercyServerParams *params, PercyStats *stats=NULL)
Constructor.
Definition: itparams.h:33
Definition: gf2e_matrix.h:31
virtual ~PercyServer_GF2E()
Destructor.
Definition: itserver_impl.h:41
Server parameters.
Definition: percyparams.h:251
DataStore * datastore
The database used by the server.
Definition: percyserver.h:137
PercyServer_GF2E(DataStore *datastore, const PercyServerParams *params, PercyStats *stats=NULL)
Constructor.
Definition: itserver_impl.h:33
Definition: itparams.h:144