B-2.3 Decryption

1.
Given the ciphertext (a→,b) where b = a→ ⋅s→ + Δ ⋅m + e ∈ ℤq, compute b −a→ ⋅s→, which gives the same value as Δ ⋅m + e ∈ ℤq.
2.
Round Δ ⋅m + e ∈ ℤq to the nearest multiple of Δ (i.e., round it as a base Δ number), which is denoted as ⌈Δ ⋅m + e⌋Δ. This rounding operation successfully eliminates e and gives Δm, provided e is small enough to be e < Δ 2. If e ≥Δ 2, then some of the higher bits of the noise e will overlap with the plaintext m, won’t be blown away, and will corrupt some lower bits of the plaintext m.
3.
Compute Δm Δ , which is equivalent to right-shifting ⌈Δ ⋅m + e⌋Δ by log2Δ bits. (Here we assume Δ is a power of 2; if Δ is not a power of 2, scaling up or down m by Δ is equivalent to multiplying or dividing the value by Δ.)

The LWE decryption formula is summarized as follows:

⟨Summary B-2.3⟩ LWE Decryption

Decryption Input: 𝖼𝗍 = (a→,b)  ∈ ℤqk+1

1.
𝖫𝖶𝖤S,σ−1(𝖼𝗍) = b −a→ ⋅s→ = Δm + e(𝑚𝑜𝑑q)
2.
Scale down ⌈Δm + e Δ ⌋ mod t = m  ∈ ℤt

For correct decryption, the noise e should be e < Δ 2.

During decryption, the secret key owner can subtract a→ ⋅s→ from b because he can directly compute a→ ⋅s→ by using his secret key s→.

The reason we scaled the plaintext m by Δ is: (i) to left-shift m by log2Δ bits and separate it from the noise e in the lower bits during encryption, whereas e is essential to make it hard for the attacker to guess m or s→; and (ii) to eliminate e in the lower bits by right-shifting it by log2Δ bits without compromising m in the higher bits during decryption. The process of right-shifting (i.e., scaling) the plaintext m by log2Δ bits, followed by adding the noise e, is illustrated in Figure 8.

B-2.3.1 In the Case of t not Dividing q

In Summary B-2.2 (§B-2.2), we assumed that t divides q. In this case, there is no upper or lower limit on the size of plaintext m: its value is allowed to wrap around modulo t indefinitely, yet the decryption works correctly. This is because any wrap-around of m modulo t is carried by the mod-q reduction of the scaled plaintext during decryption.

On the other hand, suppose that t does not divide q. In such a case, we set the scaling factor as Δ = ⌊q t⌋. Then, provided q ≫t, the decryption works correctly even if m is a large value that wraps around t. We will show why this is so.

In this subsection’s analysis, we choose t to be an odd (prime) number, which is the general FHE practice for computational efficiency reasons (see §A-11.6.1). We assume the use of the centered residue system, where the plaintext domain is [−t −1 2 ,t −1 2 ] and the ciphertext domain is [−q 2,q 2 −1]. We denote plaintext m mod t as m = m′+ 𝑣𝑡, where m′ ∈ ℤt, and v is an integer that represents the t-overflow portions of m. We set the plaintext scaling factor as Δ = ⌊q t⌋. Then, the noise-added and Δ-scaled plaintext can be expressed as follows:

⌊q t⌋ ⋅m + e

= ⌊q t⌋ ⋅m′+ ⌊q t⌋ ⋅𝑣𝑡 + e ▹ applying m = m′+ 𝑣𝑡

= ⌊q t⌋ ⋅m′+ q t ⋅𝑣𝑡 − (q t − ⌊q t⌋) ⋅𝑣𝑡 + e

= ⌊q t⌋ ⋅m′+ 𝑞𝑣 − (q t − ⌊q t⌋) ⋅𝑣𝑡 + e

= ⌊q t⌋ ⋅m′+ 𝑞𝑣 −𝜖 ⋅𝑣𝑡 + e ▹ where 𝜖 = q t − ⌊q t⌋, a fractional value between [0,1)

Remember that the LWE decryption relation: b −a→ ⋅s→ mod q Δ mod t = Δm + e mod q Δ mod t. Therefore, from the above expression, we can decrypt the message by computing as follows:

⌈1 Δ ⋅ (b −a→ ⋅s→ mod q)⌋ mod t

= ⌈1 Δ ⋅ (Δm + e mod q)⌋ mod t

