D-2.7 Ciphertext-to-Ciphertext Multiplication

- Reference 1: Introduction to the BFV encryption schemeΒ [12]

- Reference 2: Somewhat Partially Fully Homomorphic EncryptionΒ [13]

Given two ciphertexts 𝖱𝖫𝖢𝖀S,Οƒ(Ξ”M⟨1⟩) and 𝖱𝖫𝖢𝖀S,Οƒ(Ξ”M⟨2⟩), the goal of ciphertext-to-ciphertext multiplication is to derive a new ciphertext whose decryption is Ξ”M⟨1⟩M⟨2⟩. Ciphertext-to-ciphertext multiplication is more complex than ciphertext-to-plaintext multiplication. It comprises four steps: (1) ModRaise; (2) polynomial multiplication; (3) relinearization; and (4) rescaling.

For better understanding, we will explain BFV’s ciphertext-to-ciphertext multiplication based on the alternate version of RLWE (TheoremΒ B-4.4 in Β§B-4.4), where the sign of the 𝐴𝑆 term is flipped in the encryption and decryption formulas.

D-2.7.1 ModRaise

We learned from SummaryΒ D-2.3 (in Β§D-2.3) that a BFV ciphertext whose ciphertext modulus is q has the (decryption) relation: Ξ”M + E = A β‹…S + B βˆ’K β‹…q, where K β‹…q stands for modulo reduction by q. ModRaise is a process of forcibly modifying the modulus of a ciphertext from q β†’Q, where q β‰ͺQ. Suppose we modify the modulus of ciphertext (A,B) from q to Q, where Q = q β‹…Ξ” (remember Ξ” = ⌊q tβŒ‹). Then, the decryption of the mod-raised ciphertext will output A β‹…S + B mod Q. However, since each polynomial coefficient of A and B is less than q and each polynomial coefficient of S is either {βˆ’1,0,1}, the resulting polynomial of A β‹…S + B is guaranteed to have each coefficient strictly less than Q even without modulo reduction by Q– this is because (q βˆ’1) β‹…n + (q βˆ’1) < Q, where (q βˆ’1) β‹…n is the maximum possible coefficient of A β‹…S and (q βˆ’1) is the maximum possible coefficient of B. And as mentioned before, we know the relation: A β‹…S + B = Ξ”M + E + πΎπ‘ž. Therefore, the decryption of the mod-raised ciphertext (A,B) mod Q is as follows:

Ξ”M + E + πΎπ‘ž mod Q = Ξ”M + E + πΎπ‘ž # since Ξ”M + E + πΎπ‘ž < Q

The first step of BFV’s ciphertext-to-ciphertext multiplication is to mod-raise the two input ciphertexts (A⟨1⟩,B⟨1⟩) mod q and (A⟨2⟩,B⟨2⟩) mod q from q β†’Q (where Q = q β‹…Ξ”) as follows:

(A⟨1⟩,B⟨1⟩) mod Q

(A⟨2⟩,B⟨2⟩) mod Q

After ModRaise, the decryption of these two ciphertexts would be the following:

A⟨1βŸ©β‹…S + B⟨1⟩ = Ξ”M⟨1⟩+ E⟨1⟩+ K1q < Q

A⟨2βŸ©β‹…S + B⟨2⟩ = Ξ”M⟨2⟩+ E⟨2⟩+ K2q < Q

Therefore, the mod-raised ciphertexts have the following form:

𝖱𝖫𝖢𝖀S,Οƒ(Ξ”M⟨1⟩+ K1q) = (A⟨1⟩,B⟨1⟩) mod Q

𝖱𝖫𝖢𝖀S,Οƒ(Ξ”M⟨2⟩+ K2q) = (A⟨2⟩,B⟨2⟩) mod Q

D-2.7.2 Polynomial Multiplication

