-
Notifications
You must be signed in to change notification settings - Fork 0
/
my_main.cpp
67 lines (52 loc) · 1.46 KB
/
my_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
57
58
59
60
61
62
63
64
65
66
67
#include "dpf.h"
#include <cmath>
#include <iostream>
int main(){
int index = 4000; // This is the index of the file the user wants to access
size_t N = 30; // This the maximum number of files (2^(N-3) = number of files)
std::cout << "N: " << N << std::endl;
auto keys = DPF::Gen(index * 8, N); // Generate the DPF keys with alpha = index * (8 bits) and N files
auto a = keys.first;
auto b = keys.second;
std::cout << "Key size: " << a.size() << " bytes" << std::endl;
std::cout << "N: " << N << std::endl;
std::cout << "a: ";
for(auto x : a) {
std::cout << (int)x << " ";
}
std::cout << std::endl;
std::cout << "b: ";
for(auto x : b) {
std::cout << (int)x << " ";
}
std::cout << std::endl;
std::vector<uint8_t> aaaa;
if(N > 10) {
aaaa = DPF::EvalFull8(a, N);
} else {
aaaa = DPF::EvalFull(a, N);
}
std::cout << "aaaa: ";
/*
for(auto x : aaaa) {
std::cout << (int)x << " ";
}
*/
std::cout << std::endl << aaaa.size() << std::endl;
std::cout << std::endl;
std::vector<uint8_t> bbbb;
if(N > 10) {
bbbb = DPF::EvalFull8(b, N);
} else {
bbbb = DPF::EvalFull(b, N);
}
std::cout << "bbbb: ";
/*
for(auto x : bbbb) {
std::cout << (int)x << " ";
}
*/
std::cout << std::endl << bbbb.size() << std::endl;
std::cout << std::endl;
return 0;
}