= ⌈ 1 ⌊q t ⌋ ⋅ (⌊q t⌋ ⋅(m′+ 𝑣𝑡) + e mod q)⌋ mod t

= ⌈ 1 ⌊q t ⌋ ⋅ (⌊q t⌋ ⋅m′+ ⌊q t⌋ ⋅𝑣𝑡 + e mod q)⌋ mod t

= ⌈ 1 ⌊q t ⌋ ⋅ (⌊q t⌋ ⋅m′+ (q t −𝜖) ⋅𝑣𝑡 + e mod q)⌋ mod t

= ⌈ 1 ⌊q t ⌋ ⋅ (⌊q t⌋ ⋅m′+ 𝑣𝑞 −𝜖𝑣𝑡 + e mod q)⌋ mod t

= ⌈ 1 ⌊q t ⌋ ⋅ (⌊q t⌋ ⋅m′−𝜖𝑣𝑡 + e mod q)⌋ mod t

In order for the decryption to work, we ideally want to eliminate the inner modulo q reduction. That is, assuming the centered residue system [−q 2,q 2 −1], we want −q 2 ≤ ⌊q t⌋ ⋅m′−𝜖𝑣𝑡 + e < q 2, or more strictly, |⌊q t⌋ ⋅m′−𝜖𝑣𝑡 + e| < q 2.

To ensure these conditions hold, we will make a special assumption: |−𝜖𝑣𝑡 + e|< Δ 2. Applying this assumption to the expression above, we can derive the following relation:

|⌊q t⌋ ⋅m′−𝜖𝑣𝑡 + e|

≤ |⌊q t⌋ ⋅m′|+ |−𝜖𝑣𝑡 + e|

≤ |⌊q t⌋ ⋅t −1 2 | + |−𝜖𝑣𝑡 + e| ▹ we assume t is an odd prime, as that’s the general FHE practice

≤ |q t ⋅t −1 2 | + |−𝜖𝑣𝑡 + e|

= q 2 − q 2t + |−𝜖𝑣𝑡 + e|

< q 2 − q 2t + Δ 2 ▹ applying our special assumption |−𝜖𝑣𝑡 + e|< Δ 2

= q 2 + 1 2 ⋅ (Δ −q t)

< q 2 ▹ since Δ < q t

Therefore, if we assume |−𝜖𝑣𝑡 + e|< Δ 2, then ⌊q t⌋ ⋅m′−𝜖𝑣𝑡 + e mod q can be simplified to ⌊q t⌋ ⋅m′−𝜖𝑣𝑡 + e. We continue with the following derivation:

⌈ 1 ⌊q t ⌋ ⋅ (⌊q t⌋ ⋅m′−𝜖𝑣𝑡 + e mod q)⌋ mod t

= ⌈ 1 ⌊q t ⌋ ⋅ (⌊q t⌋ ⋅m′−𝜖𝑣𝑡 + e)⌋ mod t

= ⌈m′+ −𝜖𝑣𝑡 + e ⌊q t ⌋ ⌋mod t

= m′+ ⌈−𝜖𝑣𝑡 + e ⌊q t ⌋ ⌋mod t ▹ since ⌈m′⌋= m′

= m′mod t ▹ applying special assumption |−𝜖𝑣𝑡 + e|< Δ 2 = ⌊q t ⌋ 2

To summarize, if we set the plaintext’s scaling factor as Δ = ⌊q t⌋ and t is an odd (prime) number, the decryption works correctly as long as the following error-bounding condition holds: |−𝜖𝑣𝑡 + e|< Δ 2 = ⌊q t ⌋ 2 . This condition (i.e., decryption) breaks if: (1) the noise e is too large relative to q; (2) the plaintext modulus t is too large relative to q; or (3) the plaintext value wraps around t too many times (i.e., v is too large). A general solution to ensure all these error bound conditions is to set the ciphertext modulus q to be sufficiently large. To put it differently, if q ≫t and q ≫e, then the error bound holds.

We can generalize the formula for the plaintext’s scaling factor in Summary B-2.2 (in §B-2.2) as ⌊q t⌋, where t is an odd (prime) number.

⟨Summary B-2.3.1⟩ Noise Budget for an Odd Plaintext Modulus 𝐭

Given the plaintext’s scaling factor Δ = ⌊q t⌋ and t is an odd (prime) number, the LWE decryption works correctly as long as the error-bounding condition holds:

|−𝜖𝑣𝑡 + e|< Δ 2

, where 𝜖 = q t − ⌊q t⌋ is a fractional value between [0,1), and v accounts for the t-overflows of the plaintext m.