Percy++
A C++ implementation of Private Information Retrieval (PIR) protocols
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Protected Attributes | List of all members
PercyParams Class Referenceabstract

An abstract base class for a protocol's parameters. More...

#include <percyparams.h>

Inheritance diagram for PercyParams:
AGParams ChorParams GF2EParams RecursiveParams ZZ_pParams HybridParams RecursiveAGParams

Public Member Functions

 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. More...
 
virtual ~PercyParams ()
 Destructor. More...
 
dbsize_t num_blocks () const
 Get the number of blocks in the database. More...
 
dbsize_t block_size () const
 Get the size of each block in the database in bytes. More...
 
virtual dbsize_t server_block_size () const
 Get the size of each block in the database that the datastore will actually use. More...
 
dbsize_t word_size () const
 Get the word size used to split blocks. More...
 
dbsize_t words_per_block () const
 Get the number of words per database block. More...
 
PercyMode get_mode () const
 Get the protocol being used. More...
 
nservers_t tau () const
 Get the level of tau-independence. More...
 
dbsize_t num_virtual_blocks () const
 Get the number of virtual blocks when being used as one iteration of a recursive protocol. More...
 
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 protocol. More...
 
virtual dbsize_t request_size (nqueries_t num_queries=1) const =0
 Get the size of a client to server request. More...
 
virtual dbsize_t response_size (nqueries_t num_queries=1) const =0
 Get the size of a server to client response. More...
 
void print (std::ostream &os) const
 Prints the parameters in CSV form. More...
 
virtual void print_mode_specific (std::ostream &os) const
 Print mode-specific parameters. More...
 
virtual void write (std::ostream &os) const
 Write the parameters to a stream to check compatibility. More...
 
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 these parameters. More...
 
virtual std::vector< const
PercyParams * > 
create_worker_params (std::vector< Dimension > worker_dims) const =0
 Create protocol parameters for threads/workers. More...
 
virtual bool is_recursive () const
 Check if the protocol is recursive. More...
 

Protected Attributes

unsigned char version [3]
 Percy++ version. More...
 
dbsize_t _num_blocks
 Number of database blocks. More...
 
dbsize_t _block_size
 Size of database blocks in bytes. More...
 
dbsize_t _word_size
 Word size used to split blocks. More...
 
dbsize_t _words_per_block
 Number of words per database block. More...
 
PercyMode mode
 Protocol being used. More...
 
nservers_t _tau
 Level of tau-independence. More...
 
dbsize_t _num_virtual_blocks
 Number of virtual blocks when part of a recursive protocol. More...
 
dbsize_t _virtual_block_size
 Number of actual blocks per virtual block when part of a recursive protocol. More...
 

Detailed Description

An abstract base class for a protocol's parameters.

Constructor & Destructor Documentation

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.

Parameters
num_blocksNumber of blocks in the database.
block_sizeSize of the blocks in the database in bytes.
word_sizeWord size used to split the blocks.
modePIR protocol to use.
tauDatabases are tau-independent. No coalition of up to tau servers can determine the contents of the database.
virtual_block_sizeNumber of actual blocks contained in each virtual block when being used as one iteration of a recursive protocol.
virtual ~PercyParams ( )
inlinevirtual

Destructor.

Member Function Documentation

dbsize_t block_size ( ) const
inline

Get the size of each block in the database in bytes.

virtual bool check_compatible ( std::istream &  is) const
virtual

Read the parameters from a stream (as written by write()) and check that they are compatible with these parameters.

Parameters
isStream to read from.
Returns
Return true if the read parameters are compatitble with these parameters; false otherwise.

Reimplemented in ZZ_pParams, AGParams, and RecursiveParams.

virtual std::vector<const PercyParams*> create_worker_params ( std::vector< Dimension worker_dims) const
pure virtual

Create protocol parameters for threads/workers.

worker_dims The database dimensions for each thread/worker.

Returns
The protocol parameters for each thread/worker.

Implemented in ChorParams, GF2EParams, ZZ_pParams, AGParams, and RecursiveParams.

PercyMode get_mode ( ) const
inline

Get the protocol being used.

virtual bool is_recursive ( ) const
inlinevirtual

Check if the protocol is recursive.

Reimplemented in RecursiveParams.

dbsize_t num_blocks ( ) const
inline

Get the number of blocks in the database.

dbsize_t num_virtual_blocks ( ) const
inline

Get the number of virtual blocks when being used as one iteration of a recursive protocol.

void print ( std::ostream &  os) const

Prints the parameters in CSV form.

The fields are:

mode,num_blocks,block_size,word_size,tau,virtual_block_size,mode_specific,

where mode_specific is the result of calling print_mode_specific()

Parameters
osStream to print to.
virtual void print_mode_specific ( std::ostream &  os) const
inlinevirtual

Print mode-specific parameters.

Meant to be overloaded by subclasses to print more details about that mode. Is used by print() to print the mode_specific column.

Parameters
osStream to print to.

Reimplemented in RecursiveAGParams, AGParams, RecursiveParams, and HybridParams.

virtual dbsize_t request_size ( nqueries_t  num_queries = 1) const
pure virtual

Get the size of a client to server request.

Parameters
num_queriesThe number of queries in the request. (Default: 1)

Implemented in ChorParams, GF2EParams, ZZ_pParams, AGParams, and RecursiveParams.

virtual dbsize_t response_size ( nqueries_t  num_queries = 1) const
pure virtual

Get the size of a server to client response.

Parameters
num_queriesThe number of queries in the request. (Default: 1)

Implemented in ChorParams, GF2EParams, ZZ_pParams, AGParams, and RecursiveParams.

virtual dbsize_t server_block_size ( ) const
inlinevirtual

Get the size of each block in the database that the datastore will actually use.

This may be different than block_size() when tau-independence is used.

Reimplemented in ZZ_pParams, and HybridParams.

nservers_t tau ( ) const
inline

Get the level of tau-independence.

A value of zero indicates that any server can determine the contents of the database.

dbsize_t virtual_block_size ( ) const
inline

Get the number of actual blocks in a virtual block when being used as one iteration of a recursive protocol.

dbsize_t word_size ( ) const
inline

Get the word size used to split blocks.

dbsize_t words_per_block ( ) const
inline

Get the number of words per database block.

virtual void write ( std::ostream &  os) const
virtual

Write the parameters to a stream to check compatibility.

Parameters
osStream to write to.

Reimplemented in ZZ_pParams, AGParams, and RecursiveParams.

Member Data Documentation

dbsize_t _block_size
protected

Size of database blocks in bytes.

dbsize_t _num_blocks
protected

Number of database blocks.

dbsize_t _num_virtual_blocks
protected

Number of virtual blocks when part of a recursive protocol.

nservers_t _tau
protected

Level of tau-independence.

dbsize_t _virtual_block_size
protected

Number of actual blocks per virtual block when part of a recursive protocol.

dbsize_t _word_size
protected

Word size used to split blocks.

dbsize_t _words_per_block
protected

Number of words per database block.

PercyMode mode
protected

Protocol being used.

unsigned char version[3]
protected

Percy++ version.


The documentation for this class was generated from the following file: