D-4.11 Modulus Bootstrapping

- Reference: Bootstrapping for BGV and BFV Revisited [14]

BGV’s bootstrapping shares some common aspects with both BFV and CKKS’s bootstrapping. The goal of BGV’s bootstrapping is the same as that of CKKS, but the internal technique is closer to that of BFV. Like CKKS, BGV’s bootstrapping resets the depleted ciphertext modulus from ql qL (strictly speaking, from ql ql such that l < l < L because the bootstrapping operation itself consumes some multiplicative levels). This modulus transition effectively not only resets the multiplicative level but also reduces the noise-to-ciphertext modulus ratio. To achieve this goal, one might think that BGV’s bootstrapping can take the same ModRaise approach used by CKKS’s bootstrapping. However, this is not a directly applicable solution, because CKKS uses the sine approximation technique to eliminate the q0-overflows after the mod-raise. On the other hand, BGV is an exact encryption scheme which does not allow approximation of plaintext values. Therefore, BGV uses BFV’s digit extraction approach to eliminate its modulus overflows. To use digit extraction, like in the case of BFV, BGV also has to modify the plaintext modulus to a specially prepared one, p𝜀. To configure both the plaintext modulus and the ciphertext modulus to desired values (i.e., p𝜀 and qL), BGV uses the homomorphic decryption technique like BFV.

The technical details of BGV’s bootstrapping are as follows.

Suppose that we have an RLWE ciphertext (A,B) = 𝖱𝖫𝖶𝖤S,σ(M) mod ql, where A S + B = M + ΔE, Δ = t = p (a prime), and ql is the ciphertext modulus of the current multiplicative level.

1.
Modulus Switch from ql q^: BFV’s bootstrapping initially switches the ciphertext modulus from q p𝜀1 where q p𝜀 > t = p. On the other hand, BGV’s bootstrapping switches the ciphertext modulus to q^ that is a special modulus satisfying the relation: q^ 1 mod p𝜀 and q^ > p𝜀 (where p𝜀 will be explained in the next step). In order for a modulus switch from ql q^ (i.e., the special modulus) to be possible, the prime factor(s) comprising q^ have to be congruent with q0,,qL mod t, so that we can do a modulus switch from ql q^ q^ (based on the technique learned in §D-4.7). Eventually, this step’s modulus switch transforms the ciphertext (A,B) mod ql to (A^,B^) mod q^, during which the plaintext modulus (i.e., noise’s scaling factor) stays the same.

2.
Ciphertext Coefficient Multiplication by p𝜀1: The constant p𝜀1 is multiplied to each coefficient of the ciphertext polynomials, updating the ciphertext to p𝜀1 (A^,B^) = (A,B) mod q^, where A = p𝜀1A^ and B = p𝜀1B^. This operation updates the original decryption relation A^ S + B^ = M + 𝑝𝐸 + Kq^ to AS + B = p𝜀1M + p𝜀E + Kq^ (where K = K p𝜀1). Notice that the plaintext modulus (i.e., noise’s scaling factor) has been changed from p p𝜀. When choosing 𝜀, BGV enforces the following additional constraint: q^ > p𝜀 and q^ 1 mod p𝜀.

3.
ModRaise: We mod-raise (A^,B^) mod q^ to (A^,B^) mod qL, where q^ qL. The mod-raised ciphertext’s decryption relation is as follows:

A^ S + B^ = p𝜀1M + p𝜀E + Kq^ mod qL

Note that Kq^ is the q^-multiple overflow and does not get reduced modulo qL, because Kq^ qL. We saw the same situation in the CKKS bootstrapping’s ModRaise (§D-3.13.1) which resets the ciphertext modulus from q0 qL at the cost of incurring a Kq0 overflow, which is to be removed by EvalExp’s homomorphic (approximate) sine graph evaluation (§D-3.13.4). Likewise, BGV’s mod-raised ciphertext (A^,B^) mod qL is 𝖱𝖫𝖶𝖤S,σ(p𝜀1M + p𝜀E + Kq^) mod qL, an encryption of p𝜀1M + p𝜀E + Kq^. In the later step, we will use digit extraction to homomorphically eliminate Kq^ like we did in BFV’s bootstrapping. The reason BGV’s bootstrapping uses digit extraction instead of approximated sine evaluation is that BGV is an exact encryption scheme like BFV (not an approximate scheme like CKKS).

