This project contains a benchmarking suite to compile and run Fully Homomorphic Encryption (FHE) matrix multiplication tests across three major libraries: HElib, OpenFHE, and Microsoft SEAL.
.
├── arrays
│ ├── matrix1_1024x1024.csv
│ ├── matrix2_1024x1024.csv
│ ├── resultado_128x128.csv
│ ├── resultado_16x16.csv
│ ├── resultado_256x256.csv
│ ├── resultado_2x2.csv
│ ├── resultado_32x32.csv
│ ├── resultado_4x4.csv
│ ├── resultado_64x64.csv
│ └── resultado_8x8.csv
├── Helib
│ ├── CMakeLists.txt
│ ├── compile_all.sh
│ ├── functional_units
│ │ ├── functional_units.cpp
│ │ └── functional_units.hpp
│ ├── helib_ckks.cpp
│ ├── helib_ckksopenmp.cpp
│ └── run.sh
├── OpenFHE
│ ├── ckksOpenfhe.cpp
│ ├── ckksOpenfheopenmp.cpp
│ ├── CMakeLists.txt
│ ├── compileOpenfhe.sh
│ └── run_openfhe.sh
├── README.md
├── Resultados
│ ├── helib
│ ├── OpenFHE
│ ├── resultados de referencia
│ └── Seal
└── Seal
├── CMakeLists.txt
├── compileseal.sh
├── functional_units
│ ├── functional_units.cpp
│ └── functional_units.hpp
├── run_ckks.sh
├── seal_ckks.cpp
└── seal_ckksOpenmp.cpp
Ensure your Linux environment (Ubuntu recommended) has the following installed:
Essential Build Tools: build-essential, git, wget, m4
Dependencies: libgmp-dev, libntl-dev, libmpfr-dev
Compilers: The scripts will automatically download and install Clang-17 and CMake 3.26 locally to ~/.local.
Each library has a dedicated compilation script that handles the local installation of the library and its specific dependencies (like Intel HEXL or Google cpu_features).
- HElib
To install HElib and its dependencies: Bash
# ./compile_all.sh [BuildType] [UseHexl] [UseThreads] [DebugMode] [NodeName]
bash Helib/compile_all.sh Release ON ON OFF c02- OpenFHE
To install OpenFHE (handles BE2/BE4 and HEXL integration): Bash
# ./compileOpenfhe.sh [Node] [BuildType] [BE4] [BE2] [OpenMP] [NativeOpt] [NativeSize] [TCMalloc] [Hexl] [ProjPath] [InstallPath] [MathBackend] [NTL]
bash OpenFHE/compileOpenfhe.sh c02 Release ON ON ON ON 64 OFF OFF $(pwd) ~/.local/OpenFhe/c02 2 OFF- SEAL
To install Microsoft SEAL: Bash
# ./compileseal.sh [BuildType] [UseHexl] [Zlib] [Zstd] [SharedLibs] [CXX17] [Intrin] [StaticC] [Gaussian] [AlignedAlloc] [ZstdMul] [OpenMP] [Branching] [ProjPath] [Node]
bash Seal/compileseal.sh Release ON ON ON OFF ON ON OFF OFF ON ON OFF OFF $(pwd) c02If you are working on a cluster with SLURM, use the provided batch scripts. These scripts iterate through multiple configurations (Matrix sizes, HEXL ON/OFF, Optimization levels).
# Run HElib Tests
bash Helib/run.sh
# Run OpenFHE Tests
bash OpenFHE/run_openfhe.sh
# Run SEAL Tests
sbatch Seal/run_ckks.sh- Matrix Sizes: Modify the matrix_quantity array in the .sh files (e.g., (4 8 16 32 64)).
- Hardware Acceleration: To use Intel HEXL (AVX-512), ensure the argsHexl variable is set to "ON".
- Local Paths: All libraries are installed to $HOME/.local/ to avoid requiring sudo privileges and to prevent conflicts with system libraries.
This work was supported by the research project C121/23 CIBER-CAFE funded by INCIBE, and by the project PID2023-146569NB-C22 supported by MICIU/AEI/10.13039/501100011033 and ERDF/UE. Sandra Catalán was supported by the grant RYC2021-033973-I, funded by MCIN/AEI/10.13039/50110-0011033 and the European Union “NextGenerationEU”/PRTR and the project CIGE/2023/87 from Generalitat Valenciana. Manuel F. Dolz was supported by the Plan Gen–T project CIDEXG/2022/13 from Generalitat Valenciana.
