if(gate == XOR) was appearing two times in a test. Just removed it.

This commit is contained in:
hilder.vitor
2022-03-11 14:05:09 +01:00
parent 3e02733b2d
commit b554fbbe54

View File

@ -615,13 +615,6 @@ void test_lwehe_gate_composition_helper(SchemeLWE& s, GateType g)
exp_out = (exp_out ^ in2); // exp_out = XOR(exp_out, in2) exp_out = (exp_out ^ in2); // exp_out = XOR(exp_out, in2)
//cout << "XOR output: " << output << endl; //cout << "XOR output: " << output << endl;
} }
else if (g == XOR) {
auto start = clock();
s.xor_gate(ct_res, ct_res, ct);
avg_time += float(clock()-start)/CLOCKS_PER_SEC;
exp_out = (exp_out ^ in2); // exp_out = XOR(exp_out, in2)
//cout << "XOR output: " << output << endl;
}
else if (g == NOT) { else if (g == NOT) {
auto start = clock(); auto start = clock();
s.not_gate(ct_res, ct_res); s.not_gate(ct_res, ct_res);
@ -629,8 +622,6 @@ void test_lwehe_gate_composition_helper(SchemeLWE& s, GateType g)
exp_out = (1 - exp_out); // exp_out = NOT(exp_out) exp_out = (1 - exp_out); // exp_out = NOT(exp_out)
} }
int output = s.decrypt(ct_res); int output = s.decrypt(ct_res);
assert(output == exp_out); assert(output == exp_out);
} }