D-1.1 Encryption and Decryption

TFHE encrypts and decrypts ciphertexts based on the LWE cryptosystem (§B-2), which is equivalent to the GLWE cryptosystem (§B-4) with n = 1. However, one distinction from the LWE cryptosystem is that TFHE samples the secret key elements from the binary set {0,1}, not from the ternary set {−1,0,1}.

⟨Summary D-1.1⟩ TFHE Encryption and Decryption

Initial Setup: Δ = q t, s→ ←$ℤ2k ▹ where t divides q, and each element of s→ is a 0-degree polynomial


Encryption Input: m ∈ ℤt, a→ ←$ℤqk, e ←χσℤq ▹each element of a→ is a 0-degree polynomial

1.
Scale up m→Δ ⋅m  ∈ ℤq
2.
Compute b = a→ ⋅s→ + Δm + e  mod q
3.
𝖫𝖶𝖤s→,σ(Δm + e) = (a→,b)  ∈ ℤqk+1


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

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

Condition for Correct Decryption:

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).