ABY Framework  1.0
Arithmetic Bool Yao Framework
 All Classes Files Functions Variables Enumerations Enumerator Macros
dgkparty.h
Go to the documentation of this file.
1 
19 #ifndef __DGKPARTY_H__
20 #define __DGKPARTY_H__
21 
22 #include <gmp.h>
23 #include <vector>
24 #include "../util/typedefs.h"
25 #include "../util/socket.h"
26 #include "../util/dgk.h"
27 #include "../util/powmod.h"
28 
29 using namespace std;
30 
31 class DGKParty {
32 public:
33  DGKParty(UINT DGKbits, UINT sharelen, UINT readkey);
34  DGKParty(UINT DGKbits, UINT sharelen, CSocket sock, UINT readkey);
35  ~DGKParty();
36 
37  void keyExchange(CSocket sock);
38 
39  void preCompBench(BYTE * bA, BYTE * bB, BYTE * bC, BYTE * bA1, BYTE * bB1, BYTE * bC1, UINT numMTs, CSocket sock);
40 
41  void readKey();
42 
43  void generateKey();
44 
45  void loadNewKey(UINT DGKbits, UINT sharelen);
46 
47 private:
48  USHORT m_nNumMTThreads;
49  USHORT m_nShareLength;
50  UINT m_nDGKbits;
51  UINT m_nBuflen;
52 
53  // Crypto and GMP PRNG
54  dgk_pubkey_t *m_localpub, *m_remotepub;
55  dgk_prvkey_t *m_prv;
56  gmp_randstate_t m_randstate;
57 
58  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,
59  mpz_t y, mpz_t z);
60 
61  void sendmpz_t(mpz_t t, CSocket sock, BYTE * buf);
62  void receivempz_t(mpz_t t, CSocket sock, BYTE * buf);
63 
64  void sendmpz_t(mpz_t t, CSocket sock);
65  void receivempz_t(mpz_t t, CSocket sock);
66 
67  void printBuf(BYTE* b, UINT l);
68 
69 };
70 
71 #endif //__DGK_PARTY_H__
Definition: dgk.h:53
Definition: socket.h:24
Definition: dgkparty.h:31
Definition: dgk.h:66