@InProceedings{verifiable_ckks,
author="Cascudo, Ignacio and Costache, Anamaria and Cozzo, Daniele and Fiore, Dario and Guimar{\~a}es, Antonio and Soria-Vazquez, Eduardo",
editor="Tauman Kalai, Yael and Kamara, Seny F.",
title="Verifiable Computation for Approximate Homomorphic Encryption Schemes",
booktitle="Advances in Cryptology -- CRYPTO 2025",
year="2025",
publisher="Springer Nature Switzerland",
address="Cham",
pages="643--677",
doi="10.1007/978-3-032-01907-3_21",
isbn="978-3-032-01907-3"
}
Note
This commit stores the reference code for the results presented in the paper.
Please note this is just a proof-of-concept implementation.
Click here to see the latest version of our proof-friendly CKKS library.
- Basic development packages (On Debian-based systems:
sudo apt install make gcc cmake) - Python 3 (Tested on Python 3.10.12)
- SageMath (tested with version 9.5)
- GCC/G++ (Tested on GCC 11.4.0)
- Strongly recommended: A processor with AVX-512 IFMA (Tested on Intel i7-1165G7 and Intel Xeon 8488C).
git clone https://github.com/vfhe/proof-friendly-CKKS.git
The Python code will compile the C library during the first execution. You can recompile the C code using the following flags at the end of any python command:
--full-recompile
Deletes all building files and recompiles the entire code, including HEXL.
--recompile
Recompiles our C library, but not HEXL. Use it if you make any modifications in our C code.
--cc=X
--cxx=X
Defines the compiler for C and CPP code, respectively. For example `--cxx=g++-15`.
Warning
The optimized version of this implementation requires AVX-512 IFMA. It should be significantly slower and possibly unstable without it (but it should still work).
python3 -m pyckks.ckks
- Notice that the
-m pyckks.ckksis only required because you are running a module inside our library. - You can change parameters in lines 184 to 187 of pyckks/ckks.py.
- Defaults are
(N,d,L) = (2^14, 4, 6).
python3 -m pyckks.bench_sumcheck 10
- Replace 10 with the number of variables.
- You can change parameters in line 46 of pyckks/bench_sumcheck.py.
- Please note that this benchmark uses 48 threads. You can change this in line 47 of lib/src/sumcheck.cpp. Remember to recompile the code with:
python3 pyckks.bench_sumcheck 10 --recompile
We also provide a benchmark for piecewise Reed-Solomon encoding.
cd lib
make main
./main
- You can change parameters in lines 26 to 30 of lib/main_benchmark.cpp. For default parameters,
MATRIX_yis$5\sqrt{n}$ , for a commitment with$\log_2(n)$ variables.RS_cw_szmust be adjusted accordingly, such thatMATRIX_x/RS_cw_szis the RS code rate. - You can change the number of threads in line 24 of lib/main_benchmark.cpp. Notice that this will run the same code (but with different inputs of the same size) multiple times in parallel (since we always perform many commitments at once, there is no reason for internal parallelism).
The Python library should also work on MAC, but performance will be significantly worse. We suggest following these steps:
- Install a GNU C++ compiler, if you don't have one.
brew install gcc
- Compile our code with the following command, replacing
Xwith the version of g++ installed by brew.
python3 -m pyckks.librings --arm --cc=gcc-X --cxx=g++-X
- If, for some reason, Python does not have access to the SageMath libraries, you can also run:
sage --python -m pyckks.librings --arm --cc=gcc-X --cxx=g++-X
Note that:
- Sage can also be installed on Mac OS with brew.
- The option
--arm --cc=gcc-X --cxx=g++-Xis only necessary when compiling for the first time, or when recompiling the C library. It is not needed afterwards.
Additionally, this repository contains copies or snippets of code from:
- MOSFHET: Apache License Version 2.0 - Copyright Antonio Guimarães et al. - See their detailed copyright information.
- HELIOPOLIS: Apache License Version 2.0
- Intel HEXL: Apache License 2.0 - Copyright 2020 Intel Corporation
- BLAKE3: Apache License 2.0 - Copyright 2019 Jack O'Connor and Samuel Neves