Make ``amortized_2pc.h` match `2pc.h`` (#35)

* Add const, fix indexing bug.

This makes things consistent with 2pc.h.

* Update tests
This commit is contained in:
Joe Rowell
2023-02-28 14:58:06 +00:00
committed by GitHub
parent eddb6bf92f
commit 19751229d7
3 changed files with 5 additions and 5 deletions

View File

@@ -509,7 +509,7 @@ class AmortizedC2PC { public:
}
void online (bool * input, bool * output) {
void online (const bool * input, bool * output) {
uint8_t * mask_input = new uint8_t[cf->num_wire];
memset(mask_input, 0, cf->num_wire);
block tmp;
@@ -520,7 +520,7 @@ class AmortizedC2PC { public:
#endif
if(party == ALICE) {
for(int i = cf->n1; i < cf->n1+cf->n2; ++i) {
mask_input[i] = logic_xor(input[i - cf->n1], getLSB(mac[exec_times][i]));
mask_input[i] = logic_xor(input[i], getLSB(mac[exec_times][i]));
mask_input[i] = logic_xor(mask_input[i], mask[exec_times][i]);
}
io->recv_data(mask_input, cf->n1);

View File

@@ -33,9 +33,9 @@ int main(int argc, char** argv) {
cout << "dep:\t"<<party<<"\t"<<time_from(t1)<<endl;
bool in[512], out[512];
bool in[1024], out[512];
for(int i = 0; i < runs; ++i) {
memset(in, false, 512);
memset(in, false, 1024);
memset(out, false, 512);
t1 = clock_start();
twopc.online(in, out);

View File

@@ -47,7 +47,7 @@ double c2 = get_io_count(twopc.fpre, io);
cout <<c2 - c1<<endl;
bool in[512], out[512];
bool in[1024], out[512];
t1 = clock_start();
for(int i = 0; i < runs; ++i) {
twopc.online(in, out);