Percy++
A C++ implementation of Private Information Retrieval (PIR) protocols
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
agserver.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 __AGSERVER_H__
20 #define __AGSERVER_H__
21 
22 #include <iostream>
23 #include "datastore.h"
24 #include "agparams.h"
25 #include "percyserver.h"
26 
27 NTL_CLIENT
28 
34 
35 class PercyAGServer : public PercyServer {
36 public:
43  PercyStats * stats = NULL);
45  virtual ~PercyAGServer ();
46 
47 private:
48  virtual bool handle_request_impl (
49  const std::vector<unsigned char*> &requests,
50  const std::vector<unsigned char*> &responses);
51 
52  virtual void combine_results (unsigned char * result,
53  const std::vector<unsigned char*> &worker_results);
54 
55  const AGParams * params;
56  const AG_Element p;
57 
58  bool handle_request_16 (unsigned char * request, unsigned char * response,
59  const unsigned char * database);
60  bool handle_request_20 (unsigned char * request, unsigned char * response,
61  const unsigned char * database);
62 };
63 
64 #endif
Definition: percystats.h:66
A simple database object.
Definition: datastore.h:34
A PIR server for the CPIR protocol by Aguilar Melchor and Gaborit (2007).
Definition: agserver.h:35
PercyStats * stats
Statistics collection object.
Definition: percyserver.h:141
An abstract base class for a PIR server.
Definition: percyserver.h:34
Definition: agparams.h:73
virtual ~PercyAGServer()
Destructor.
PercyAGServer(DataStore *datastore, const PercyServerParams *params, PercyStats *stats=NULL)
Constructor.
Server parameters.
Definition: percyparams.h:251
DataStore * datastore
The database used by the server.
Definition: percyserver.h:137