Uses OpenCheetah, SecONNds, Troy-Nova and EMP-OT to implement two protocols for 2PC and a few linear operations.
- Install OpenSSL and Eigen3
# for debian based distributions
apt install libssl-dev libeigen3-dev- To install EMP-Tool/EMP-OT/SEAL use:
./deps.sh./deps/ and place the projects inside it.
- For GPU support instead use the following to install Troy-Nova (this requires CUDA)
- (optional): Set CUDA architecture with
GPU_ARCHITECTURE; default:"75"
- (optional): Set CUDA architecture with
GPU_ARCHITECTURE="<architecture>" ./deps.sh -gpu
# or try
GPU_ARCHITECTURE="$(nvidia-smi --query-gpu=compute_cap --format=csv,noheader | sed 's/\.//g')" ./deps.sh -gpu./build.sh
# OR
mkdir ./data # to store ferret output
cmake . -B build -DCMAKE_BUILD_TYPE=Release -DUSE_APPROX_RESHARE=OFF \
-DTRIPLE_VERIFY=OFF -DTRIPLE_COLOR=OFF -DTRIPLE_ZERO=ON \
-DTRIPLE_GPU=OFF
cmake --build build -jCMake Options:
TRIPLE_VERIFY(BOOL): If enabled - Verify correctness of the triples. (For testing only)TRIPLE_COLOR(BOOL): If enabled - Use ANSI color codes for colored logs.TRIPLE_ZERO(BOOL): If enabled - Allow tensors to be zero (can be insecure).TRIPLE_GPU(BOOL): If enabled - Use Troy-Nova for Convolutions.TRIPLE_GPU_REVERSE(BOOL): If enabled - Encrypt filters instead of images (requiresTRIPLE_GPU=ON).TRIPLE_SEED(NUM): Set the seed (-1: no seed).TRIPLE_LOG_LEVEL(NUM):0: Log time and data required.1: Log debug info and errors.2: Log errors.
Formatting:
cmake --build build -t formatServer:
./build/bin/cheetah <PORT> <SAMPLES> <BATCHSIZE> <threads>Client:
./build/bin/cheetah_client <PORT> <HOST> <SAMPLES> <BATCHSIZE> <threads>Note
<SAMPLES> has currently no effect
Currently supported:
- Boolean triples via OT
- Matrix
$\times$ Vector triples via HE - 2D-Convolution triples via HE
- 2D-BatchNorm triples via HE
Note
Both parties have shares of the image (A1/A2) and the filters (B1/B2)
- Party1:
- IN:
$A1, B1$ - OUT:
$C1 = M2 + R1$
- IN:
- Party2:
- IN:
$A2, B2$ - OUT:
$C2 = M1 + R2$
- IN:
Verify:
Step 1:
- Party 1: A1' = Enc(A1), send A1' to Party 2
- Party 2: A2' = Enc(A2), send A2' to Party 1
Step 2:
- Party 1: M1 = (A1 + A2') B1 - R1, send M1 to Party 2
- Party 2: M2 = (A1' + A2) B2 - R2, send M2 to Party 1
Step 2:
- Party 1: C1 = Dec(M2) + R1
- Party 2: C2 = DEC(M1) + R2
Note
Both parties have shares of the image (A1/A2) but only Party 2 has the filters (B2)
- Party1:
- IN:
$A1$ - OUT:
$C1 = M2$
- IN:
- Party2:
- IN:
$A2, B2$ - OUT:
$C2 = R2$
- IN:
Verify
Step 1:
- Party 1: A1' = Enc(A1), send A1' to Party 2
Step 2:
- Party 2: M2 = (A1' + A2) B2 - R2, send M2 to Party 1
Step 3:
- Party 1: C1 = Dec(M2)
- Party 2: C2 = R2