encryptogroup / ABY

ABY - A Framework for Efficient Mixed-protocol Secure Two-party Computation
GNU Lesser General Public License v3.0
457 stars 132 forks source link

Does PutB2AGate() work as a SIMD gate? #24

Open adriagascon opened 7 years ago

adriagascon commented 7 years ago

Does PutB2AGate() work as a SIMD gate?

I have a circuit that implements a function involving some muxes, xors, and equality tests, and concludes with a multiplication. This is done with SIMD gates. Everything works great if I use a Boolean circuit. Now I want to do the last multiplication using arithmetic shares.

The problem is that the call to PutB2AGate on one wire messes up the result of that call on the other one. More concretely, the code below prints an array of "garbage", while if I comment out line 3 I see the correct value of variable srv_count_arith (circ and a_circ are a Boolean and an arithmetic circuit, respectively).

share *srv_count_arith;
share *cli_counts_arith;
cli_counts_arith = a_circ->PutB2AGate(cli_counts);
srv_count_arith = a_circ->PutB2AGate(srv_count);
circ->PutPrintValueGate(srv_count, "server value (bool)");
a_circ->PutPrintValueGate(srv_count_arith, "server value (arith)");
jpmcruz commented 6 years ago

We are experiencing the same problem when PutB2AGate is used twice in a circuit. Does anyone have a solution/explanation regarding this problem?