| 208 | } |
| 209 | |
| 210 | FakeProgramParty::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 | |
| 258 | ProgramParty::~ProgramParty() |
| 259 | { |
nothing calls this directly
no test coverage detected