4.
CoeffToSlot: This step works the same way as CKKS and BFV’s CoeffToSlot step: move the coefficients of polynomial p𝜀1M + p𝜀E + q^K to the input vector slots of a new ciphertext. We denote polynomial Z = p𝜀1M + p𝜀E + q^K, and each i-th coefficient of Z as zi. For the CoeffToSlot step, we homomorphically compute Z n1 W~ InR. Then, each input vector slot of the resulting ciphertext ends up storing each zi of the polynomial Z.

5.
Digit Extraction: At this point, each input vector slot contains each coefficient of p𝜀1M + p𝜀E + q^K, which is p𝜀1mi + p𝜀ei + q^ki. Recall that we designed the lowest multiplicative level’s ciphertext modulus q^ and the homomorphic multiplication factor p𝜀 such that q^ 1 mod p𝜀, or q^ = kq^p𝜀 + 1 for some positive integer kq^. Therefore, the following holds:

p𝜀1mi + p𝜀ei + q^ki

= p𝜀1mi + p𝜀ei + ki(kq^p𝜀 + 1) # applying q^ = kq^p𝜀 + 1

= p𝜀1mi + ki+ p𝜀 (ei + kikq^) # rearranging the terms

= p𝜀1mi + ki+ p𝜀 kq^+𝜀 # where kq^+𝜀 = ei + kikq^

= p𝜀1mi + kimod p𝜀

To eliminate ki from the above, we will use the same digit extraction polynomial G𝜀,v as in BFV (§D-2.11.5) :

zi = d0 + ( j=𝜀𝜀1dpj) # where d0 p, and d can be any integer, and 1 𝜀 w

F𝜀(zi) d0 mod p𝜀+1

G𝜀,v(zi) zi F𝜀 F𝜀 F𝜀 v times(zi) mod p𝜀

We evaluate the digit extraction polynomial G𝜀,v for v = {𝜀 1,𝜀 2,,1} recursively total 𝜀 1 times, at each coefficient zi of polynomial Z stored at input vector slots. This operation finally zeros out the least significant (base-p) 𝜀 1 digits of zi as follows:

G𝜀,1 G𝜀,2 G𝜀,𝜀2 G𝜀,𝜀1(zi) mod p𝜀

= p𝜀1mi mod p𝜀

= p𝜀1mi + kip𝜀

, where kip𝜀 is some multiple of p𝜀 to account for the original p𝜀-overflow term plus an additional p𝜀-overflows generated during the digit extraction. Note that the digit extraction step reduces the ciphertext modulus from qL ql (where l is an integer smaller than L), because the homomorphic evaluation of the polynomial G𝜀,v requires some ciphertext-to-ciphertext multiplications, which consume some multiplicative levels.

6.
Homomorphic Multiplication by p(𝜀1): The output of the digit extraction step is p𝜀1mi + kip𝜀 stored in each input vector slot. We homomorphically multiply |p(𝜀1)|p𝜀 to it, which is a modulo-p𝜀 inverse of p𝜀1. Note that p(𝜀1) is guaranteed to exist because p𝜀 is a finite field (i.e., Galois field) whose every element is guaranteed to have its counterpart inverse (Theorem A-3.1 in §A-3.1). Multiplying p(𝜀1) to p𝜀1mi + kip𝜀 is equivalent to an exact division of p𝜀1mi + kip𝜀 by p𝜀1, because p𝜀1mi + kip𝜀 is exactly divisible by p𝜀1. We homomorphically compute the following:

|p(𝜀1)|p𝜀 (p𝜀1mi + kip𝜀) = mi + kip(𝑚𝑜𝑑p𝜀)

