Percy++
A C++ implementation of Private Information Retrieval (PIR) protocols
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
percyio.h
1 // Percy++ Copyright 2007,2012,2013,2014
2 // Ian Goldberg <iang@cs.uwaterloo.ca>,
3 // Casey Devet <cjdevet@uwaterloo.ca>,
4 // Ryan Henry <rhenry@cs.uwaterloo.ca>
5 //
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of version 2 of the GNU General Public License as
8 // published by the Free Software Foundation.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // There is a copy of the GNU General Public License in the COPYING file
16 // packaged with this plugin; if you cannot find it, write to the Free
17 // Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 // 02110-1301 USA
19 
20 #ifndef __PERCYIO_H__
21 #define __PERCYIO_H__
22 
23 #include <ZZ.h>
24 #include <stdint.h>
25 
26 NTL_CLIENT
27 
28 // Read and write little-endian XX-bit "uintXX_t"s and ZZs.
29 void percy_write_le_uint64(ostream &is, uint64_t val);
30 void percy_write_le_uint32(ostream &os, uint32_t val);
31 void percy_write_le_uint16(ostream &os, uint16_t val);
32 void percy_write_ZZ(ostream &os, ZZ val, uint64_t len);
33 void percy_write_ZZ(ostream &os, ZZ val);
34 
35 void percy_read_le_uint64(istream &is, uint64_t &val);
36 void percy_read_le_uint32(istream &is, uint32_t &val);
37 void percy_read_le_uint16(istream &is, uint16_t &val);
38 void percy_read_ZZ(istream &is, ZZ &val, uint64_t len);
39 void percy_read_ZZ(istream &is, ZZ &val);
40 
41 #endif