This C++ library implements the Full-RNS CKKS Homomorphic Encryption scheme. Apart from the basic use-case of CKKS, the library also implements the multi-key variant explained in this paper. The library doesn't implement Galois keys and can be used as a reference for future C++ multi-key CKKS libraries. The library was created as part of final-year university project in order to compare with existing HE libraries while using HE for contact tracing.
The library depends on Protobuf and BigInt. While building BigInt is included in CMake, Protobuf needs to be installed beforehand.
The command for building is:
cmake -B build .
cmake --build build
After this, the library will be created inside the build
folder.
The library can also be compiled for iOS/Android.
Protobuf needs to be built firstly. Using their source code, we can generate a binary with CMake and Xcode. After this, the smkhe
library can be built.
-
Generate the Xcode project with:
cmake -S . -B build-ios -GXcode -DCMAKE_SYSTEM_NAME=iOS "-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64" -Dprotobuf_BUILD_TESTS=OFF
-
Then, using the project created inside
build-ios
, the protobuf binary can be built. -
Modify the
PROTOBUF_LIB
variable from line 6 of the CMakeLists file to point to the binary -
Use CMake with the
CMakeLists
file from thecmake
folder as in the first step to generate the iOS project ofsmkhe
- Using the details from here, we can build the
Protobuf
binary using CMake - Modify the
PROTOBUF_LIB
variable from line 6 of the CMakeLists file to point to the binary - Similarly to 1, build the
smkhe
binary using CMake
- Homomorphic encryption for arithmetic of approximate numbers
- Efficient multi-key homomorphic encryption with packed ciphertexts with application to oblivious neural network inference
- A full rns variant of approximate homomorphic encryption
- Faster homomorphic discrete fourier transforms and improved fhe bootstrapping