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

Method CutAndChooseMachine

FHEOffline/CutAndChooseMachine.cpp:9–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7#include "FHEOffline/SimpleGenerator.h"
8
9CutAndChooseMachine::CutAndChooseMachine(int argc, const char** argv)
10{
11 opt.add(
12 "", // Default.
13 0, // Required?
14 0, // Number of args expected.
15 0, // Delimiter if expecting multiple args.
16 "Use covert security (default: active; use -s for parameter)", // Help description.
17 "-c", // Flag token.
18 "--covert" // Flag token.
19 );
20 parse_options(argc, argv);
21 if (produce_inputs)
22 {
23 cerr << "Producing input tuples is not implemented" << endl;
24 exit(1);
25 }
26 covert = opt.isSet("--covert");
27 if (not covert and sec != 40)
28 throw runtime_error("active cut-and-choose only implemented for 40-bit security");
29 if (covert)
30 generate_setup(COVERT_SPDZ2_SLACK);
31 else
32 generate_setup(ACTIVE_SPDZ2_SLACK);
33 for (int i = 0; i < nthreads; i++)
34 {
35 if (use_gf2n)
36 generators.push_back(new_generator<P2Data>(i));
37 else
38 generators.push_back(new_generator<FFT_Data>(i));
39 }
40}
41
42template <class FD>
43GeneratorBase* CutAndChooseMachine::new_generator(int i)

Callers

nothing calls this directly

Calls 5

runtime_errorFunction · 0.85
generate_setupFunction · 0.85
isSetMethod · 0.80
addMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected