-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.cpp
More file actions
112 lines (100 loc) · 3.23 KB
/
main.cpp
File metadata and controls
112 lines (100 loc) · 3.23 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#include <iostream>
#include "ProtocolParty.h"
#include <chrono>
using namespace std::chrono;
int main(int argc, char* argv[]) {
CmdParser parser;
auto parameters = parser.parseArguments("", argc, argv);
int partyID = stoi(parser.getValueByKey(parameters, "partyID"));
// PrgFromOpenSSLAES prg;
// auto key = prg.generateKey(128);
// for (int i=0; i<16; i++){
// cout<<(int)key.getEncoded()[i]<<" ";
// }
// cout<<endl;
// SecretKey key({144, 41, 147, 169, 38, 73 ,94, 215, 215, 60, 171 ,19, 249, 232 ,54 ,72}, "");
// prg.setKey(key);
// vector<uint64_t> keys;
// if (partyID == 0) {
//
// keys.resize(hashSize);
//
// for (int i = 0; i < hashSize; i++) {
// keys[i] = prg.getRandom64() >> 24;
// }
//
// } else {
// }
cout << "partyID = " << partyID << endl;
if (partyID == 0) {
DBParty dic(argc, argv);
dic.run();
} else {
QueryParty dic(argc, argv);
dic.run();
}
// auto start = high_resolution_clock::now();
// auto t1 = high_resolution_clock::now();
//
// dic.fillTables();
// auto t2 = high_resolution_clock::now();
//
// auto duration = duration_cast<milliseconds>(t2-t1).count();
// cout << "fillTables took in milliseconds: " << duration << endl;
//
// t1 = high_resolution_clock::now();
// dic.peeling();
//
// t2 = high_resolution_clock::now();
//
// duration = duration_cast<milliseconds>(t2-t1).count();
// cout << "peeling took in milliseconds: " << duration << endl;
//
// t1 = high_resolution_clock::now();
// dic.calcPolynomial();
// t2 = high_resolution_clock::now();
//
// duration = duration_cast<milliseconds>(t2-t1).count();
// cout << "calcPolinomial took in milliseconds: " << duration << endl;
//
// t1 = high_resolution_clock::now();
// dic.unpeeling();
//
// t2 = high_resolution_clock::now();
//
// duration = duration_cast<milliseconds>(t2-t1).count();
// cout << "unpeeling took in milliseconds: " << duration << endl;
//
// auto end = high_resolution_clock::now();
//
// duration = duration_cast<milliseconds>(end-start).count();
// cout << "all protocol took in milliseconds: " << duration << endl;
//
// dic.checkOutput();
// unordered_set<int> set1(1000);
// cout<<"number of buckets in set1 = "<<set1.bucket_count()<<endl;
// unordered_set<int, Hasher> set2(1000, Hasher(10));
// for (int i=0; i<1200; i++) {
// set1.insert(i);
//
// }
//// int bucket = set1.bucket(i);
//// cout<<"set1 put 2080 in bucket number "<<bucket<<endl;
////
// set1.insert(2081);
// auto bucket = set1.bucket(2081);
// cout<<"set1 put 2081 in bucket number "<<bucket<<endl;
// cout<<"number of buckets in set1 = "<<set1.bucket_count()<<endl;
//
// set2.insert(2081);
// bucket = set2.bucket(2081);
// cout<<"set2 put 2081 in bucket number "<<bucket<<endl;
// cout<<"number of buckets in set2 = "<<set2.bucket_count()<<endl;
// bucket = set2.bucket(2081);
// cout<<"set2 put 2081 in bucket number "<<bucket<<endl;
// bucket = set2.bucket(2081);
// cout<<"set2 put 2081 in bucket number "<<bucket<<endl;
// bucket = set2.bucket(2081);
// cout<<"set2 put 2081 in bucket number "<<bucket<<endl;
return 0;
}