This directory contains the code for the Secure and Correct Inference (SCI) library from "CrypTFlow2: Practical 2-Party Secure Inference".
- g++ (version >= 8)
- cmake
- make
- libgmp-dev
- libssl-dev
- SEAL 3.3.2
- Eigen 3.3
SEAL and Eigen are included in extern/
and are automatically compiled and installed. The other packages can be installed directly using sudo apt-get install <package>
on Linux.
To compile the library:
mkdir build && cd build
cmake .. [-DBUILD_TESTS=ON] [-DBUILD_NETWORKS=ON]
make
// or make -j for faster compilation
On successful compilation, the test and network binaries will be created in build/bin/
.
Run the tests as follows to make sure everything works as intended:
./<test> r=1 [p=port] & ./<test> r=2 [p=port]
To run secure inference on networks:
./<network> r=1 [p=port] < <model_file> // Server
./<network> r=2 [ip=server_address] [p=port] < <image_file> // Client
This library includes code from the following external repositories:
- emp-toolkit/emp-tool for cryptographic tools and network I/O.
- emp-toolkit/emp-ot for Naor-Pinkas (base) OT and IKNP OT extension implementation.
- mc2-project/delphi for implementation of Gazelle's algorithms for convolution and fully connected layers, which was majorly modified for better efficiency.
- homenc/HElib for command-line argument parsing.