Our next goal is to derive a new ciphertext which encrypts (Ξ”M⟨1⟩+ E⟨1⟩+ K1q) β‹…(Ξ”M⟨2⟩+ E⟨2⟩+ K2q).

First, we can derive the following relation:

(Ξ”M⟨1⟩+ E⟨1⟩+ K1q) β‹…(Ξ”M⟨2⟩+ E⟨2⟩+ K2q)

= (A⟨1βŸ©β‹…S + B⟨1⟩) β‹…(A⟨2βŸ©β‹…S + B⟨2⟩)

= B⟨1⟩B⟨2⟩⏟ D0 + (B⟨2⟩A⟨1⟩+ B⟨1⟩A⟨2⟩)⏟ D1 β‹…S + (A⟨1βŸ©β‹…A⟨2⟩)⏟ D2 β‹…S β‹…S

= D0 + D1 β‹…S + D2 β‹…S2

Meanwhile, we also have the following relations:

𝖱𝖫𝖢𝖀S,Οƒβˆ’1(Ξ”M⟨1⟩+ K1q) = Ξ”M⟨1⟩+ E⟨1⟩+ K1q

𝖱𝖫𝖢𝖀S,Οƒβˆ’1(Ξ”M⟨2⟩+ K2q) = Ξ”M⟨2⟩+ E⟨2⟩+ K2q

Combining all these, we reach the following relation:

𝖱𝖫𝖢𝖀S,Οƒβˆ’1(Ξ”M⟨1⟩+ K1q) ⋅𝖱𝖫𝖢𝖀S,Οƒβˆ’1(Ξ”M⟨2⟩+ K2q) = D0 + D1 β‹…S + D2 β‹…S2

Notice that D0,D1, and D2 are known values as ciphertext components, whereas S is only known to the private key owner. Therefore, we can view D0 + D1 β‹…S + D2 β‹…S2 as a decryption formula such that given the ciphertext components D0,D1,D2 and the private key S, one can derive (Ξ”M⟨1⟩+ E⟨1⟩+ K1q) β‹…(Ξ”M⟨2⟩+ E⟨2⟩+ K2q). In other words, we can let (D0,D1,D2) be a new form of ciphertext which can be decrypted by S into (Ξ”M⟨1⟩+ E⟨1⟩+ K1q) β‹…(Ξ”M⟨2⟩+ E⟨2⟩+ K2q).

However, (D0,D1,D2) is not in the RLWE ciphertext format, because it has 3 components instead of 2. Having 3 ciphertext components is computationally inefficient, as its decryption involves a square root of S (i.e., S2). Over consequent ciphertext-to-ciphertext multiplications, this S term will double its exponents as S4,S8,β‹― as well as the number of ciphertext components, which would exponentially increase the computational overhead of decryption. Therefore, we want to convert the intermediate ciphertext format (D0,D1,D2) into a regular BFV ciphertext format that has two polynomials as ciphertext components. This conversion process is called a relinearization process (which will be explained in the next subsection).

D-2.7.3 Relinearization

Relinearization is a process of converting the polynomial triplet (D0,D1,D2) ∈R⟨n,Q⟩3 into two RLWE ciphertexts 𝖼𝗍α and 𝖼𝗍β which hold the relation: D0 + D1S + D2S2 = 𝖱𝖫𝖢𝖀S,Οƒβˆ’1(𝖼𝗍α + 𝖼𝗍β).

In the formula D0 + D1S + D2S2, we can re-write D0 + D1S as a synthetic RLWE ciphertext 𝖼𝗍α = (D1,D0), which can be decrypted by S into D1S + D0. Similarly, our next task is to derive a synthetic RLWE ciphertext 𝖼𝗍β whose decryption is D2 β‹…S2 (i.e., 𝖱𝖫𝖢𝖀S,Οƒβˆ’1(𝖼𝗍β) = D2 β‹…S2).

