D-3.12 Sparsely Packing Ciphertexts

In §D-3.1, we learned the CKKS encoding scheme which encodes an input vector with n 2 slots (i.e., n 2-dimensional input vector) into an (n 1)-degree polynomial. While the polynomial ring’s degree n is fixed at the setup stage of CKKS as a security parameter, some applications may only need to use fewer than n 2 input vector slots. Suppose we only need to use n 2 slots out of n 2 slots, where n is some number that divides n. Then, the corresponding input vector and encoded polynomial get a special property as described below:

Summary D-3.12 CKKS’s Sparsely Packing Polynomial and Ciphertext

Suppose that an n 2 -dimensional input vector gets encoded into a polynomial in [X](Xn + 1). And suppose that n is some number that divides n. We define polynomial M(X) [X](Xn + 1) as the one which has non-zero constants at the terms whose power is a multiple of n n and all other terms have zero constants (i.e., M(X) = c0 + c n nX n n + c2n n X2n n + + cn n nXn n n). We can express M(X) as some MY (Y ) [Y ](Y n + 1) where Y = X n n and thus M(X) = MY (X n n).

Then, the following are true:

1.
Every MY (Y ) [Y ](Y n + 1) is isomorphically mapped to (i.e., decoded into) some n 2-dimensional input vector which comprises n n repetitions of n 2 consecutive slot values.
2.
Conversely, if an n 2-dimensional input vector comprises n n repetitions of the first n 2 consecutive slot values, then the vector gets encoded into some MY (Y ) [Y ](Y n + 1) (i.e., some polynomial in [X](Xn + 1) that has zero constants at the terms whose degree is not a multiple of n n).

We could show both directions of proof: (1) the forward (decoding-direction) proof; and (2) the backward (encoding-direction) proof. However, it is sufficient to prove only either direction, because the encoding (σ1) and decoding (σ) processes are isomorphic. Among these two, we will show only the forward proof for simplicity.

D-3.12.1 Forward Proof: Decoding of Sparsely Packed Ciphertext

We will prove that for each MY (Y ) [Y ](Y n + 1) (i.e., a polynomial in [X](Xn + 1) which has non-zero constants only at those terms with a power of multiple of n n and zero constants in all other terms), the polynomial gets decoded into some n 2-dimensional input vector which comprises n n repetitions of the first n 2 consecutive slot values.

To decode M(X) into an input vector, we need to evaluate M(X) at n 2 distinct roots of Xn + 1 (i.e., n distinct primitive (μ = 2n)-th roots of unity), which are:

( M(ωJ(0)), M(ωJ(1)),,M(ωJ(n 2 1)))

# where ω = e𝑖𝜋 n , the base and generator of the primitive (μ = 2n)-th roots of unity

But since M(X) = MY (X n n), the above evaluation is equivalent to evaluating:

( MY ((ωJ(0)) n n), MY ((ωJ(1)) n n),,MY ((ωJ(n 2 1)) n n))

= ( MY ((ω n n)J(0)), MY ((ω n n)J(1)),,MY ((ω n n)J(n 2 1)))

= ( MY (ξJ(0)), MY (ξJ(1)),,MY (ξJ(n 2 1)))

# where ξ = e𝑖𝜋 n, the base and generator of the primitive (μ = 2n)-th roots of unity

Notice that ξ = ω n n. Therefore, the above evaluation of MY (Y ) outputs n n repeated values of MY (Y ) evaluated at n 2 distinct primitive (μ = 2n)-th roots of unity.