21 #ifndef __PERCYPARAMS_H__
22 #define __PERCYPARAMS_H__
127 virtual dbsize_t
request_size (nqueries_t num_queries = 1)
const = 0;
130 virtual dbsize_t
response_size (nqueries_t num_queries = 1)
const = 0;
136 void print (std::ostream& os)
const;
146 virtual void write (std::ostream &os)
const;
159 std::vector<Dimension> worker_dims)
const = 0;
205 void send (std::ostream &os, nservers_t sid)
const;
223 void print (std::ostream& os)
const;
273 std::vector<nservers_t> worker_sids = std::vector<nservers_t>(),
282 void send (std::ostream &os,
bool to_worker =
false)
const;
365 void print (std::ostream& os)
const;
bool null
Whether or not the client a null client.
Definition: percyparams.h:239
nservers_t tau() const
Get the level of tau-independence.
Definition: percyparams.h:117
Client parameters.
Definition: percyparams.h:189
dbsize_t word_size() const
Get the word size used to split blocks.
Definition: percyparams.h:110
dbsize_t _num_blocks
Number of database blocks.
Definition: percyparams.h:168
std::ostream & operator<<(std::ostream &os, PercyMode mode)
Prints a PercyMode string to a stream.
const PercyParams * percy_params() const
Get the protocol parameters.
Definition: percyparams.h:371
PercyParams(dbsize_t num_blocks, dbsize_t block_size, dbsize_t word_size, PercyMode mode, nservers_t tau=0, dbsize_t virtual_block_size=1)
Constructor.
PercyServerParams(const PercyParams *params, nservers_t sid, bool be_byzantine=false)
Constructor.
PercyClientParams(const PercyParams *params, nservers_t num_servers=1, bool is_null=false)
Constructor.
dbsize_t _words_per_block
Number of words per database block.
Definition: percyparams.h:174
DistSplit thread_split() const
Get the method of partitioning work amoung threads.
Definition: percyparams.h:307
bool is_compatible(std::istream &is, nservers_t sid) const
Test compatibility with a server.
virtual dbsize_t server_block_size() const
Get the size of each block in the database that the datastore will actually use.
Definition: percyparams.h:108
nservers_t num_threads() const
Get the number of threads being used.
Definition: percyparams.h:305
Aguilar Melchor and Gaborit (2007) CPIR.
Definition: percyparams.h:46
PercyMode get_mode() const
Get the protocol being used.
Definition: percyparams.h:114
std::vector< const PercyParams * > worker_params
The workers' protocol parameters.
Definition: percyparams.h:395
This header contains typedefs for seamless switching between 32- and 64-bit builds of Percy++...
virtual void write(std::ostream &os) const
Write the parameters to a stream to check compatibility.
std::vector< const PercyServerParams * > get_all_worker_serverparams() const
Get the server parameters for all workers.
Definition: percyparams.h:336
nservers_t sid
Server ID.
Definition: percyparams.h:378
const PercyServerParams * get_worker_serverparams(nservers_t wid) const
Get the server parameters for a worker.
Definition: percyparams.h:332
DistSplit
The method used to partition work between threads/workers.
Definition: percyparams.h:58
const PercyParams * get_worker_params(nservers_t wid) const
Get the protocol parameters for a worker.
Definition: percyparams.h:322
nservers_t _num_threads
The number of threads.
Definition: percyparams.h:384
nservers_t _num_servers
The number of servers being queried.
Definition: percyparams.h:237
nservers_t num_servers() const
Get the number of servers being queried.
Definition: percyparams.h:217
uint16_t port
Port.
Definition: percyparams.h:247
const char * DistSplitStrings[]
Strings associated with DistSplit values.
Devet and Goldberg (2014) Hybrid PIR.
Definition: percyparams.h:48
char * addr
Address.
Definition: percyparams.h:246
void print(std::ostream &os) const
Prints the parameters in CSV form.
const PercyParams * params
The protocol parameters.
Definition: percyparams.h:234
bool is_compatible(std::istream &is) const
Test compatibility with client.
dbsize_t _block_size
Size of database blocks in bytes.
Definition: percyparams.h:170
dbsize_t words_per_block() const
Get the number of words per database block.
Definition: percyparams.h:112
bool is_byzantine() const
Check if the server is Byzantine (responses incorrectly/maliciously).
Definition: percyparams.h:298
bool is_distributed() const
Check if the server is using distributed computation.
Definition: percyparams.h:312
dbsize_t virtual_block_size() const
Get the number of actual blocks in a virtual block when being used as one iteration of a recursive pr...
Definition: percyparams.h:123
const PercyServerParams * get_thread_serverparams(nservers_t wid) const
Get the server parameters for a thread.
Definition: percyparams.h:352
const char * PercyModeStrings[]
Strings associated with PercyMode values.
virtual ~PercyParams()
Destructor.
Definition: percyparams.h:98
dbsize_t num_blocks() const
Get the number of blocks in the database.
Definition: percyparams.h:102
void print(std::ostream &os) const
Prints the parameters in CSV form.
DistSplit worker_split() const
Get the method of partitioning work amoung workers.
Definition: percyparams.h:318
bool is_recursive() const
Check if the server is recursive.
Definition: percyparams.h:292
virtual ~PercyClientParams()
Destructor.
Definition: percyparams.h:200
std::pair< dbsize_t, dbsize_t > Dimension
A 2-dimensional coordinate.
Definition: percyparams.h:71
PercyMode mode
Protocol being used.
Definition: percyparams.h:176
void send(std::ostream &os, nservers_t sid) const
Send parameters and sid to server to test compatibility.
const PercyParams * params
The protocol parameters.
Definition: percyparams.h:375
virtual std::vector< const PercyParams * > create_worker_params(std::vector< Dimension > worker_dims) const =0
Create protocol parameters for threads/workers.
bool be_byzantine
Whether or not the server is Byzantine.
Definition: percyparams.h:380
const PercyParams * get_thread_params(nservers_t wid) const
Get the protocol parameters for a thread.
Definition: percyparams.h:342
DistSplit tsplit
The method of partitioning work between threads.
Definition: percyparams.h:386
std::vector< const PercyServerParams * > get_all_thread_serverparams() const
Get the server parameters for all threads.
Definition: percyparams.h:356
dbsize_t _virtual_block_size
Number of actual blocks per virtual block when part of a recursive protocol.
Definition: percyparams.h:183
An abstract base class for a protocol's parameters.
Definition: percyparams.h:80
Partition the bytes of the records.
Definition: percyparams.h:61
std::vector< const PercyParams * > get_all_thread_params() const
Get the protocol parameters for all threads.
Definition: percyparams.h:346
std::vector< const PercyParams * > thread_params
The threads' protocol parameters.
Definition: percyparams.h:400
bool use_forked_threads() const
Check if the server is using forked processes instead of threading.
Definition: percyparams.h:309
nservers_t get_sid() const
Get the server ID.
Definition: percyparams.h:296
virtual void print_mode_specific(std::ostream &os) const
Print mode-specific parameters.
Definition: percyparams.h:142
virtual bool check_compatible(std::istream &is) const
Read the parameters from a stream (as written by write()) and check that they are compatible with the...
Information needed to connect to a server.
Definition: percyparams.h:244
Partition the queries.
Definition: percyparams.h:59
dbsize_t _num_virtual_blocks
Number of virtual blocks when part of a recursive protocol.
Definition: percyparams.h:180
bool is_threaded() const
Check if the server is using multithreading.
Definition: percyparams.h:301
Partition the database records.
Definition: percyparams.h:60
const PercyParams * percy_params() const
Get the protocol parameters.
Definition: percyparams.h:226
std::vector< const PercyServerParams * > worker_serverparams
The workers' server parameters.
Definition: percyparams.h:397
unsigned char version[3]
Percy++ version.
Definition: percyparams.h:166
DistSplit wsplit
The method of partitioning work between workers.
Definition: percyparams.h:392
bool is_null() const
Check if the client is a null client.
Definition: percyparams.h:230
nservers_t _tau
Level of tau-independence.
Definition: percyparams.h:178
nservers_t sid
Server ID.
Definition: percyparams.h:245
PercyMode
A PIR protocol.
Definition: percyparams.h:40
Goldberg (2007) IT-PIR over GF(2^8).
Definition: percyparams.h:43
Server parameters.
Definition: percyparams.h:251
dbsize_t block_size() const
Get the size of each block in the database in bytes.
Definition: percyparams.h:104
nservers_t _num_workers
The number of workers.
Definition: percyparams.h:390
Goldberg (2007) IT-PIR over GF(2^16).
Definition: percyparams.h:44
void print(std::ostream &os) const
Prints the parameters in CSV form.
bool is_forked
Whether or not the server is using forked processes instead of threading.
Definition: percyparams.h:388
std::vector< const PercyParams * > get_all_worker_params() const
Get the protocol parameters for all workers.
Definition: percyparams.h:326
nservers_t num_workers() const
Get the number of worker processes being used.
Definition: percyparams.h:316
virtual bool is_recursive() const
Check if the protocol is recursive.
Definition: percyparams.h:162
std::vector< const PercyServerParams * > thread_serverparams
The threads' server parameters.
Definition: percyparams.h:402
Chor et al. (1995) IT-PIR.
Definition: percyparams.h:45
dbsize_t num_virtual_blocks() const
Get the number of virtual blocks when being used as one iteration of a recursive protocol.
Definition: percyparams.h:120
void send(std::ostream &os, bool to_worker=false) const
Send parameters and sid to client to test compatibility.
Aguilar Melchor and Gaborit (2007) CPIR with recursion.
Definition: percyparams.h:47
virtual void print_distributed(std::ostream &os) const
Print the distributed properties of the server.
virtual dbsize_t request_size(nqueries_t num_queries=1) const =0
Get the size of a client to server request.
Goldberg (2007) IT-PIR over the integers modulo p.
Definition: percyparams.h:42
dbsize_t _word_size
Word size used to split blocks.
Definition: percyparams.h:172
virtual ~PercyServerParams()
Destructor.
virtual dbsize_t response_size(nqueries_t num_queries=1) const =0
Get the size of a server to client response.