A naive way of creating a ciphertext that encrypts D2 β‹…S2 is as follows: we encrypt S2 into an RLWE ciphertext as 𝖱𝖫𝖢𝖀S,Οƒ(S2) = (A⟨s⟩,B⟨s⟩) such that A⟨sβŸ©β‹…S + B⟨s⟩ = S2 + E⟨s⟩mod Q (where the ciphertext modulus is Q and the plaintext scaling factor Ξ” = 1). Then, we perform a ciphertext-to-plaintext multiplication (Β§C-3) with D2, treating D2 as a plaintext polynomial in modulo Q. However, this approach does not work in practice, because computing D2 ⋅𝖱𝖫𝖢𝖀S,Οƒ(S2) generates a huge noise as follows:

D2 β‹…(A⟨s⟩,B⟨s⟩) = (D2 β‹…A⟨s⟩,D2 β‹…B⟨s⟩)

, whose decryption is:

D2 β‹…A⟨sβŸ©β‹…S + D2 β‹…B⟨s⟩ = D2 β‹…S2 + D2 β‹…E⟨s⟩(π‘šπ‘œπ‘‘Q)

. In the above decrypted expression D2S2 + D2E⟨s⟩mod Q, the term D2S2 is okay to be reduced modulo Q, because this term is originally allowed to be reduced modulo Q in the final decryption formula D0 + D1S + D2S2 mod Q as well. However, the problematic term is the noise D2 β‹…E⟨s⟩, because its coefficients can be any value in [0,Q βˆ’1] (since each coefficient of polynomial D2 = A⟨1⟩A⟨2⟩ can be any value in [0,Q βˆ’1]). Such a huge noise is not allowed for correct final decryption.

To avoid this noise issue, an improved solution is to express the RLWE ciphertext that encrypts D2S2 as additions of multiple RLWE ciphertexts with small noises by using the gadget decomposition technique (Β§A-6.4). For this, we use an RLev ciphertext (Β§B-5) that encrypts S2. Suppose our gadget vector is gβ†’ = (Q Ξ² , Q Ξ²2, Q Ξ²3,β‹―,Q Ξ²l). Remember that our goal is to find 𝖼𝗍β = 𝖱𝖫𝖢𝖀S,Οƒ(S2 β‹…D2) given known D2, unknown S, and known 𝖱𝖫𝖾𝗏S,σβ,l(S2) = {𝖱𝖫𝖢𝖀S,Οƒ ( Q Ξ²i β‹…S)}i=1l. Then, we can derive 𝖼𝗍β as follows:

𝖼𝗍β = 𝖱𝖫𝖢𝖀S,Οƒ(S2 β‹…D2)

= 𝖱𝖫𝖢𝖀S,Οƒ (S2 β‹… (D2,1Q Ξ² + D2,2 Q Ξ²2 + β‹―D2,l Q Ξ²l)) # by decomposing D2

= 𝖱𝖫𝖢𝖀S,Οƒ (S2 β‹…D2,1 β‹…Q Ξ² ) + 𝖱𝖫𝖢𝖀S,Οƒ (S2 β‹…D2,2 β‹…Q Ξ²2) + β‹― + 𝖱𝖫𝖢𝖀S,Οƒ (S2 β‹…D2,l β‹…Q Ξ²l)

= D2,1 ⋅𝖱𝖫𝖢𝖀S,Οƒ (S2 β‹…Q Ξ² ) + D2,2 ⋅𝖱𝖫𝖢𝖀S,Οƒ (S2 β‹…Q Ξ²2) + β‹― + D2,l ⋅𝖱𝖫𝖢𝖀S,Οƒ (S2 β‹…Q Ξ²l) # where each RLWE ciphertext is an encryption of S2Q Ξ² ,S2 Q Ξ²2,β‹―,S2 Q Ξ²l as plaintext with the plaintext scaling factor Ξ” = 1

= βŸ¨π–£π–Ύπ–Όπ—ˆπ—†π—‰Ξ²,l(D2), 𝖱𝖫𝖾𝗏S,σβ,l(S2)⟩ # inner product of Decomp and RLev treating them as vectors

