forked from data61/MP-SPDZ
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathYaoEvalWire.h
58 lines (45 loc) · 1.26 KB
/
YaoEvalWire.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* YaoEvalWire.h
*
*/
#ifndef YAO_YAOEVALWIRE_H_
#define YAO_YAOEVALWIRE_H_
#include "BMR/Key.h"
#include "BMR/Gate.h"
#include "BMR/Register.h"
#include "Processor/DummyProtocol.h"
class YaoEvalWire : public Phase
{
public:
typedef DummyMC MC;
static string name() { return "YaoEvalWire"; }
typedef ostream& out_type;
static ostream& out;
bool external;
Key key;
static YaoEvalWire new_reg() { return {}; }
static void andrs(GC::Processor<GC::Secret<YaoEvalWire>>& processor,
const vector<int>& args)
{
and_<true>(processor, args);
}
static void ands(GC::Processor<GC::Secret<YaoEvalWire>>& processor,
const vector<int>& args)
{
and_<false>(processor, args);
}
template<bool repeat>
static void and_(GC::Processor<GC::Secret<YaoEvalWire>>& processor,
const vector<int>& args);
static void inputb(GC::Processor<GC::Secret<YaoEvalWire>>& processor,
const vector<int>& args);
static void convcbit(Integer& dest, const GC::Clear& source);
void set(const Key& key);
void set(Key key, bool external);
void random();
void public_input(bool value);
void op(const YaoEvalWire& left, const YaoEvalWire& right, Function func);
void XOR(const YaoEvalWire& left, const YaoEvalWire& right);
bool get_output();
};
#endif /* YAO_YAOEVALWIRE_H_ */