From 19751229d79deccfcf5f8d3a97a15d3dee4b917a Mon Sep 17 00:00:00 2001 From: Joe Rowell Date: Tue, 28 Feb 2023 14:58:06 +0000 Subject: [PATCH] Make ```amortized_2pc.h``` match ```2pc.h``` (#35) * Add const, fix indexing bug. This makes things consistent with 2pc.h. * Update tests --- emp-ag2pc/amortized_2pc.h | 4 ++-- test/amortized_2pc.cpp | 4 ++-- test/amortized_2pc2.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/emp-ag2pc/amortized_2pc.h b/emp-ag2pc/amortized_2pc.h index e3ae132..614005a 100644 --- a/emp-ag2pc/amortized_2pc.h +++ b/emp-ag2pc/amortized_2pc.h @@ -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); diff --git a/test/amortized_2pc.cpp b/test/amortized_2pc.cpp index 48be43e..f86a2bf 100644 --- a/test/amortized_2pc.cpp +++ b/test/amortized_2pc.cpp @@ -33,9 +33,9 @@ int main(int argc, char** argv) { cout << "dep:\t"<