- Reference: Modulus Switching in LWE
Recall that the LWE cryptosystem (§B-2.2) comprises the following components:
Encryption Input: , ,
Encryption: (where )
In the LWE cryptosystem, modulus switching is a process of converting an original LWE ciphertext’s modulo domain to a smaller modulo domain. This can be seen as scaling down all components, except for the plaintext and the secret key , in the original LWE ciphertext to a smaller domain. This operation preserves the size and integrity of the original plaintext , while the scaling factor gets reduced to a smaller value and the noise to a smaller (reduced) noise (note that noise alteration does not affect the original plaintext , because the noise gets rounded away after decryption, anyway), and also gets scaled down to a smaller . Modulus switching is used for computational efficiency during TFHE’s bootstrapping (which will be discussed in §D-1.8). Modulus switching is also used for implementing the ciphertext-to-ciphertext multiplication algorithm in BGV (§D-2.7) and CKKS (§D-3.5).
The high-level idea of LWE modulus switch is to rescale the congruence relationship of the LWE scheme. LWE’s homomorphic computation algorithms include the following: ciphertext-to-ciphertext addition, ciphertext-to-plaintext addition, ciphertext-to-plaintext multiplication, ciphertext-to-ciphertext multiplication. However, all congruence relationships used in these algorithms are essentially rewritten versions of the following single fundamental congruence relationship: . Thus, modulus switch of an LWE ciphertext from is equivalent to rescaling the modulo of the above congruence relationship from .
Based on this insight, the LWE cryptosystem’s modulus switching from (where ) is a process of converting the original LWE ciphertext as follows:
Summary C-4.1 LWE Modulus Switching
Given an LWE ciphertext where and , modulus switch of the ciphertext from to is equivalent to updating to as follows:
, where each # means rounding to the nearest integer
The above update effectively changes and as follows:
,
# which should be an integer
Meanwhile, and stay the same as before.
Note that in order for to be a valid LWE ciphertext of , we need to prove that the following relationship holds:
Proof.
(where , a rounding drift error)
(where )
(where )
(where modulo is replaced by adding , some multiple of )
# where
The biggest possible value for is,
So, LWE modulus switching results in an approximate congruence relationship (§A-12). However, if is large enough, will be shifted to the right upon LWE decryption and get eliminated, and finally we can recover the original . Also, in practice, the term would converge to 0 for a sufficiently large , because each is uniformly sampled and is also uniformly sampled.
Caution: If is not large enough, then may not get eliminated during decryption and corrupt the plaintext . Also, if shrinks too much, then the distance between and would become too narrow and the rounding process of may end up overlapping the least significant bit of , corrupting the plaintext.
Thus, , decrypting which will give us .