If we decrypt the above, we get the following:

𝖱𝖫𝖢𝖀S,Οƒβˆ’1(𝖼𝗍β = βŸ¨π–£π–Ύπ–Όπ—ˆπ—†π—‰Ξ²,l(D2), 𝖱𝖫𝖾𝗏S,σβ,l(S2)⟩) # the scaling factors of 𝖱𝖫𝖾𝗏S,σβ,l(S2) are all 1

= D2,1 β‹… (E1β€²+ S2Q Ξ² ) + D2,2 β‹… (E2β€²+ S2 Q Ξ²2) + β‹― + D2,l β‹… (Elβ€²+ S2 Q Ξ²l) # where each Eiβ€² is a noise embedded in 𝖱𝖫𝖢𝖀S,Οƒ (S2 β‹…Q Ξ²i)

= βˆ‘ ⁑ i=1l(Eiβ€²β‹…D2,i) + S2 β‹… (D2,1Q Ξ² + D2,2 Q Ξ²2 + β‹― + D2,l Q Ξ²l)

= βˆ‘ ⁑ i=1lπœ–i + D2 β‹…S2 # where each πœ–i = Eiβ€²β‹…D2,i

β‰ˆD2 β‹…S2 # βˆ‘ ⁑ i=1lπœ–i β‰ͺD2 β‹…Eβ€³, where Eβ€³ is the noise that could’ve been embedded in 𝖱𝖫𝖢𝖀S,Οƒ(S2)

Therefore, we get the following comprehensive relation:

𝖱𝖫𝖢𝖀S,Οƒβˆ’1(Ξ”M⟨1⟩+ K1q) ⋅𝖱𝖫𝖢𝖀S,Οƒβˆ’1(Ξ”M⟨2⟩+ K2q) mod Q

= (Ξ”M⟨1⟩+ E⟨1⟩+ K1q) β‹…(Ξ”M⟨2⟩+ E⟨2⟩+ K2q) mod Q

= (A⟨1βŸ©β‹…S + B⟨1⟩) β‹…(A⟨2βŸ©β‹…S + B⟨2⟩) mod Q

= D0 + D1 β‹…S + D2 β‹…S2 mod Q # D0 = B⟨1⟩B⟨2⟩, D1 = A⟨1⟩B⟨2⟩+ A⟨2⟩B⟨1⟩, D2 = A⟨1⟩A⟨2⟩

= 𝖱𝖫𝖢𝖀S,Οƒβˆ’1(𝖼𝗍α) + 𝖱𝖫𝖢𝖀S,Οƒβˆ’1(𝖼𝗍β) βˆ’βˆ‘ ⁑ i=1l(Eiβ€²β‹…D2,i) mod Q

# 𝖼𝗍α = (D1,D0) = (AΞ±,BΞ²), 𝖼𝗍β = βŸ¨π–£π–Ύπ–Όπ—ˆπ—†π—‰Ξ²,l(D2),𝖱𝖫𝖾𝗏S,σβ,l(S2)⟩= (AΞ²,BΞ²)

= 𝖱𝖫𝖢𝖀S,Οƒβˆ’1(𝖼𝗍α + 𝖼𝗍β) βˆ’βˆ‘ ⁑ i=1l(Eiβ€²β‹…D2,i) mod Q

= 𝖱𝖫𝖢𝖀S,Οƒβˆ’1((AΞ±+Ξ²,BΞ±+Ξ²)) βˆ’βˆ‘ ⁑ i=1l(Eiβ€²β‹…D2,i) mod Q # AΞ±+Ξ² = AΞ± + AΞ², BΞ±+Ξ² = BΞ± + BΞ²

From the above, we extract the following relation:

(Ξ”M⟨1⟩+ E⟨1⟩+ K1q) β‹…(Ξ”M⟨2⟩+ E⟨2⟩+ K2q) mod Q

