This is the implemented GAR protocol for the paper: Towards Generic MPC Compilers via Variable Instruction Set Architectures (VISAs) to be presented on ACM CCS 2023.
Eprint link: https://eprint.iacr.org/2023/953
To set up environment, then bulld repo (you might need root):
cd build
bash build.sh
We test above methods already on a vanilla Ubuntu 20.04 machine with sse4.1/avx2 flags.
The repo is designed to be executed on two parties: the GC garbler (Alice) and the GC evaluator (Bob). By default, Alice and Bob are executed on a same machine (via LAN). To execute on two different machines, please update the connection address in Main.cpp (of Bob) from 127.0.0.1
to the Alice's IP address, then type make
in folder build.
Let $IP
denote the IP address of Alice.
As a toy example, to execute the PSI64 benchmark:
Alice (Garbler):
cd build
cp ../testinginputs/psi/64/* ./
./SGC2PC Alice 129 128 localhost
Bob (Evalutor):
cd build
cp ../testinginputs/psi/64/* ./
./SGC2PC Bob 129 128 $IP
Similarly, one can:
cp ../testinginputs/psi/256/* ./
cp ../testinginputs/psi/1024/* ./
cp ../testinginputs/dij/40/* ./
cp ../testinginputs/dij/60/* ./
cp ../testinginputs/dij/80/* ./
cp ../testinginputs/dij/100/* ./
cp ../testinginputs/kmp/50-400/* ./
cp ../testinginputs/kmp/150-700/* ./
cp ../testinginputs/kmp/250-1500/* ./
cp ../testinginputs/kmp/500-7000/* ./
Note that, the x and y in ./SGC2PC Alice/Bob x y $IP need to be adjusted accordingly. The above cp
will also copy a file called res
. The res
(as a testing log we recorded) includes what parameters should be used. In particular, x reflects the #Fragments in the paper (see Figure 4,7), y reflects the #Mem Ent in the paper (see Figure 3,4).
In the Alice side, it outputs:
MAXACC: #RAM Accesses in the paper, see Figure 3,4
Total materials size: Comm. in the paper, see Figure 3,4
Materials transferred time: Trans. Time in the paper, see Figure 4,6
Garbling time: Gb. Time in the paper, see Figure 4,6
In the Bob side, it outputs:
E2e time: Total Time in the paper, see Figure 4,6
Note that:
Ev. Time (see Figure 4,6) = Total Time - Gb. Time - Trans. Time
#Executed Fragments (see Figure 4,7) = #RAM Access - 1
To get #Inst. (see Figure 4,7), please add a macro #define PLAIN
in Main.cpp of both Alice and Bob, then recompile the repo using make
. Re-execute the experiments will result in Bob outputing a file called plain
, which is a log of the execution path.
Program analysis/calc_plain_inst.cpp can be compiled into an executable to output #Inst. using plain
as inputs.
E.g., ./a.out < plain
.
Note that we already include a plain
in each corresponding folder in testinginputs/*, generated by us.
E.g., testinginputs/kmp/500-7000/plain
is the log for KMP500-7000.
We tested it only on LAN, namely, one machine executing both Alice and Bob
We tested it using benchmark PSI256.
Re Figure 8 in the paper, to set up the network, we use commands:
sudo tc qdisc del dev lo root
sudo tc qdisc add dev lo root handle 1: tbf rate 2Gbit burst 100000 limit 10000
sudo tc qdisc add dev lo parent 1:1 handle 10: netem delay 25msec (resp. 50msec)
See baseline/WGMK/*
for the baseline [WGMK16]
See baseline/EMP/*
for the baseline emp-toolkit