Skip to content

Commit c189c0e

Browse files
committed
Small fixes to options and decode testing
1 parent 9998b4f commit c189c0e

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

benchmark/decode.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
CWD = "../"
44
DEGREE = [8, 12, 16, 32, 48, 63]
55
DELTA = [0.1, 0.2, 0.3, 0.4, 0.5]
6+
call(['make'], cwd=CWD)
67
call(['./bin/decode_client', '-s'], cwd=CWD)
78
for degree in DEGREE:
89
for delta in DELTA:
10+
print(degree, delta)
911
call(['./bin/decode_server', '--degree', str(degree), '--delta', str(delta)], cwd=CWD)
10-
call(['./bin/decode_client', '-s', '-o', 'out_{}_{}.png'.format(degree, delta)], cwd=CWD)
12+
call(['./bin/decode_client', '-r', '-o', 'decode_out/out_{}_{}.png'.format(degree, delta)], cwd=CWD)

homo/server_decode.cpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ int main(int argc, const char** argv) {
3535
int resized_width = 0;
3636
int resized_height = 0;
3737
int degree = 12;
38-
int delta = 0.5;
38+
double delta = 0.5;
3939
int order = 64;
4040

4141

@@ -71,7 +71,7 @@ int main(int argc, const char** argv) {
7171
if (result.count("pmod")) plain_modulus = result["pmod"].as<int>();
7272
if (result.count("cmod")) coeff_modulus = result["cmod"].as<int>();
7373
if (result.count("degree")) degree = result["degree"].as<int>();
74-
if (result.count("order")) delta = result["order"].as<int>();
74+
if (result.count("order")) order = result["order"].as<int>();
7575
if (result.count("delta")) delta = result["delta"].as<double>();
7676
if (result.count("n_poly_base")) n_poly_base = result["base"].as<int>();
7777
}
@@ -125,15 +125,13 @@ int main(int argc, const char** argv) {
125125
Ciphertext c, index, elem, count;
126126
std::vector<std::vector<Ciphertext>> res;
127127
for (int i = 0; i < 3; i++) {
128-
std::cout << "Color " << i << std::endl;
129128
encryptor.encrypt(encoder.encode(0), index);
130129
std::vector<Ciphertext> channel;
131130
for (int j = 0; j < width * height; j++) {
132131
encryptor.encrypt(encoder.encode(0), c);
133132
channel.push_back(c);
134133
}
135134
for (int j = 0; j < pairs[i]; j++) {
136-
std::cout << "Run " << j << std::endl;
137135
std::vector<Ciphertext> run;
138136
elem.load(myfile);
139137
count.load(myfile);
@@ -144,7 +142,6 @@ int main(int argc, const char** argv) {
144142
// std::cout << encoder.decode(p) << '\t';
145143
evaluator.add(channel[k], run[k]);
146144
}
147-
std::cout << std::endl;
148145
evaluator.add(index, count);
149146
}
150147
res.push_back(channel);

0 commit comments

Comments
 (0)