D-1.6 Homomorphic Ciphertext-to-Ciphertext Multiplication
- Reference: TFHE Deep Dive - Part III - Key switching and leveled multiplicationsΒ [9]
TFHE supports multiplication of two ciphertexts in the form:
.
The 1st term
comes from one of the following:
- A fresh LWE encryption (Β§B-4.2) of plaintext .
- A homomorphically added result of two LWE ciphertexts (Β§C-1).
- A homomorphically multiplied result of a LWE ciphertext with a plaintext (Β§C-3).
The 2nd term
comes from one of the following:
- A fresh GSW encryption (Β§B-6.1) of plaintext .
- Converted from
into
by circuit bootstrapping (this will be covered in the future).
Remember the following:
,
where
Letβs use the following notations:
π¦π²πΆsβ,ΟΞ²,l(m2) = πΌπΒ― = (πΌπΒ―0,.πΌπΒ―1,Β β―Β πΌπΒ―k)
πΌπΒ―i = π«πΎπsβ,ΟΞ²,l(βsi β
m2) for
0 β€i β€(k β1)
πΌπΒ―k = π«πΎπsβ,ΟΞ²,l(m2)
πΌπ = π«πΆπ€sβ,Ο(Ξm1 + e1) = (aβ,b) = (a0,a1,Β β―Β ,akβ1,b) = (πΌπ0,πΌπ1,β―,πΌπk)
Letβs define the following TFHE ciphertext multiplication operation:
πΌπ β
πΌπΒ― = β β‘
i=0kβ¨π£πΎπΌπππΞ²,l(πΌπi),πΌπΒ―iβ©
Then, the following is true:
β¨SummaryΒ D-1.6β©
TFHE Ciphertext-to-Ciphertext Multiplication
πΌπ = π«πΆπ€sβ,Ο(Ξm1 + e1) = (a0,a1,β―,akβ1,b)
πΌπΒ― = π¦π²πΆsβ,ΟΞ²,l(m2) = (π«πΎπsβ,ΟΞ²,l(βs0β
m2),π«πΎπsβ,ΟΞ²,l(βs1β
m2),β―,π«πΎπsβ,ΟΞ²,l(βskβ1β
m2),π«πΎπsβ,ΟΞ²,l(m2))
π«πΆπ€sβ,Ο(Ξm1 + e1) β
π¦π²πΆsβ,ΟΞ²,l(m2)
= β β‘
i=0kβ¨π£πΎπΌπππΞ²,l(πΌπi),πΌπΒ―iβ©
βπ«πΆπ€sβ,Ο(Ξm1m2)
This means that multiplying two TFHE ciphertexts (one is in LWE and another in GSW) and
decrypting the resulting LWE ciphertext gives the same result as multiplying their two original
plaintexts.
Proof.
-
1.
- β β‘
i=0kβ¨π£πΎπΌπππΞ²,l(πΌπi),πΌπΒ―iβ©
= β¨π£πΎπΌπππΞ²,l(a0),πΌπΒ―0β©+β¨π£πΎπΌπππΞ²,l(a1),πΌπΒ―1β©+Β β―Β +β¨π£πΎπΌπππΞ²,l(akβ1),πΌπΒ―kβ1β©+β¨π£πΎπΌπππΞ²,l(b),πΌπΒ―kβ©
βΉ
expanding the dot product of two vectors
-
2.
- For i = k:
π£πΎπΌπππΞ²,l(b) = (b1,b2,β¦,bl),
where b = b1 q
Ξ²1 + b2 q
Ξ²2 + β― + bl q
Ξ²l
βΉ
from Β§A-6.2
πΌπΒ―k = π«πΎπsβ,ΟΞ²,l(m2) = (π«πΆπ€sβ,Ο (m2 q
Ξ²1 + e2,1) ,π«πΆπ€sβ,Ο (m2 q
Ξ²2 + e2,2) ,β¦,π«πΆπ€sβ,Ο (m2 q
Ξ²l + e2,l))
Therefore:
β¨π£πΎπΌπππΞ²,l(b),πΌπΒ―kβ©
= b1 β
π«πΆπ€sβ,Ο (m2 q
Ξ²1 + e2,1) + b2 β
π«πΆπ€sβ,Ο (m2 q
Ξ²2 + e2,2) + Β β―Β + bl β
π«πΆπ€sβ,Ο (m2 q
Ξ²l + e2,l)
= π«πΆπ€sβ,Ο (b1m2 q
Ξ²1 + b1e2,1) + π«πΆπ€sβ,Ο (b2m2 q
Ξ²2 + b2e2,2) + Β β―Β + π«πΆπ€sβ,Ο (blm2 q
Ξ²l + ble2,l)
βΉ
from Β§C-3
= π«πΆπ€sβ,Ο (b1m2 q
Ξ²1 + b2m2 q
Ξ²2 + Β β―Β + blm2 q
Ξ²l + b1e2,1 + β― + ble2,l)
βΉ
from Β§C-1
= π«πΆπ€sβ,Ο (m2 β
(b1 q
Ξ²1 + b2 q
Ξ²2 + Β β―Β + bl q
Ξ²l + eβ¨kβ©))
βΉ
where eβ¨kβ© = β β‘
i=1lbie2,i
= π«πΆπ€sβ,Ο(m2b + eβ¨kβ©)
βΉ
from Β§A-6.2
-
3.
- For 0 β€i β€(k β1):
π£πΎπΌπππΞ²,l(ai) = (aβ¨i,1β©,aβ¨i,2β©,Β β―Β ,aβ¨i,lβ©),
where ai = aβ¨i,1β© q
Ξ²1 + aβ¨i,2β© q
Ξ²2 + Β β―Β + aβ¨i,lβ© q
Ξ²l
πΌπΒ―i = π«πΎπsβ,ΟΞ²,l(βsim2)
= (π«πΆπ€sβ,Ο (βsim2 q
Ξ²1 + ei,1) ,π«πΆπ€sβ,Ο (βsim2 q
Ξ²2 + ei,2) ,Β β―Β ,π«πΆπ€sβ,Ο (βsim2 q
Ξ²l + ei,l))
Therefore:
β¨π£πΎπΌπππΞ²,l(a0),πΌπΒ―0β©+ β¨π£πΎπΌπππΞ²,l(a1),πΌπΒ―1β©+ Β β―Β + β¨π£πΎπΌπππΞ²,l(akβ1),πΌπΒ―kβ1β©
= β β‘
i=0kβ1β¨π£πΎπΌπππΞ²,l(ai),πΌπΒ―iβ©
= β β‘
i=0kβ1(aβ¨i,1β©β
π«πΆπ€sβ,Ο (βsim2 q
Ξ²1 + ei,1) + aβ¨i,2β©β
π«πΆπ€sβ,Ο (βsim2 q
Ξ²2 + ei,2) +
β― + aβ¨i,lβ©β
π«πΆπ€sβ,Ο (βsim2 q
Ξ²l + ei,l) )
= β β‘
i=0kβ1(π«πΆπ€sβ,Ο (βaβ¨i,1β©sim2 q
Ξ²1 + aβ¨i,1β©ei,1) + π«πΆπ€sβ,Ο (βaβ¨i,2β©sim2 q
Ξ²2 + aβ¨i,2β©ei,2) +
Β β―Β + π«πΆπ€sβ,Ο (βaβ¨i,lβ©sim2 q
Ξ²l + aβ¨i,lβ©ei,l) )
= β β‘
i=0kβ1π«πΆπ€sβ,Ο (βaβ¨i,1β©sim2 q
Ξ²1 βaβ¨i,2β©sim2 q
Ξ²2 + Β β―Β βaβ¨i,lβ©sim2 q
Ξ²l + aβ¨i,1β©ei,1 + β― + aβ¨i,lβ©ei,l)
= β β‘
i=0kβ1π«πΆπ€sβ,Ο (βsim2 β
(aβ¨i,1β© q
Ξ²1 + aβ¨i,2β© q
Ξ²2 + Β β―Β + aβ¨i,lβ© q
Ξ²l) + aβ¨i,1β©ei,1 + β― + aβ¨i,lβ©ei,l)
= β β‘
i=0kβ1π«πΆπ€sβ,Ο(βsim2ai + eβ¨iβ©)
βΉ
where eβ¨iβ© = aβ¨i,1β©ei,1 + β― + aβ¨i,lβ©ei,l
-
4.
- According to step 2 and 3,
β β‘
i=0kβ¨π£πΎπΌπππΞ²,l(πΌπi),πΌπΒ―iβ©
= β β‘
i=0kβ1π«πΆπ€sβ,Ο(βsim2ai + eβ¨iβ©) + π«πΆπ€sβ,Ο(m2b + eβ¨kβ©)
= π«πΆπ€sβ,Ο (β β‘
i=0kβ1(βsim2ai) + m2b + β
i=0keβ¨iβ©)
βΉ
addition of two LWE ciphertexts
= π«πΆπ€sβ,Ο (m2b ββ β‘
i=0kβ1m2aisi + β
i=0keβ¨iβ©)
= π«πΆπ€sβ,Ο (m2(b ββ β‘
i=0kβ1aisi + β
i=0keβ¨iβ©))
= π«πΆπ€sβ,Ο (m2(Ξm1 + e1) + β β‘
i=0keβ¨iβ©)
= π«πΆπ€sβ,Ο (Ξm1m2 + m2e1 + β β‘
i=0keβ¨iβ©)
βπ«πΆπ€sβ,Ο(Ξm1m2)
βΉ
given m2e1 + β β‘
i=0keβ¨iβ©
is small and thus m2e1
is also small
β‘
To reduce the noise growth, noise bootstrapping is needed (will be discussed in Β§D-1.8).
D-1.6.1 Generalization to GLWE-to-GGSW Multiplication
We can further generalize TFHEβs LWE-to-GSW multiplication to GLWE-to-GGSW multiplication between the following
two ciphertexts: π¦π«πΆπ€Sβ,Ο(ΞM1) β
π¦π¦π²πΆSβ,ΟΞ²,l(M2),
where M1,
M2, and
S are
(n β1)-degree
polynomials.
The 1st term π¦π«πΆπ€Sβ,Ο(ΞM1)
comes from one of the following:
- A fresh GLWE encryption (Β§B-4.2) of plaintext M1.
- A homomorphically added result of two GLWE ciphertexts (Β§C-1).
- A homomorphically multiplied result of a GLWE ciphertext with a plaintext (Β§C-3).
The 2nd term π¦π¦π²πΆSβ,ΟΞ²,l(M2)
comes from one of the following:
- A fresh GGSW encryption (Β§B-6.1) of plaintext M2.
- Converted from π¦π«πΆπ€Sβ,Ο(ΞM2)
into π¦π¦π²πΆSβ,ΟΞ²,l(M2)
by circuit bootstrapping (this will be covered in the future).
Remember the following:
π¦π«πΆπ€Sβ,Ο(ΞM1) = (A0,A1,Β β―Β ,Akβ1,B) βRn,qk+1,
where B = β β‘
i=0kβ1(Ai β
Si) + ΞM1 + E
βΉfrom
Β§B-4.2
π¦π¦π²πΆSβ,ΟΞ²,l(M2) = {{π¦π«πΎπSβ,ΟΞ²,l(βSi β
M2)}i=0kβ1,π¦π«πΎπSβ,ΟΞ²,l(M2)}βRβ¨n,qβ©(k+1)β
lβ
(kβ²+1)
βΉ from
Β§B-6.1
Letβs use the following notations:
π¦π¦π²πΆSβ,ΟΞ²,l(M2) = CΒ― = (C0Β―,.C1Β―,Β β―Β CkΒ―)
CiΒ― = π¦π«πΎπSβ,ΟΞ²,l(βSi β
M2) for
0 β€i β€(k β1)
CkΒ― = π¦π«πΎπSβ,ΟΞ²,l(M2)
πΌπ = π¦π«πΆπ€Sβ,Ο(ΞM1) = (C0,C1,Β β―Β ,Ck) = (A0,A1,Β β―Β ,Akβ1,B)
Letβs define the following TFHE ciphertext multiplication operation:
πΌπ β
CΒ― = β β‘
i=0kβ¨π£πΎπΌπππΞ²,l(Ci),CiΒ―β©
Then, the following is true:
β¨SummaryΒ D-1.6.1β©
Generalization to GLWE-to-GGSW
Multiplication
πΌπ = π¦π«πΆπ€Sβ,Ο(ΞM1) = (A0,A1,β―,Akβ1,B)
CΒ― = π¦π¦π²πΆSβ,ΟΞ²,l(M2)
= (π¦π«πΎπSβ,ΟΞ²,l(βS0β
M2),π¦π«πΎπSβ,ΟΞ²,l(βS1β
M2),β―,π¦π«πΎπSβ,ΟΞ²,l(βSkβ1β
M2),π¦π«πΎπSβ,ΟΞ²,l(M2))
π¦π«πΆπ€Sβ,Ο(ΞM1) β
π¦π¦π²πΆSβ,ΟΞ²,l(M2) = β β‘
i=0kβ¨π£πΎπΌπππΞ²,l(Ci),CiΒ―β©βπ¦π«πΆπ€Sβ,Ο(ΞM1M2)
This means that multiplying two TFHE ciphertexts (one is in GLWE and another in GGSW) and
decrypting the resulting GLWE ciphertext gives the same result as multiplying their two original
plaintexts.
Proof.
-
1.
- β β‘
i=0kβ¨π£πΎπΌπππΞ²,l(Ci),CiΒ―β©
= β¨π£πΎπΌπππΞ²,l(A0),C0Β―β©+β¨π£πΎπΌπππΞ²,l(A1),C1Β―β©+Β β―Β +β¨π£πΎπΌπππΞ²,l(Akβ1),CΒ―kβ1β©+β¨π£πΎπΌπππΞ²,l(B),CkΒ―β©
βΉ
expanding the dot product of two vectors
-
2.
- For i = k:
π£πΎπΌπππΞ²,l(B) = (B1,B2,Β β―Β ,Bl),
where B = B1 q
Ξ²1 + B2 q
Ξ²2 + Β β―Β + Bl q
Ξ²l
βΉ
from Β§A-6.2
CΒ―k = π¦π«πΎπSβ,ΟΞ²,l(M2) = (π¦π«πΆπ€Sβ,Ο (M2 q
Ξ²1) ,π¦π«πΆπ€Sβ,Ο (M2 q
Ξ²2) ,Β β―Β ,π¦π«πΆπ€Sβ,Ο (M2 q
Ξ²l))
Therefore:
β¨π£πΎπΌπππΞ²,l(B),CkΒ―β©
= B1 β
π¦π«πΆπ€Sβ,Ο (M2 q
Ξ²1) + B2 β
π¦π«πΆπ€Sβ,Ο (M2 q
Ξ²2) + Β β―Β + Bl β
π¦π«πΆπ€Sβ,Ο (M2 q
Ξ²l)
= π¦π«πΆπ€Sβ,Ο (B1M2 q
Ξ²1) + π¦π«πΆπ€Sβ,Ο (B2M2 q
Ξ²2) + Β β―Β + π¦π«πΆπ€Sβ,Ο (BlM2 q
Ξ²l)
βΉ
from Β§C-3
= π¦π«πΆπ€Sβ,Ο (B1M2 q
Ξ²1 + B2M2 q
Ξ²2 + Β β―Β + BlM2 q
Ξ²l)
βΉ
from Β§C-1
= π¦π«πΆπ€Sβ,Ο (M2 β
(B1 q
Ξ²1 + B2 q
Ξ²2 + Β β―Β + Bl q
Ξ²l))
= π¦π«πΆπ€Sβ,Ο(M2B)
βΉ
from Β§A-6.2
-
3.
- For 0 β€i β€(k β1):
π£πΎπΌπππΞ²,l(Ai) = (Aβ¨i,1β©,Aβ¨i,2β©,Β β―Β ,Aβ¨i,lβ©),
where Ai = Aβ¨i,1β© q
Ξ²1 + Aβ¨i,2β© q
Ξ²2 + Β β―Β + Aβ¨i,lβ© q
Ξ²l
CiΒ― = π¦π«πΎπSβ,ΟΞ²,l(βSiM2) = (π¦π«πΆπ€Sβ,Ο (βSiM2 q
Ξ²1) ,π¦π«πΆπ€Sβ,Ο (βSiM2 q
Ξ²2) ,Β β―Β ,π¦π«πΆπ€Sβ,Ο (βSiM2 q
Ξ²l))
Therefore:
β¨π£πΎπΌπππΞ²,l(A0),C0Β―β©+ β¨π£πΎπΌπππΞ²,l(A1),C1Β―β©+ Β β―Β + β¨π£πΎπΌπππΞ²,l(Akβ1),CΒ―kβ1β©
= β β‘
i=0kβ1β¨π£πΎπΌπππΞ²,l(Ai),CiΒ―β©
= β β‘
i=0kβ1 (Aβ¨i,1β©β
π¦π«πΆπ€Sβ,Ο (βSiM2 q
Ξ²1) + Aβ¨i,2β©β
π¦π«πΆπ€Sβ,Ο (βSiM2 q
Ξ²2) + Β β―Β + Aβ¨i,lβ©β
π¦π«πΆπ€Sβ,Ο (βSiM2 q
Ξ²l))
= β β‘
i=0kβ1 (π¦π«πΆπ€Sβ,Ο (βAβ¨i,1β©SiM2 q
Ξ²1) + π¦π«πΆπ€Sβ,Ο (βAβ¨i,2β©SiM2 q
Ξ²2) + Β β―Β + π¦π«πΆπ€Sβ,Ο (βAβ¨i,lβ©SiM2 q
Ξ²l))
= β β‘
i=0kβ1π¦π«πΆπ€Sβ,Ο (βAβ¨i,1β©SiM2 q
Ξ²1 + βAβ¨i,2β©SiM2 q
Ξ²2 + Β β―Β + βAβ¨i,lβ©SiM2 q
Ξ²l)
= β β‘
i=0kβ1π¦π«πΆπ€Sβ,Ο (βSiM2 β
(Aβ¨i,1β© q
Ξ²1 + Aβ¨i,2β© q
Ξ²2 + Β β―Β + Aβ¨i,lβ© q
Ξ²l))
= β β‘
i=0kβ1π¦π«πΆπ€Sβ,Ο(βSiM2Ai)
-
4.
- According to step 2 and 3,
β β‘
i=0kβ¨π£πΎπΌπππΞ²,l(Ci),CiΒ―β©
= β β‘
i=0kβ1π¦π«πΆπ€Sβ,Ο(βSiM2Ai) + π¦π«πΆπ€Sβ,Ο(M2B)
= π¦π«πΆπ€Sβ,Ο( β β‘
i=0kβ1(βSiM2Ai) + M2B)
βΉ
addition of two GLWE ciphertexts
= π¦π«πΆπ€Sβ,Ο(BM2 ββ β‘
i=0kβ1M2AiSi)
= π¦π«πΆπ€Sβ,Ο(M2(B ββ β‘
i=0kβ1AiSi))
= π¦π«πΆπ€Sβ,Ο(M2(ΞM1 + E))
= π¦π«πΆπ€Sβ,Ο(ΞM1M2 + M2E)
βπ¦π«πΆπ€Sβ,Ο(ΞM1M2)
βΉ
given E
is small and thus M2E
is also small
β‘