1 #ifndef HALFGATE_EVA_H__ 2 #define HALFGATE_EVA_H__ 13 template<
typename T, RTCktOpt rt>
16 template<
typename T, RTCktOpt rt>
19 template<
typename T, RTCktOpt rt>
22 template<
typename T, RTCktOpt rt>
25 template<
typename T, RTCktOpt rt>
28 template<
typename T, RTCktOpt rt = on>
55 return _mm_and_si128(a, b);
57 io->recv_block(table, 2);
60 return prp.
H(a,
gid++);
84 for(
int i = 0; i < length; ++i) {
86 t = prp.
H(old_block[i], 2*i);
88 new_block[i] =
xorBlocks(h[1], prp.
H(old_block[i], 2*i+1));
90 new_block[i] =
xorBlocks(h[3], prp.
H(old_block[i], 2*i+1));
106 gc_and_ptr = &halfgate_eva_and<T, RTCktOpt::off>;
107 gc_xor_ptr = &halfgate_eva_xor<T, RTCktOpt::off>;
108 gc_not_ptr = &halfgate_eva_not<T, RTCktOpt::off>;
124 io->recv_block(table, 2);
127 return prp.
H(a,
gid++);
140 for(
int i = 0; i < length; ++i) {
141 io->recv_block(h, 4);
142 t = prp.
H(old_block[i], 2*i);
144 new_block[i] =
xorBlocks(h[1], prp.
H(old_block[i], 2*i+1));
146 new_block[i] =
xorBlocks(h[3], prp.
H(old_block[i], 2*i+1));
152 template<
typename T, RTCktOpt rt>
156 template<
typename T, RTCktOpt rt>
160 template<
typename T, RTCktOpt rt>
164 template<
typename T, RTCktOpt rt>
168 template<
typename T, RTCktOpt rt>
173 #endif// HALFGATE_EVA_H__ void generic_to_xor(block *new_block, const block *old_block, int length)
Definition: halfgate_eva.h:138
HalfGateEva(T *io)
Definition: halfgate_eva.h:103
FileIO * fio
Definition: halfgate_eva.h:34
PRP prp
Definition: halfgate_eva.h:97
block and_gate(const block &a, const block &b)
Definition: halfgate_eva.h:122
__m128i block
Definition: block.h:8
bool isZero(const block *b)
Definition: block.h:71
T * io
Definition: halfgate_eva.h:31
block halfgate_eva_not(GarbleCircuit *gc, const block &a)
Definition: halfgate_eva.h:169
uint64_t gid
Definition: garble_circuit.h:8
block xorBlocks(block x, block y)
Definition: block.h:35
block halfgate_eva_xor(GarbleCircuit *gc, const block &a, const block &b)
Definition: halfgate_eva.h:165
Hash hash
Definition: halfgate_eva.h:32
bool isOne(const block *b)
Definition: block.h:75
block xor_gate(const block &a, const block &b)
Definition: halfgate_eva.h:132
block(* gc_and_ptr)(GarbleCircuit *gc, const block &a, const block &b)
Definition: garble_circuit.h:11
#define zero_block()
Definition: block.h:66
block(* public_label_ptr)(GarbleCircuit *gc, bool b)
Definition: garble_circuit.h:10
RTCktOpt
Definition: garble_circuit.h:6
PRP prp
Definition: halfgate_eva.h:30
HalfGateEva(T *io)
Definition: halfgate_eva.h:35
block public_label_impl(bool b)
Definition: halfgate_eva.h:118
void random_block(block *data, int nblocks=1)
Definition: prg.h:75
const char fix_key[]
Definition: block.h:130
void set_file_io(FileIO *fio)
Definition: halfgate_eva.h:42
Hash hash
Definition: halfgate_eva.h:99
Definition: garble_circuit.h:6
block H(block in, uint64_t id)
Definition: prp.h:48
T * io
Definition: halfgate_eva.h:98
block public_label_impl(bool b)
Definition: halfgate_eva.h:49
bool is_public_impl(const block &b, int party)
Definition: halfgate_eva.h:46
block and_gate(const block &a, const block &b)
Definition: halfgate_eva.h:52
block halfgate_eva_public_label(GarbleCircuit *gc, bool b)
Definition: halfgate_eva.h:157
block halfgate_eva_and(GarbleCircuit *gc, const block &a, const block &b)
Definition: halfgate_eva.h:161
AES_KEY * aes
Definition: prp.h:12
block(* gc_not_ptr)(GarbleCircuit *gc, const block &a)
Definition: garble_circuit.h:13
block(* gc_xor_ptr)(GarbleCircuit *gc, const block &a, const block &b)
Definition: garble_circuit.h:12
void set_file_io(FileIO *fio)
Definition: halfgate_eva.h:111
block not_gate(const block &a)
Definition: halfgate_eva.h:135
bool block_cmp(const block *x, const block *y, int nblocks)
Definition: block.h:56
Definition: halfgate_eva.h:29
bool with_file_io
Definition: halfgate_eva.h:33
#define one_block()
Definition: block.h:67
Definition: garble_circuit.h:7
void send_block(const block *data, int nblock)
Definition: io_channel.h:132
block xor_gate(const block &a, const block &b)
Definition: halfgate_eva.h:66
bool(* is_public_ptr)(GarbleCircuit *gc, const block &b, int party)
Definition: garble_circuit.h:9
block not_gate(const block &a)
Definition: halfgate_eva.h:74
bool is_public_impl(const block &b, int party)
Definition: halfgate_eva.h:115
bool halfgate_eva_is_public(GarbleCircuit *gc, const block &b, int party)
Definition: halfgate_eva.h:153
void generic_to_xor(block *new_block, const block *old_block, int length)
Definition: halfgate_eva.h:82
Definition: file_io_channel.h:21
FileIO * fio
Definition: halfgate_eva.h:101