= Ξ”2M⟨1⟩M⟨2⟩+Ξ”β‹…(M⟨1⟩E⟨2⟩+M⟨2⟩E⟨1⟩)+qβ‹…(Ξ”M⟨1⟩K2+Ξ”M⟨2⟩K1+E⟨1⟩K2+E⟨2⟩K1)+K1K2q2+E⟨1⟩E⟨2⟩modQ

= 𝖱𝖫𝖢𝖀S,Οƒβˆ’1((AΞ±+Ξ²,BΞ±+Ξ²)) βˆ’βˆ‘ ⁑ i=1l(Eiβ€²β‹…D2,i) mod Q

We can re-write the above relation as follows:

𝖱𝖫𝖢𝖀S,Οƒβˆ’1((AΞ±+Ξ²,BΞ±+Ξ²)) = AΞ±+Ξ² β‹…S + BΞ±+Ξ² mod Q

= Ξ”2M⟨1⟩M⟨2⟩+Ξ”β‹…(M⟨1⟩E⟨2⟩+M⟨2⟩E⟨1⟩)+qβ‹…(Ξ”M⟨1⟩K2+Ξ”M⟨2⟩K1+E⟨1⟩K2+E⟨2⟩K1)+K1K2q2+E⟨1⟩E⟨2⟩+βˆ‘ ⁑ i=1l(Eiβ€²β‹…D2,i)modQ

To verbally interpret the above relation, decrypting the synthetically generated ciphertext (AΞ±+Ξ²,BΞ±+Ξ²) and applying a reduction modulo Q to it gives us Ξ”2M⟨1⟩M⟨2⟩ with a lot of noise terms. Meanwhile, as explained in the beginning of this subsection, our goal is to derive a ciphertext whose decryption is Ξ”M⟨1⟩M⟨2⟩, also ensuring that the decrypted ciphertext’s noise is small enough to be fully eliminated by scaling down the plaintext by Ξ” at the end. This goal is accomplished by the final rescaling step to be explained in the next subsection.

D-2.7.4 Rescaling

The rescaling step is equivalent to converting the ciphertext (AΞ±+Ξ²,BΞ±+Ξ²) mod Q into (⌈AΞ±+Ξ² Ξ” βŒ‹, ⌈BΞ±+Ξ² Ξ” βŒ‹) mod q, where Ξ” = ⌊q tβŒ‹ β‰ˆq t. The decryption of this rescaled ciphertext (and finally scaling down by Ξ”) is Ξ”M⟨1⟩M⟨2⟩. This is demonstrated below:

⌈AΞ±+Ξ² Ξ” βŒ‹ β‹…S + ⌈BΞ±+Ξ² Ξ” βŒ‹ mod q # decryption of ciphertext (⌈AΞ±+Ξ² Ξ” βŒ‹, ⌈BΞ±+Ξ² Ξ” βŒ‹) mod q

= ⌈AΞ±+Ξ² Ξ” βŒ‹ β‹…S + ⌈BΞ±+Ξ² Ξ” βŒ‹ + K3q # where K3q stands for modulo reduction by q

= ⌈AΞ±+Ξ² Ξ” βŒ‹ β‹…S + ⌈BΞ±+Ξ² Ξ” βŒ‹ + K3Q Ξ” # since Q = Ξ” β‹…q

= ⌈1 Ξ” β‹…(AΞ±+Ξ² β‹…S + BΞ±+Ξ² + K3Q)βŒ‹ + Er # Er is a rounding error

= ⌈1 Ξ” β‹…(AΞ±+Ξ² β‹…S + BΞ±+Ξ² mod Q)βŒ‹ + Er

