The codes under this directory are based on the SCI library of Microsoft's EzPC project. We (authors of Cheetah) additionally implemented efficient OT primitives based on the Ferret library. See this for example. Also, we replace some underlying implementations for the linear functions, see this. In addition, we have clean up some codes in the origin SCI repo for our uses.
This directory contains the code for the Secure and Correct Inference (SCI) library from "CrypTFlow2: Practical 2-Party Secure Inference" and "SIRNN: A Math Library for Secure RNN 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 if not found. The other packages can be installed directly using sudo apt-get install <package>
on Linux.
To compile the library:
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=./install .. [-DBUILD_TESTS=ON] [-DBUILD_NETWORKS=ON]
cmake --build . --target install --parallel
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 [port=port] & ./<test> r=2 [port=port]
To run secure inference on networks:
./<network> r=1 [port=port] < <model_file> // Server
./<network> r=2 [ip=server_address] [port=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.