forked from data61/MP-SPDZ
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSimpleMachine.h
96 lines (71 loc) · 1.95 KB
/
SimpleMachine.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
* SimpleMachine.h
*
*/
#ifndef FHEOFFLINE_SIMPLEMACHINE_H_
#define FHEOFFLINE_SIMPLEMACHINE_H_
#include "FHE/FHE_Keys.h"
#include "FHEOffline/DataSetup.h"
#include "Networking/Player.h"
#include "FHEOffline/SimpleGenerator.h"
#include "Tools/OfflineMachineBase.h"
class MachineBase : public OfflineMachineBase
{
template<class T> friend class CowGearPrep;
protected:
vector<GeneratorBase*> generators;
string hostname;
Timer timer;
pthread_t throughput_loop_thread;
int portnum_base;
Dtype data_type;
public:
int sec;
int field_size;
int extra_slack;
bool produce_inputs;
bool use_gf2n;
MachineBase();
MachineBase(int argc, const char** argv);
void run();
void parse_options(int argc, const char** argv);
string item_type();
void throughput_loop();
static void* run_throughput_loop(void* machine);
size_t report_size(ReportType type);
template<class FD>
string get_prep_dir(Player& P) const
{ return get_prep_sub_dir<Share<typename FD::T>>(P.num_players()); }
string tradeoff();
void mult_performance();
void pack(octetStream&) const {}
void unpack(octetStream&) {}
void check(Player&) const {}
};
class MultiplicativeMachineParams : public MachineBase
{
public:
DataSetup setup;
virtual ~MultiplicativeMachineParams() {}
virtual int get_covert() const { return 0; }
};
class MultiplicativeMachine : public MultiplicativeMachineParams
{
PlainPlayer P;
protected:
void parse_options(int argc, const char** argv);
void generate_setup(int slack);
template <class FD>
void fake_keys(int slack);
public:
MultiplicativeMachine();
virtual ~MultiplicativeMachine();
};
class SimpleMachine : public MultiplicativeMachine
{
template <template <class FD> class EC, class FD>
GeneratorBase* new_generator(int i);
public:
SimpleMachine(int argc, const char** argv);
};
#endif /* FHEOFFLINE_SIMPLEMACHINE_H_ */