- Reference 1: Design and implementation of HElib: a homomorphic encryption library [21]
- Reference 2: Fully Homomorphic Encryption without Bootstrapping [22]
- Reference 3: Homomorphic Evaluation of the AES Circuit [23]
Remember that the requirement of modulus switch is that while we change the ciphertext modulus from to , it should decrypt to the same plaintext . BGV’s modulus switch is similar to that of the RLWE modulus switch (§C-4.4), but there is an additional requirement, because BGV applies the scaling factor not to plaintext , but to noise . In the case of BFV or CKKS, their decryption process only needs to round off the noise in the low-digit area. However, in the case of BGV, the plaintext is in the low-digit area and its decryption process has to remove the noise in the higher-bit area by modulo- reduction (i.e., the plaintext modulus). More concretely, BGV’s modulus switch from should satisfy the decryption relation such that . In BGV’s modulus switch, does not have to be one of the multiplicative levels of the ciphertext, and only needs to satisfy the relationship: and . BGV’s modulus switch procedure is as follows:
And we compute the rounding error as follows:
, which we rewrite as follows:
# we denote , where
# we denote , where
Note that the computation result of and alone can exceed the range , because and . Therefore, we need to reduce and modulo to derive and .
# applying step 1’s result: ,
# applying step 2’s result: ,
So, . But in BGV, . Thus, the following holds:
# The BGV decryption relation of
# where represents the modulo- reduction
# applying step 4’s result: ,
# since in BGV, , and we chose such that
Now, if we can prove that (i.e., reduces modulo-), then this sufficiently leads to the conclusion that .
# where ,
# applying step 3: ,
Therefore, proving is equivalent to proving .
# applying step 1’s result:
# rearranging the terms
# taking out the common factor
# since
For successful decryption, every coefficient of the resulting polynomial of the above expression has to be within the range (which means that has successfully reduced modulo ). The first term can be viewed as the original ciphertext ct’s noise (with the plaintext message) scaled down by . The coefficients of the second term are also small, because and . The coefficients of the third term are also small, because . The coefficients of the last term are also small, because and are .
Therefore, (provided the above error thresholds hold).
# by applying step 6
# by applying step 7
This means that decrypting outputs the message .
We summarize BGV’s modulus switch as follows:
Summary D-4.7 BGV’s Modulus Switch
Suppose we have the current ciphertext modulus and new ciphertext modulus where and . Therefore, may or may not be one of the ciphertext moduli comprising a BGV ciphertext’s multiplicative level moduli .
BGV’s modulus switch from is equivalent to updating to as follows:
# where
# where
After the modulus switch (i.e., the noise scaling factor), stays the same as before. The secret key also stays the same as before. The noise gets scaled down roughly by , but this does not decrease the noise-to-ciphertext modulus ratio.
In the case of CKKS (§D-3.5.4), the difference between modulus switch and ModDrop is that the former scales down the plaintext’s scaling factor by , whereas ModDrop does not affect the plaintext’s scaling factor.
Similarly, in the case of BGV, modulus switch (rescaling) and ModDrop from both lower a BGV ciphertext’s modulus from . However, the key difference is that rescaling also decreases the noise’s scaling factor by , whereas ModDrop keeps the noise’s scaling factor the same as it is. Therefore, rescaling is used only during ciphertext-to-ciphertext multiplication (to be explained in §D-4.8) when scaling down the plaintext’s scaling factor in the intermediate ciphertext from . Meanwhile, ModDrop is used to reduce the modulo computation time during an application’s routine when it becomes certain that the ciphertext will not undergo any additional ciphertext-to-ciphertext multiplication (i.e., no need to further decrease the ciphertext’s modulus).
The main difference in modulus switch between CKKS and BGV is that the former decreases the plaintext’s scaling factor by approximately , whereas the latter decreases the noise’s scaling factor by approximately .
Source Code: Examples of BGV modulus switch can be executed by running this Python script.