| 7 | #include "FHEOffline/SimpleGenerator.h" |
| 8 | |
| 9 | CutAndChooseMachine::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 | |
| 42 | template <class FD> |
| 43 | GeneratorBase* CutAndChooseMachine::new_generator(int i) |
nothing calls this directly
no test coverage detected