ABY Framework  1.0
Arithmetic Bool Yao Framework
 All Classes Files Functions Variables Enumerations Enumerator Macros
baseOT.h
Go to the documentation of this file.
1 
19 #ifndef BASEOT_H_
20 #define BASEOT_H_
21 
22 #include "../util/typedefs.h"
23 #include "../util/cbitvector.h"
24 #include "../util/socket.h"
25 #include "../util/crypto/crypto.h"
26 #include <ctime>
27 
28 #include <iostream>
29 #include <cstring>
30 #include <fstream>
31 #include <time.h>
32 
33 class BaseOT {
34 public:
35  BaseOT(crypto* crypt, field_type ftype) {
36  m_cCrypto = crypt;
37  m_cPKCrypto = crypt->gen_field(ftype);
38  }
39  ;
40  ~BaseOT() {
41  delete m_cPKCrypto;
42  }
43  ;
44 
45  virtual void Sender(uint32_t nSndVals, uint32_t nOTs, CSocket& sock, uint8_t* ret) = 0;
46  virtual void Receiver(uint32_t nSndVals, uint32_t uint32_t, CBitVector& choices, CSocket& sock, uint8_t* ret) = 0;
47 
48 protected:
49 
50  crypto* m_cCrypto;
51  pk_crypto* m_cPKCrypto;
52 
53  void hashReturn(uint8_t* ret, uint32_t ret_len, uint8_t* val, uint32_t val_len, uint32_t ctr) {
54  m_cCrypto->hash_ctr(ret, ret_len, val, val_len, ctr);
55  }
56 
57 };
58 
59 #endif /* BASEOT_H_ */
Definition: pk-crypto.h:30
Definition: crypto.h:58
Definition: socket.h:24
Definition: baseOT.h:33
Definition: cbitvector.h:123