= ⌈1 Ξ” β‹…(Ξ”2M⟨1⟩M⟨2⟩+ Ξ” β‹…(M⟨1⟩E⟨2⟩+ M⟨2⟩E⟨1⟩)+

q β‹…(Ξ”M⟨1⟩K2 + Ξ”M⟨2⟩K1 + E⟨1⟩K2 + E⟨2⟩K1) + K1K2q2 + E⟨1⟩E⟨2⟩+ βˆ‘ ⁑ i=1l(Eiβ€²β‹…D2,i) modQ)βŒ‹ + Er

# as we derived at the end of Β§D-2.7.3

= ⌈1 Ξ” β‹…(Ξ”2M⟨1⟩M⟨2⟩+ Ξ” β‹…(M⟨1⟩E⟨2⟩+ M⟨2⟩E⟨1⟩)+

q β‹…(Ξ”M⟨1⟩K2 + Ξ”M⟨2⟩K1 + E⟨1⟩K2 + E⟨2⟩K1) + K1K2q2 + E⟨1⟩E⟨2⟩+ βˆ‘ ⁑ i=1l(Eiβ€²β‹…D2,i) + K4Q)βŒ‹ + Er

# where K4Q stands for modulo reduction by Q

= βŒˆΞ”M⟨1⟩M⟨2⟩+ (M⟨1⟩E⟨2⟩+ M⟨2⟩E⟨1⟩) + q β‹…(M⟨1⟩K2 + M⟨2⟩K1)

+ 1 Ξ” β‹…q β‹…(E⟨1⟩K2 + E⟨2⟩K1) + 1 Ξ” β‹…(K1K2q2 + E⟨1⟩E⟨2⟩+ βˆ‘ ⁑ i=1l(Eiβ€²β‹…D2,i)) + K5qβŒ‹

# where K5q = K4q + M⟨1⟩qK2 + M⟨2⟩K1q

= βŒˆΞ”M⟨1⟩M⟨2⟩+ (M⟨1⟩E⟨2⟩+ M⟨2⟩E⟨1⟩) + q β‹…(M⟨1⟩K2 + M⟨2⟩K1) + (t + πœ–) β‹…(E⟨1⟩K2 + E⟨2⟩K1)

+ 1 Ξ” β‹…(K1K2q2 + E⟨1⟩E⟨2⟩+ βˆ‘ ⁑ i=1l(Eiβ€²β‹…D2,i)) + K5qβŒ‹

# where πœ– = q Ξ” βˆ’q q t = q ⌊q tβŒ‹ βˆ’q q t β‰ˆ0, thus we substituted q Ξ” = πœ– + t

= βŒˆΞ”M⟨1⟩M⟨2⟩+ (M⟨1⟩E⟨2⟩+ M⟨2⟩E⟨1⟩) + q β‹…(M⟨1⟩K2 + M⟨2⟩K1) + (t + πœ–) β‹…(E⟨1⟩K2 + E⟨2⟩K1)

+ K1K2q2 Ξ” + E⟨1⟩E⟨2⟩+ βˆ‘ ⁑ i=1l(Eiβ€²β‹…D2,i) Ξ” + K5qβŒ‹

# Now, let πœ–β€² = K1K2q2 Ξ” βˆ’K1K2q2 q t = K1K2q2 ⌊q tβŒ‹ βˆ’K1K2q2 q t β‰ˆ0.

Thus, we will substitute K1K2q2 Ξ” = K1K2q2 q t + πœ–β€² = K1K2π‘žπ‘‘ + πœ–β€²

= Ξ”M⟨1⟩M⟨2⟩+ (M⟨1⟩E⟨2⟩+ M⟨2⟩E⟨1⟩) + q β‹…(M⟨1⟩K2 + M⟨2⟩K1)

+ (t + πœ–) β‹…(E⟨1⟩K2 + E⟨2⟩K1) + K1K2π‘žπ‘‘ + πœ–β€²+ K5q + ⌈E⟨1⟩E⟨2⟩+ βˆ‘ ⁑ i=1l(Eiβ€²β‹…D2,i) Ξ” βŒ‹

