ABY Framework  1.0
Arithmetic Bool Yao Framework
 All Classes Files Functions Variables Enumerations Enumerator Macros
djnparty.h
Go to the documentation of this file.
1 
19 #ifndef __DJNPARTY_H__
20 #define __DJNPARTY_H__
21 
22 #include <gmp.h>
23 #include <vector>
24 #include "../util/typedefs.h"
25 #include "../util/socket.h"
26 #include "../util/djn.h"
27 #include "../util/powmod.h"
28 
29 using namespace std;
30 
31 class DJNParty {
32 public:
33  DJNParty(UINT DJNbits, UINT sharelen);
34  DJNParty(UINT DJNbits, UINT sharelen, CSocket sock);
35  ~DJNParty();
36 
37  void keyExchange(CSocket sock);
38  void preCompBench(BYTE * bA, BYTE * bB, BYTE * bC, BYTE * bA1, BYTE * bB1, BYTE * bC1, UINT numMTs, CSocket sock);
39 
40  void setSharelLength(UINT sharelen);
41 
42  void keyGen();
43 
44 private:
45  USHORT m_nNumMTThreads;
46  USHORT m_nShareLength;
47  UINT m_nDJNbits;
48  UINT m_nBuflen;
49 
50  // Crypto and GMP PRNG
51  djn_pubkey_t *m_localpub, *m_remotepub;
52  djn_prvkey_t *m_prv;
53  gmp_randstate_t m_randstate;
54 
55  void benchPreCompPacking1(CSocket sock, BYTE * buf, UINT packlen, UINT numshares, mpz_t * a, mpz_t * b, mpz_t * c, mpz_t * a1, mpz_t * b1, mpz_t * c1, mpz_t r, mpz_t x,
56  mpz_t y, mpz_t z);
57 
58  void sendmpz_t(mpz_t t, CSocket sock, BYTE * buf);
59  void receivempz_t(mpz_t t, CSocket sock, BYTE * buf);
60 
61  void sendmpz_t(mpz_t t, CSocket sock);
62  void receivempz_t(mpz_t t, CSocket sock);
63 
64  void printBuf(BYTE* b, UINT l);
65 
66 };
67 
68 #endif //__DJN_PARTY_H__
Definition: djnparty.h:31
Definition: socket.h:24
Definition: djn.h:75
Definition: djn.h:60