Technology1 min read

CKKS — Rescaling

By · Published by Everything Blog

In short

Multiplying ciphertexts increases the underlying fixed-point scale factor from $\Delta$ to $\Delta^2$ while expanding inherent errors. Although relinearization restores the ciphertext's two-tuple shape, direct division within the original modulus ring fails because multiplying by an inverse leads to unacceptably large noise. The rescaling process resolves this by dividing ciphertext components as real numbers, rounding them, and transitioning to a smaller coefficient modulus $Q/\Delta$. This mathematical strategy has been implemented and published in an associated project pull request.

Key points

  • Simple ring division by $\Delta$ is unworkable because it can amplify ciphertext noise to…: Simple ring division by $\Delta$ is unworkable because it can amplify ciphertext noise to unacceptably high levels.
  • Modulus switching resets the squared scaling factor back to $\Delta$ while safely shrinki…: Modulus switching resets the squared scaling factor back to $\Delta$ while safely shrinking computational error terms.
  • The mathematical mechanics of CKKS rescaling establish the fundamental motivation for dev…: The mathematical mechanics of CKKS rescaling establish the fundamental motivation for developing future residue number system variants.

Sources checked by our analysis pipeline: 1

This is part of a tutorial series on the CKKS homomorphic encryption scheme.

In the last article, we described the key switching and relinearization algorithms. Relinearization allowed us to restore the natural “two tuple” ciphertext structure after a homomorphic multiplication, but we did not address two more problems produced by multiplication. The first is that, because CKKS uses fixed-point arithmetic on its underlying plaintexts, multiplication produces a ciphertext encoded with a squared scaling factor $\Delta^2$ relative to the operands which have scale $\Delta$. The second is that multiplication error grows too quickly: one error term is a product of the errors of the operands, and the other term looks like $\Delta \cdot e$.

This article solves both of these challenges with a technique called rescaling or modulus switching.1

Also, this article will be the one that finally motivates us to implement the residue number system (RNS) form of CKKS, which we will save for the next article.

The code for this article is in this pull request.

Rescaling mathematically

Reiterating from previous articles, our situation is we have a ciphertext…

Technology