mirror of
https://github.com/privacy-scaling-explorations/emp-wasm.git
synced 2026-01-09 10:07:54 -05:00
Connect io properly, connect exceptions, remove debugging output
This commit is contained in:
@@ -3,14 +3,14 @@
|
||||
using namespace std;
|
||||
using namespace emp;
|
||||
|
||||
const string circuit_file_location = "circuits/sha-1.txt";;
|
||||
const string circuit_file_location = "circuits/adder_32bit.txt";;
|
||||
static char out3[] = "92b404e556588ced6c1acd4ebf053f6809f73a93";//bafbc2c87c33322603f38e06c3e0f79c1f1b1475";
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
int port, party;
|
||||
parse_party_and_port(argv, &party, &port);
|
||||
|
||||
const static int nP = 4;
|
||||
const static int nP = 2;
|
||||
std::shared_ptr<IMultiIO> io = std::make_shared<NetIOMP>(nP, party, port);
|
||||
BristolFormat cf(circuit_file_location.c_str());
|
||||
|
||||
@@ -28,31 +28,31 @@ int main(int argc, char** argv) {
|
||||
FlexIn input(nP, cf.n1 + cf.n2, party);
|
||||
|
||||
for (int i = 0; i < cf.n1 + cf.n2; i++) {
|
||||
if (i < 100) {
|
||||
if (i < 32) {
|
||||
input.assign_party(i, 1);
|
||||
|
||||
if (party == 1) {
|
||||
input.assign_plaintext_bit(i, false);
|
||||
input.assign_plaintext_bit(i, i == 0 || i == 1);
|
||||
}
|
||||
} else if (i < 200) {
|
||||
} else {
|
||||
input.assign_party(i, 2);
|
||||
|
||||
if (party == 2) {
|
||||
input.assign_plaintext_bit(i, false);
|
||||
input.assign_plaintext_bit(i, i == 32 || i == 34);
|
||||
}
|
||||
} else if (i < 300) {
|
||||
input.assign_party(i, 3);
|
||||
} //else if (i < 300) {
|
||||
// input.assign_party(i, 3);
|
||||
|
||||
if (party == 3) {
|
||||
input.assign_plaintext_bit(i, false);
|
||||
}
|
||||
} else {
|
||||
input.assign_party(i, 4);
|
||||
// if (party == 3) {
|
||||
// input.assign_plaintext_bit(i, false);
|
||||
// }
|
||||
// } else {
|
||||
// input.assign_party(i, 4);
|
||||
|
||||
if (party == 4) {
|
||||
input.assign_plaintext_bit(i, false);
|
||||
}
|
||||
}
|
||||
// if (party == 4) {
|
||||
// input.assign_plaintext_bit(i, false);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
FlexOut output(nP, cf.n3, party);
|
||||
@@ -72,7 +72,7 @@ int main(int argc, char** argv) {
|
||||
res += (output.get_plaintext_bit(i)?"1":"0");
|
||||
cout << hex_to_binary(string(out3))<<endl;
|
||||
cout << res<<endl;
|
||||
cout << (res == hex_to_binary(string(out3))? "GOOD!":"BAD!")<<endl<<flush;
|
||||
// cout << (res == hex_to_binary(string(out3))? "GOOD!":"BAD!")<<endl<<flush;
|
||||
|
||||
delete mpc;
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user