= Ξ”M⟨1⟩M⟨2⟩+ πœ–β€³ + K6q

# where K6q = K5q + q β‹…(M⟨1⟩K2 + M⟨2⟩K1) + K1K2π‘žπ‘‘,

πœ–β€³ = M⟨1⟩E⟨2⟩+ M⟨2⟩E⟨1⟩+ (t + πœ–) β‹…(E⟨1⟩K2 + E⟨2⟩K1) + ⌈E⟨1⟩E⟨2⟩+ βˆ‘ ⁑ i=1l(Eiβ€²β‹…D2,i) Ξ” βŒ‹

= Ξ”M⟨1⟩M⟨2⟩+ πœ–β€³ mod q

In conclusion, the ciphertext (⌈AΞ±+Ξ² Ξ” βŒ‹, ⌈BΞ±+Ξ² Ξ” βŒ‹) mod q successfully decrypts to Ξ”M⟨1⟩M⟨2⟩ if πœ–β€³ < Ξ” 2 β‰ˆ q 2t.

Noise Analysis: Among the terms of πœ–β€³, let’s analyze the noise growth of the (t + πœ–) β‹…(E⟨1⟩K2 + E⟨2⟩K1) term after ciphertext-to-ciphertext multiplication. Each coefficient of K1 is at most n, because A⟨1βŸ©β‹…S + B⟨1⟩ = Ξ”M + E⟨1⟩+ K1q, where the maximum possible coefficient value of A⟨1βŸ©β‹…S + B⟨1⟩ is q β‹…n. And the same is true for the coefficients of K2. Therefore, after scaling down (t + πœ–) β‹…(E⟨1⟩K2 + E⟨2⟩K1) by Ξ” upon the final decryption stage, this term’s down-scaled noise gets bound by:

1 Ξ” β‹…(t + πœ–) β‹…(E⟨1⟩K2 + E⟨2⟩K1) β‰ˆt q β‹…(t + πœ–) β‹…(E⟨1⟩K2 + E⟨2⟩K1) < 𝑛𝑑 β‹…(t + πœ–) q β‹…(E⟨1⟩+ E⟨2⟩)

This implies that for correct decryption, 𝑛𝑑 β‹…(t + πœ–) q β‹…(E⟨1⟩+ E⟨2⟩) has to be smaller than 0.5. In other words, E⟨1⟩+ E⟨2⟩ has to be smaller than q 2𝑛𝑑 β‹…(t + πœ–). We can do noise analysis for all other terms for πœ–β€³ in a similar manner. Importantly, upon decryption, the aggregation of all these noise terms’ down-scaled values has to be smaller than 0.5 for correct decryption.

Modulus Switch v.s. Rescaling: Notice in the rescaling process, multiplying 1 Ξ” to AΞ±+Ξ² and BΞ±+Ξ² results in two effects: (1) converts Ξ”2M⟨1⟩M⟨2⟩ into Ξ”M⟨1⟩M⟨2⟩; (2) switches the modulus of the mod-raised ciphertexts from Q β†’q. In fact, modulus switch and rescaling are closely equivalent to each other. Modulus switch is a process of changing a ciphertext’s modulus (e.g., q β†’qβ€²), while preserving the property that the decryption of both ciphertexts results in the same plaintext. On the other hand, rescaling refers to the process of changing the scaling factor of a plaintext within a ciphertext (e.g., Ξ” β†’Ξ”β€²). Modulus switch inevitably changes the scaling factor of the plaintext within the target ciphertext, and rescaling also inevitably changes the modulus of the ciphertext that contains the plaintext (as shown in Β§D-2.7.4). Therefore, these two terms can be used interchangeably.

D-2.7.5 Summary

To put all things together, BFV’s ciphertext-to-ciphertext multiplication is summarized as follows:

⟨SummaryΒ D-2.7.5⟩ BFV’s Ciphertext-to-Ciphertext Multiplication

