Percy++
A C++ implementation of Private Information Retrieval (PIR) protocols
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
hybridparams.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 __HYBRIDPARAMS_H__
20 #define __HYBRIDPARAMS_H__
21 
22 #include "recursiveparams.h"
23 #include "itparams.h"
24 #include "agparams.h"
25 
26 class HybridParams : public RecursiveParams {
27 public:
28  // For Non-ZZ_p IT modes
29  HybridParams (dbsize_t num_blocks, dbsize_t block_size,
30  PercyMode it_mode, nqueries_t depth = 0, nservers_t tau = 0,
31  dbsize_t it_num_blocks = 0, dbsize_t ag_N = 50,
32  dbsize_t c_word_size = 20);
33 
34  // For ZZ_p as the IT mode
35  HybridParams (dbsize_t num_blocks, dbsize_t block_size,
36  dbsize_t it_word_size, ZZ it_modulus, nqueries_t depth = 0,
37  nservers_t tau = 0, dbsize_t it_num_blocks = 0,
38  dbsize_t ag_N = 50, dbsize_t c_word_size = 20);
39 
40  virtual ~HybridParams ();
41 
42  virtual dbsize_t server_block_size () const {
43  return iterations[0]->server_block_size();
44  }
45 
46  // Prints the mode-specfic paramaters. Meant to be overloaded by
47  // mode-specific classes
48  virtual void print_mode_specific (std::ostream& os) const;
49 
50 protected:
51  PercyMode it_mode;
52 };
53 
54 #endif
nservers_t tau() const
Get the level of tau-independence.
Definition: percyparams.h:117
Definition: recursiveparams.h:24
dbsize_t num_blocks() const
Get the number of blocks in the database.
Definition: percyparams.h:102
Definition: hybridparams.h:26
virtual dbsize_t server_block_size() const
Get the size of each block in the database that the datastore will actually use.
Definition: hybridparams.h:42
PercyMode
A PIR protocol.
Definition: percyparams.h:40
dbsize_t block_size() const
Get the size of each block in the database in bytes.
Definition: percyparams.h:104
virtual void print_mode_specific(std::ostream &os) const
Print mode-specific parameters.