C-4.2 Example

Suppose we have the following LWE setup:

t = 4

q = 64

n = 4

Δ = q t = 16

m = 1 ∈ ℤt

S = (s0,s1,s2,s3) = (0,1,1,0) ∈{−1,0,1}4

A = (a0,a1,a2,a3) = (−25,12,−3,7) ∈ ℤq4

e = 1 ∈ ℤq

b = a0s0 + a1s1 + a2s2 + a3s3 + Δm + e = 26 ∈ ℤq

𝖫𝖶𝖤S,σ(Δm + e) = 𝖼𝗍 = (a0,a1,a2,a3,b) = (−25,12,−3,7,26) ∈ ℤqn+1

Now, suppose we want modulus switching from q = 64 to q^ = 32, which gives:

Δ^ = Δ ⋅32 64 = 8

e^ = ⌈1 ⋅32 64⌋ = 1

𝖫𝖶𝖤S,σ(Δ^m + e^ + 𝜖𝑎𝑙𝑙) = 𝖼𝗍^ = (a0^,a1^,a2^,a3^,b^)

= (⌈ −25 ⋅32 64⌋,⌈12 ⋅32 64⌋,⌈ −3 ⋅32 64⌋,⌈7 ⋅32 64⌋,⌈26 ⋅32 64⌋)

= (−12,6,−1,4,13) ∈ ℤq^n+1

Now, verify if the following LWE constraint holds:

b^ = a^0s0 + a^1s1 + a^2s2 + a^3s3 + Δ^m + e^ ∈ ℤ32

13 = 0 + 6 −1 + 0 + 8 ⋅1 + 1 ∈ ℤ32

13 ≈14 ∈ ℤ32

We got this small difference of 1 due to the rounding drift error of:

a0^ = ⌈−12.5⌋= −12, a2^ = ⌈−1.5⌋= −1, a3^ = ⌈3.5⌋= 4, and e^ = ⌈0.5⌋= 1

If we solve the LWE decryption formula:

b^−(a^0s0 +a^1s1 +a^2s2 +a^3s3) = 13−(0(−12)+1(6)+1(−1)+0(4)) = 13−(6−1) = 8 = m^+e^ ∈ ℤ32

m = ⌈ 8 Δ^⌋ = ⌈8 8⌋ = 1, which is correct.