Percy++
A C++ implementation of Private Information Retrieval (PIR) protocols
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
spirclient.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 __SPIRCLIENT_H__
20 #define __SPIR_H__
21 
22 #include <vector>
23 #include <NTL/ZZ_pX.h>
24 #include <NTL/vec_vec_ZZ_p.h>
25 #include "../PolyCommit/PolyCommitCommon.h"
26 #include "pspir_crypt.h"
27 
28 #include "percyparams.h"
29 
30 // Holds SPIR information for each client query.
32 public:
33  SPIRClientQuery ();
34  ~SPIRClientQuery ();
35 
36  SPIRClientQuery (const SPIRClientQuery &other);
37  SPIRClientQuery& operator= (SPIRClientQuery other);
38 
39  // initializes SPIR parameters
40  bool init_parameters (const PercyClientParams &params,
41  nservers_t num_servers, nservers_t t, const dbsize_t block_number,
42  const vec_ZZ_p &indices, const vec_vec_ZZ_p &shares,
43  const vec_ZZ_pX &polyvec);
44 
45  // sends the infomation to the server
46  bool send_to_server (const PercyClientParams &params,
47  nservers_t server_index, std::ostream &os);
48 
49 private:
50  // Progress
51  enum Progress {
52  PROGRESS_NONE,
53  PROGRESS_INIT_PARAMS
54  };
55  Progress progress;
56 
57  vec_G1 commitvec; // Vector of commitments to the polynomials
58  ZZ_pX dot_f_a; // Dot product of `f` vector and `a` vector
59  G1 C_a; // Commitment on dot_f_a
60  vec_G1 witnessvec; // Vector of witnesses to the evaluations
61 
62  G1 C_a_prime, witness_prime;
63  GT D, D_prime;
64  G1 eta_1, eta_2, eta_3;
65  GT eta_4, eta_5, eta_6;
66  ZZ_p v_0, v_1, v_2, v_3;
67  vec_G1 muvec;
68  vec_GT nuvec;
69  vec_ZZ_p chivec;
70  dbsize_t cvec_size;
71  uint64_t *cvec;
72 };
73 
74 #endif
Client parameters.
Definition: percyparams.h:189
Definition: spirclient.h:31
Defines the basic structure of protocol parameters (PercyParams), client parameters (PercyClientParam...