D-2.3 Encryption and Decryption

BFV encrypts and decrypts ciphertexts based on the RLWE cryptosystem (§B-3) with the sign of each A ⋅S term flipped in the encryption and decryption formula. Specifically, this is equivalent to the alternative version of the GLWE cryptosystem (§B-4.4) with k = 1. Thus, BFV’s encryption and decryption formulas are as follows:

⟨Summary D-2.3⟩ BFV Encryption and Decryption

Initial Setup: Δ = ⌊q t⌋ is a plaintext scaling factor for polynomial encoding, S ←$R⟨n,𝑡𝑒𝑟𝑛⟩

, where plaintext modulus t is either a prime (p) or a power of prime (pr), and ciphertext modulus q ≫t. As for the coefficients of polynomial S, they are ternary (i.e., {−1,0,1}).


Encryption Input: ΔM ∈R⟨n,q⟩, Ai ←$R⟨n,q⟩, E ←χσR⟨n,q⟩

1.
Compute B = −A ⋅S + ΔM + E  ∈R⟨n,q⟩
2.
𝖱𝖫𝖶𝖤S,σ(ΔM + E) = (A,B)  ∈R⟨n,q⟩2


Decryption Input: 𝖼𝗍 = (A,B)  ∈R⟨n,q⟩2

𝖱𝖫𝖶𝖤S,σ−1(𝖼𝗍) = ⌈B + A ⋅S mod q Δ ⌋ mod t = ⌈ΔM + E Δ ⌋ mod t = M mod t

(The noise E = ∑ ⁡ i=0n−1eiXi gets eliminated by the rounding process)

Conditions for Correct Decryption:

As explained in Summary B-2.3.1 (in §B-2.3.1), the noise bound is |−𝜖kit + ei|< Δ 2, where ki is each coefficient of the polynomial K that accounts for the t-multiple overflows of the coefficients of the plaintext polynomial updated across homomorphic operations.

In this section, we will often write 𝖱𝖫𝖶𝖤S,σ(ΔM + E) as 𝖱𝖫𝖶𝖤S,σ(ΔM) for simplicity, because 𝖱𝖫𝖶𝖤S,σ(ΔM + E) ≈𝖱𝖫𝖶𝖤S,σ(ΔM) (i.e., they decrypt to the same message). Even in the case that we write 𝖱𝖫𝖶𝖤S,σ(ΔM) instead of 𝖱𝖫𝖶𝖤S,σ(ΔM + E), you should assume this as an encryption of ΔM + E (i.e., the noise is included inside the scaled message).

We will explain the conditions for BFV’s correct decryption in more detail in §D-2.4.1.