Note that the plaintext value mi + kip mod p𝜀 is also equivalent to mi + kip mod p (because p divides p𝜀), and is also equivalent to mi mod q (i.e., the message portion without the noise is mi). Therefore, homomorphically multiplying |p(𝜀1)|p𝜀 to a ciphertext that encrypts p𝜀1mi + kip𝜀 is equivalent to switching the plaintext modulus from p𝜀 p.

In an alternative design, one can eliminate this step of homomorphic multiplication by p(𝜀1) by re-designing the digit extraction algorithm to gradually shift down the digits by total (base-p) 𝜀 1 digits (by multiplying by |p1|p𝜀 at the end of each round of digit extraction).

7.
SlotToCoeff: This step works the same way as BFV’s SlotToCoeff step: move mi + kip stored in the input vector slots back to the polynomial coefficient positions by homomorphically multiplying with W~.

Meanwhile, the coefficient domain is in modulo qL. From modulo-qL’s perspective, the result of step 5 is |p(𝜀1)|p𝜀 (p𝜀1mi + kip𝜀) mod qL. It is guaranteed that |p(𝜀1)|p𝜀 (p𝜀1mi + kip𝜀) < qL, because p𝜀 qL. Therefore, result of SlotToCoeff is a set of polynomial coefficients whose noise is within the noise budget of qL.

8.
Noise Term Re-interpretation: The output of the SlotToCoeff step is 𝖱𝖫𝖶𝖤S,σ(M + Kp) mod ql, which also contains some noise term Ep generated during the homomorphic operations of step 2 6. Therefore, we can view the Kp term in the plaintext as part of the noise of the ciphertext. In other words, we can view 𝖱𝖫𝖶𝖤S,σ(M + Kp) with some noise term Ep as a ciphertext 𝖱𝖫𝖶𝖤S,σ(M) with the noise term Ep + Kp = (E+ K) p. This step does not require any additional computation. The size of the coefficients of K is upper-bounded because the operations of the CoeffToSlot, digit extraction, and SlotToCoeff steps are fixed. With a proper setup of the cryptographic parameters of BGV, we can guarantee that the noise-to-ciphertext modulus ratio always gets decreased after BGV’s bootstrapping (i.e., ||E + K|| qL < ||E+ K|| ql < ||E|| q^ , where q^ < ql < ql < qL, and ||P|| denotes the maximum absolute coefficient value of polynomial P).
D-4.11.1 The Reason for Modulus Switch from ql q^

BGV switches the modulus from ql q^ to eliminate the ql-multiple overflows during bootstrapping. After switching the modulus ql q^ and then ModRaise, the encrypted plaintext gets the Kq^ overflow term, which can be reduced to K from the plaintext modulus’s perspective due to the special property q^ 1 mod p𝜀 (where p𝜀 is the plaintext modulus).

D-4.11.2 ModRaise instead of Homomorphic Decryption

In the case of BFV’s bootstrapping, we need homomorphic decryption (§D-2.11.3) because we need to simultaneously change the ciphertext’s plaintext scaling factor from p𝜀1 q p and the ciphertext modulus from p𝜀 q. On the other hand, in the case of CKKS’s bootstrapping, ModRaise instead of homomorphic decryption is sufficient because we only need to change the ciphertext modulus from q0 qL while keeping the same plaintext scaling factor Δ ql ql1. Similarly, in the case of BGV’s bootstrapping, ModRaise instead of homomorphic decryption is sufficient because we only need to change the ciphertext modulus from q^ qL while keeping the noise scaling factor (i.e., the plaintext modulus) Δ = p𝜀.

D-4.11.3 The Choice of 𝜀

The larger 𝜀 is, the greater the (base-p) digit-wise gap between p𝜀1M and K becomes, and thus the less likely it is that the decryption would fail (i.e., fail to zero out K). But a larger 𝜀 means the digit extraction operation would be more expensive.

D-4.11.4 Generalization to Δ = pr

Like the case of BFV’s bootstrapping (Summary D-2.11.7 in §D-2.11.7), we can generalize the plaintext modulus (i.e., noise scaling factor) to pr where p is a prime and r can be any positive integer.