-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
56 lines (42 loc) · 1.68 KB
/
main.cpp
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
#include <iostream>
#include "ProtocolParty.h"
#include "SmallFields.h"
int main(int argc, char* argv[])
{
CmdParser parser;
auto parameters = parser.parseArguments("", argc, argv);
int times = stoi(parser.getValueByKey(parameters, "internalIterationsNumber"));
string fieldType = parser.getValueByKey(parameters, "fieldType");
cout<<"fieldType = "<<fieldType<<endl;
if(fieldType.compare("ZpMersenne31") == 0)
{
ProtocolParty<ZpMersenneIntElement> protocol(argc, argv);
auto t1 = high_resolution_clock::now();
protocol.run();
auto t2 = high_resolution_clock::now();
auto duration = duration_cast<milliseconds>(t2-t1).count();
cout << "time in milliseconds for " << times << " runs: " << duration << endl;
cout << "end main" << '\n';
}
else if(fieldType.compare("ZpMersenne13") == 0)
{
ProtocolParty<ZpMersenne13> protocol(argc, argv);
auto t1 = high_resolution_clock::now();
protocol.run();
auto t2 = high_resolution_clock::now();
auto duration = duration_cast<milliseconds>(t2-t1).count();
cout << "time in milliseconds for " << times << " runs: " << duration << endl;
cout << "end main" << '\n';
}
else if(fieldType.compare("Zp16BitPrime") == 0)
{
ProtocolParty<Zp16BitPrime> protocol(argc, argv);
auto t1 = high_resolution_clock::now();
protocol.run();
auto t2 = high_resolution_clock::now();
auto duration = duration_cast<milliseconds>(t2-t1).count();
cout << "time in milliseconds for " << times << " runs: " << duration << endl;
cout << "end main" << '\n';
}
return 0;
}