D-3 CKKS Scheme

The CKKS scheme is designed for homomorphic addition and multiplication of complex numbers that contain imaginary numbers. Therefore, unlike BFV, GBV, or TFHE, which can only compute over integers, CKKS can compute real-world floating point arithmetic, such as machine learning.

The CKKS scheme’s goal is to homomorphically compute addition and multiplication of complex numbers. However, while our targeted inputs are complex numbers, CKKS’s plaintext space is defined as a (n 1)-degree polynomial ring with real-number coefficients having a limited precision, that is, Rn = [x](xn + 1). Therefore, CKKS designs its unique encoding scheme which converts the input complex numbers into integers which can be used as coefficients of a polynomial in Rn.

In overall, CKKS’s encryption procedure is as follows:

1.
Encoding1: Encode the targeted input complex number into a real number
2.
Encoding2: Encode the real number into an integer
3.
Encryption: Encrypt the integer by RLWE

The encrypted RLWE ciphertext supports homomorphic addition and multiplication.

At the end of all homomorphic operations, CKKS’s decryption procedure is as follows:

1.
Decryption: Decrypt the RLWE ciphertext into a plaintext integer
2.
Decoding1: Decode the integer to a real number
3.
Decoding2: Decode the real number to a complex number

Remember that BFV is an exact encryption scheme based on rings. On the other hand, CKKS introduces a drifting error while its encoding process of rounding square-root values (included in the Euler’s formula) to the nearest integer. Therefore, its decryption is not exactly the same as before encryption. Such a small error occurring during encryption and decryption makes CKKS an approximate encryption scheme.

CKKS internally uses the same schemes as BFV for encryption, decryption, ciphertext-to-plaintext addition, ciphertext-to-ciphertext addition, and ciphertext-to-plaintext multiplication. Meanwhile, CKKS uses slightly different schemes than BFV for encoding the input vector (i.e., input vector slots) rotation (if BFV uses the batch encoding scheme), ciphertext-to-ciphertext multiplication, and bootstrapping. This difference comes from the fact that CKKS handles homomorphic operations over complex numbers as inputs, whereas BFV handles homomorphic operations over rings.

Required Background


D-3.1 Encoding and Decoding
D-3.1.1 Example
D-3.2 Encryption and Decryption
D-3.3 Ciphertext-to-Ciphertext Addition
D-3.4 Ciphertext-to-Plaintext Addition
D-3.5 Homomorphic Ciphertext-to-Ciphertext Multiplication
D-3.5.1 Synthetic Ciphertext Derivation
D-3.5.2 Relinearization Method 1 – Ciphertext Decomposition
D-3.5.3 Relinearization Method 2 – Ciphertext Modulus Switch
D-3.5.4 Rescaling
D-3.5.5 Comparing BFV and CKKS Bootstrapping
D-3.5.6 Summary
D-3.6 Ciphertext-to-Plaintext Multiplication
D-3.7 ModDrop
D-3.7.1 Difference between Modulus Switch and ModDrop
D-3.8 Homomorphic Key Switching
D-3.9 Homomorphic Rotation of Input Vector Slots
D-3.9.1 Example
D-3.10 Contemplation on CKKS Encoding
D-3.11 Homomorphic Conjugation
D-3.12 Sparsely Packing Ciphertexts
D-3.12.1 Forward Proof: Decoding of Sparsely Packed Ciphertext
D-3.13 Modulus Bootstrapping
D-3.13.1 High-level Idea
D-3.13.2 Mathematical Expansion of the High-level Idea
D-3.13.3 Details: CoeffToSlot
D-3.13.4 Details: EvalExp
D-3.13.5 Details: SlotToCoeff
D-3.13.6 Reducing the Bootstrapping Overhead by Sparsely Packing Ciphertext
D-3.13.7 Summary
D-3.13.8 Reducing the Bootstrapping Noise