MCPcopy Create free account
hub / github.com/data61/MP-SPDZ / FakeProgramParty

Method FakeProgramParty

BMR/Party.cpp:210–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208}
209
210FakeProgramParty::FakeProgramParty(int argc, const char** argv) :
211 keys_for_prf(0)
212{
213 if (argc < 3)
214 {
215 cerr << "Usage: " << argv[0] << " <id> <program> [netmap]" << endl;
216 exit(1);
217 }
218
219 load(argv[2]);
220 _id = atoi(argv[1]);
221 processor.open_input_file("user_inputs/user_" + to_string(_id - 1) + "_input.txt");
222
223 if (argc > 3)
224 {
225 int n_parties = init(argv[3], _id);
226 ifstream netmap(argv[3]);
227 int tmp;
228 string tmp2;
229 netmap >> tmp >> tmp2 >> tmp;
230 vector<string> hostnames(n_parties);
231 for (int i = 0; i < n_parties; i++)
232 {
233 netmap >> hostnames[i];
234 netmap >> tmp;
235 }
236 N.init(_id - 1, 5000, hostnames);
237 }
238 else
239 {
240 int n_parties = init("LOOPBACK", _id);
241 N.init(_id - 1, 5000, vector<string>(n_parties, "localhost"));
242 }
243 ifstream schfile((string("Programs/Schedules/") + argv[2] + ".sch").c_str());
244 string curr, prev;
245 while (schfile.good())
246 {
247 prev = curr;
248 getline(schfile, curr);
249 }
250 cout << "Compiler: " << prev << endl;
251 P = new PlainPlayer(N, 0);
252 Share<gf2n_long>::MAC_Check::setup(*P);
253 if (argc > 4)
254 threshold = atoi(argv[4]);
255 cout << "Threshold for multi-threaded evaluation: " << threshold << endl;
256}
257
258ProgramParty::~ProgramParty()
259{

Callers

nothing calls this directly

Calls 5

initFunction · 0.85
open_input_fileMethod · 0.60
to_stringFunction · 0.50
setupFunction · 0.50
initMethod · 0.45

Tested by

no test coverage detected