Suppose we have the following two RLWE ciphertexts:

𝖱𝖫𝖢𝖀S,Οƒ(Ξ”M⟨1⟩) = (A⟨1⟩,B⟨1⟩) mod q, where B⟨1⟩ = βˆ’A⟨1βŸ©β‹…S + Ξ”M⟨1⟩+ E⟨1⟩mod q

𝖱𝖫𝖢𝖀S,Οƒ(Ξ”M⟨2⟩) = (A⟨2⟩,B⟨2⟩) mod q, where B⟨2⟩ = βˆ’A⟨2βŸ©β‹…S + Ξ”M⟨2⟩+ E⟨2⟩mod q

Multiplication between these two ciphertexts is performed as follows:

1.
ModRaise

Forcibly modify the modulus of the ciphertexts (A⟨1⟩,B⟨1⟩) mod q and (A⟨2⟩,B⟨2⟩) mod q to Q (where Q = q β‹…Ξ”) as follows:

(A⟨1⟩,B⟨1⟩) mod Q

(A⟨2⟩,B⟨2⟩) mod Q

2.
Multiplication

Compute the following polynomial multiplications in modulo Q:

D0 = B⟨1⟩B⟨2⟩mod Q

D1 = B⟨2⟩A⟨1⟩+ B⟨1⟩A⟨2⟩mod Q

D2 = A⟨1βŸ©β‹…A⟨2⟩mod Q

3.
Relinearization

Compute the following:

𝖼𝗍α = (D1,D0)

𝖼𝗍β = βŸ¨π–£π–Ύπ–Όπ—ˆπ—†π—‰Ξ²,l(D2), 𝖱𝖫𝖾𝗏S,σβ,l(S2)⟩.

𝖼𝗍α+Ξ² = 𝖼𝗍α + 𝖼𝗍β

Then, this property holds: 𝖱𝖫𝖢𝖀S,Οƒβˆ’1(𝖱𝖫𝖢𝖀S,Οƒ(Ξ”2 β‹…M⟨1βŸ©β‹…M⟨2⟩)) β‰ˆπ–±π–«π–Άπ–€S,Οƒβˆ’1(𝖼𝗍α+Ξ²)

4.
Rescaling

Update 𝖼𝗍α+Ξ² = (AΞ±+Ξ²,BΞ±+Ξ²) mod Q to 𝖼𝗍’α+Ξ² = (⌈AΞ±+Ξ² Ξ” βŒ‹, ⌈BΞ±+Ξ² Ξ” βŒ‹) mod q.

This plaintext rescaling process can be also viewed as a modulus switch of the ciphertext 𝖼𝗍α+Ξ² from Q β†’q.

Note that after the ciphertext-to-ciphertext multiplication, the plaintext scaling factor Ξ” = ⌊q tβŒ‹, the ciphertext modulus q, the plaintext M, and the private key S stay the same as before.

The Purpose of ModRaise: When we multiply polynomials at the second step of ciphertext-to-ciphertext multiplication (Β§D-2.7.2), the underlying plaintext within the ciphertext temporarily grows to Ξ”2M⟨1⟩M⟨2⟩, which exceeds the allowed maximum boundary q for the plaintext (SummaryΒ D-2.3 in Β§D-2.3). After this point, applying modulo-q reduction to the intermediate result will irrevocably corrupt the plaintext. To avoid the corruption of the plaintext when it grows to Ξ”2M⟨1⟩M⟨2⟩, we temporarily increase the ciphertext modulus from q β†’Q, which is sufficiently large to hold Ξ”2M⟨1⟩M⟨2⟩ without wrapping around the boundary of the ciphertext modulus.

Swapping the Order of Relinearization and Rescaling: The order of relinearization and rescaling is interchangeable. Running rescaling before relinearization reduces the size of the ciphertext modulus, and therefore the subsequent relinearization can be executed faster.