Open bl4ck5un opened 5 years ago
This is definitely not intentional :) It is now on the schedule to be fixed.
I just edited that code section into this:
if(party == ALICE) {
for(int i = 0; i < cf->n1; i++) {
mask_input[i] = logic_xor(input[i], value[exec_times][i]);
mask_input[i] = logic_xor(mask_input[i], mask[exec_times][i]);
}
io->recv_data(mask_input+cf->n1, cf->n2);
io->send_data(mask_input, cf->n1);
for(int i = 0; i < cf->n1 + cf->n2; i++) {
tmp = labels[exec_times][i];
if(mask_input[i]) tmp = xorBlocks(tmp, fpre->Delta);
io->send_block(&tmp, 1);
}
//send output mask data
send_partial_block<SSP>(io, mac[exec_times]+cf->num_wire - cf->n3, cf->n3);
} else {
for(int i = cf->n1; i < cf->n1+cf->n2; i++) {
mask_input[i] = logic_xor(input[i-cf->n1], value[exec_times][i]);
mask_input[i] = logic_xor(mask_input[i], mask[exec_times][i]);
}
io->send_data(mask_input+cf->n1, cf->n2);
io->recv_data(mask_input, cf->n1);
io->recv_block(labels[exec_times], cf->n1 + cf->n2);
}
That reflects my naive understanding of how the code should be at that position. However, the code crashes and/or I get a lot of "no match GT"s.
Any idea?
Would it work for you to just swap the role of ALICE and BOB?
Yes! It's a brain twist, but I will get used to it. :smile:
We will put a new version with greatly improved performance; this will definitely be fixed by then.
Xiao
On Thu, Sep 19, 2019 at 11:31 AM GitHubKilla notifications@github.com wrote:
Yes! It's a brain twist, but I will get used to it. 😄
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/emp-toolkit/emp-ag2pc/issues/8?email_source=notifications&email_token=AARKGCU2KXFXXMQ65RZWXHLQKOSPHA5CNFSM4HR7S6M2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7ECJCI#issuecomment-533210249, or mute the thread https://github.com/notifications/unsubscribe-auth/AARKGCS7JOXP3RFE3N4VXKTQKOSPHANCNFSM4HR7S6MQ .
Yes,brain twist. Did it fix?…confusing...
you might need to keep it twisted for a few more months and we will release a completely new version :)
When using Bristol circuits, Alice's input actually corresponds to the 2nd party while Bob the first. This flip of order is really confusing. If it's intended, it better be clearly stated in the README.
E.g., Here https://github.com/emp-toolkit/emp-ag2pc/blob/163985c8a1637f64a1d1cfc5f75214d6d8ef06da/emp-ag2pc/2pc.h#L320-L324, Alice reads
n2
bits from the input. The tests didn't catch this because they use the same input from both parties.