p<q, p is plaintext modulus, q is ciphertext modulus, Δ=q/p is scaling factor, typically p,q are powers of two
M∈Rp is a message
Secret key is (s0,…,sk−1)∈Rk where the coefficients are sampled from uniform binary distribution
(a0,…,ak−1,b)∈Rqk+1 is GLWE ciphertext where (a0,…,ak−1) is sampled uniformly from Rqk and b=∑i=0k−1ai⋅si+ΔM+e where e∈Rq is sampled from Gaussian distribution χσ
Decryption happens in two phase:
Given GLWE ciphertext (a0,…,ak−1,b)∈Rqk, b−∑i=0k−1ai⋅si=ΔM+e
Divide the result by Δ and do rounding, for decryption to be successful, the (infinity) norm of e should be smaller than Δ/2
GLev ciphertext
For base β and l, GLev ciphertext for the message M is represented as following:
All GLWE ciphertexts are encrypted using the same secret key (s0,…,sk−1). The difference is that in GLev ciphertext, GLWE ciphertexts are not scaled by Δ. For j=0,…,l−1,
bj=i=0∑k−1aij⋅si+βj+1q⋅M+ej
GGSW ciphertext
GGSW ciphertext for the message M is given as the following:
Since b=∑i=0k−1ai⋅si+ΔM1+e and b′=∑i=0k−1ai′⋅si+ΔM2+e′, b+b′=∑i=0k−1(ai+ai′)⋅si+Δ(M1+M2)+e+e′. The resulting ciphertext is encryption of M1+M2 with slightly bigger noise.
Homomorphic multiplication
First, let's consider the multiplication of GLWE ciphertext GLWEs,σ(ΔM)=(a0,…,ak−1,b) with the constant Λ∈Rq with small coefficients. Then the multiplication is as follows:
Λ⋅(a0,…,ak−1,b)=(Λ⋅a0,…,Λ⋅ak−1,Λ⋅b)
Since b=∑i=0k−1ai⋅si+ΔM1+e, Λ⋅b=∑i=0k−1Λ⋅ai⋅si+ΔΛ⋅M1+Λ⋅e.
Key switching
Let's first consider homomorphic multiplication of the message M by the constant with large coefficients γ∈Rq. Applying the same method as above would make the noise big enough to make decryption to fail. In order to handle this, consider the decomposition of r∈Zq by base β as following:
qr=βr1+⋯+βlrl
We will assume that βl=q for now. r1,…,rl is smaller than β. For γ∈Rq, one can decompose each coefficient as above, and then γ=∑i=1lβiq⋅γi and γi has small norm.
Now, consider GLev ciphertext of M, (GLWEs,σ(βqM),…,GLWEs,σ(βlqM)). Since γ=γ1βq+⋯+γlβlq by the decomposition, γM=γ1βqM+⋯+γlβlqM. Thus, this can be obtained by ⟨Decompβ,l(γ),GLevs,σβ,l(M)⟩. However, since GLev ciphertext does not contain Δ, it is not directly used as homomorphic multiplication.
Now let's consider key switching. Key switching is to replace the secret key that was used to encrypt GLWE ciphertext with another secret key without decryption.
For GLWE ciphertext (a0,…,ak−1,b)∈GLWEs,σ(ΔM), the following is key switching key:
KSKi∈GLevs′,σKSKβ,l(si)
What we want to do is b−∑i=0k−1ai⋅si=ΔM+e without decryption.
LWE ciphertext (a,b=⟨a,s⟩+e+Δ⋅m)∈Zqn+1 where s∈{0,1}n
LUT encoded in t∈Rq
LUT encodes the values Δ⋅f(m)+e where f:Rq→Rq, ∣e∣<Δ/2
LUT has blocks of which the position corresponds to Δ⋅m+e
each element of LUT is embedded in each coefficient of Rq element by mod switching
Bootstrapping secret key
GLWE ciphertext secret key s′∈Rk
Bootstrapping key
Collection of GGSW ciphertexts of each bit of LWE secret key (si) encrypted by s′
Key switching key
GLev ciphertexts of bootstrapping secret key encrypted by s
The goal of PBS is to compute decryption procedure and evaluation of f(m) homomorphically, which means to compute LWE ciphertext of Δ⋅f(m) with small error than in input LWE ciphertext.
Since LUT conceptually has q/2 or q possible values (depending on the negacyclic property of LUT), we should properly embed these values into Rq element. Since Rq has N coefficients and has negacyclic property, we multiply each element of LUT by 2N/q and embed the resulting values into coefficients. Also, we do the similar thing to LWE ciphertext to embed them into Z2Nn+1. We will keep the notation for a,e,Δ, but should be aware that these values actually change after mod switching.
Step 1: Chain of CMux operations
Input: GLWE ciphertext of t⋅X−b encrypted by secret key s′ Output: GLWE ciphertext of t⋅X−(Δ⋅m+e)=t⋅X−b+∑i=0n−1aisi encrypted by secret key s′
At the first part of PBS, one should compute X−(Δ⋅m+e)=X−b+⟨a,s⟩ (this holds trivially in Rq because the exponents are in mod 2N). So how can homomorphically compute this? Since b is public value, GLWE ciphertext of X−b is given first. Depending on the value of each si∈{0,1}, one can multiply the GLWE ciphertext of Xai or just skip multiplying. This is where CMux operation and bootstrapping key comes to play. Since bootstrapping key is the GGSW ciphertext of each si, it is given to CMux operation as selector, and two GLWE ciphertexts, each of encrypting X−b+a0 and X−b. Then this CMux operation will compute X−b+a0s0. Applying CMux operation n times, one can compute X−b+∑i=0n−1aisi.
Step 2: Sample extraction
Input: GLWE ciphertext of t⋅X−(Δ⋅m+e) encrypted by secret key s′ Output: LWE ciphertext of the constant coefficient of t⋅X−(Δ⋅m+e)∈Rq under secret key (s0,0′,…,s0,N−1′,…,sk−1,0′,…,sk−1,N−1′) which are the coefficients of s′∈Rk
Since LUT is the encoding of the values Δ⋅f(m)+e′ in coefficients, GLWE ciphertext of t⋅X−(Δ⋅m+e) has Δ⋅f(m)+e′ in its constant coefficient. Thus we should extract the constant coefficient of the ciphertext homomorphically.
Step 3: Key switching
Input: LWE ciphertext of Δ⋅f(m)+e under secret key (s0,0′,…,s0,N−1′,…,sk−1,0′,…,sk−1,N−1′) which are the coefficients of s′∈Rk Output: LWE ciphertext of Δ⋅f(m)+e′ under secret key s
Finally, using key switching key, which is the collection of GLev ciphertexts of si,j′ under secret key s, we obtain the LWE ciphertext of Δ⋅f(m)+e′ under secret key s.
Below is the full description of PBS.
Next topic
In the next post, I will discuss about verifiable PBS using SNARK proof system.