mirror of
https://github.com/privacy-scaling-explorations/emp-wasm.git
synced 2026-01-09 10:07:54 -05:00
add mpc_test.sh and get it working
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
using namespace std;
|
||||
using namespace emp;
|
||||
|
||||
const string circuit_file_location = macro_xstr(EMP_CIRCUIT_PATH) + string("bristol_format/");
|
||||
const string circuit_file_location = "circuits/sha-1.txt";;
|
||||
static char out3[] = "92b404e556588ced6c1acd4ebf053f6809f73a93";//bafbc2c87c33322603f38e06c3e0f79c1f1b1475";
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
@@ -15,9 +15,7 @@ int main(int argc, char** argv) {
|
||||
NetIOMP<nP> io2(party, port+2*(nP+1)*(nP+1)+1);
|
||||
NetIOMP<nP> *ios[2] = {&io, &io2};
|
||||
ThreadPool pool(4);
|
||||
string file = circuit_file_location+"/AES-non-expanded.txt";
|
||||
file = circuit_file_location+"/sha-1.txt";
|
||||
BristolFormat cf(file.c_str());
|
||||
BristolFormat cf(circuit_file_location.c_str());
|
||||
|
||||
CMPC<nP>* mpc = new CMPC<nP>(ios, &pool, party, &cf);
|
||||
cout <<"Setup:\t"<<party<<"\n";
|
||||
|
||||
31
scripts/mpc_test.sh
Executable file
31
scripts/mpc_test.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# Define the programs to run
|
||||
PROGRAM_A="./build/mpc 1 8005"
|
||||
PROGRAM_B="./build/mpc 2 8005"
|
||||
PROGRAM_C="./build/mpc 3 8005"
|
||||
|
||||
# Run 3 instances of the program in the background and print output as it comes
|
||||
$PROGRAM_A 2>&1 | sed 's/^/A: /' &
|
||||
PID1=$!
|
||||
$PROGRAM_B 2>&1 | sed 's/^/B: /' &
|
||||
PID2=$!
|
||||
$PROGRAM_C 2>&1 | sed 's/^/C: /' &
|
||||
PID3=$!
|
||||
|
||||
# Function to abort everything if a process fails
|
||||
abort() {
|
||||
echo "Aborting..."
|
||||
kill $PID1 $PID2 $PID3 2>/dev/null
|
||||
wait $PID1 $PID2 $PID3 2>/dev/null
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Wait for all processes to complete, abort if any fail
|
||||
wait $PID1 || abort
|
||||
wait $PID2 || abort
|
||||
wait $PID3 || abort
|
||||
|
||||
echo "Finished"
|
||||
Reference in New Issue
Block a user