This repository provides a proof-of-concept implementation in SageMath of the SPRU bootstrapping procedure [1].
-
Prerequisites: Ensure you have SageMath 10.0 or higher installed. You can download it from the SageMath website.
-
Clone the repository:
git clone https://github.com/se-tim/SPRU-Implementation.git cd SPRU-Implementation -
Initialize the submodules: Ensure all submodules are correctly initialized, as explained here: Git submodule inside of a submodule (nested submodules). Therefore, run the following command inside the cloned repository:
git submodule update --init --recursive
-
spru_package/: The main package containing all implementations related to CKKS and the SPRU procedure:-
ckks_in_sagemath/: A submodule. It implements the main CKKS functionalities, including the original bootstrapping procedure. Make sure that this is initialized correctly, as described in the section Installation. -
ckks_x.py: Implements the functionalities required for the SPRU procedure, building on the core CKKS operations. -
ext_bit_rev.py: Implements functions related to extended bit-reversing (bit-reversing with only the least significant bits).
-
-
test.pyA script demonstrating the SPRU bootstrapping.
The test.py script demonstrates the SPRU bootstrapping.
-
Parameter selection: Choose default parameters or manually input your own.
-
Key generation and bootstrapping configuration: Generate secret, public and evaluation keys. Also perform the precomputations required for the SPRU bootstrapping.
-
Security estimation: Estimate the security level of the current parameter set. By default, the primal hybrid security level is not estimated (to save time).
-
Encryption: Encrypt a random complex vector.
-
SPRU bootstrapping: Refresh a ciphertext at lowest level through bootstrapping.
-
Precision measurement: Evaluate the precision loss introduced during SPRU bootstrapping.
To run the script, make sure you are in the root directory of the repository, then execute:
sage test.pyResults will be printed directly to the terminal.
- Jean-Sébastien Coron and Robin Köstler. Low-Latency Bootstrapping for CKKS using Roots of Unity, 2025. https://eprint.iacr.org/2025/651.