mirror of
https://github.com/emp-toolkit/emp-ag2pc.git
synced 2026-01-07 22:43:50 -05:00
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:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user