Sparse-secret Ring-LWE in FHE: Is It Really Needed?
Ilia Iliashenko (joint work with Hao Chen, Kim Laine, Yongsoo Song)
Lattice Coding & Crypto Meeting, Royal Holloway 20 Nov
Sparse-secret Ring-LWE in FHE: Is It Really Needed? Ilia Iliashenko - - PowerPoint PPT Presentation
Sparse-secret Ring-LWE in FHE: Is It Really Needed? Ilia Iliashenko (joint work with Hao Chen, Kim Laine, Yongsoo Song) Lattice Coding & Crypto Meeting, Royal Holloway 20 Nov Learning with Errors (LWE) = + 02
Lattice Coding & Crypto Meeting, Royal Holloway 20 Nov
0ร2 is uniformly random, ๐ โ โค/ 0 and ๐ โ โค/ 0 is small.
Uniformly random ๐8 over 0,1 0. Uniformly random ๐< over โ1,0,1 0. Uniformly random ๐/ over โค/
0.
Discrete Gaussian ๐ / over โค/
0.
Uniformly random ๐8 over 0,1 0. Uniformly random ๐< over โ1,0,1 0. Uniformly random ๐/ over โค/
0.
Discrete Gaussian ๐ / over โค/
0.
Uniformly random ๐8 over 0,1 0. Uniformly random ๐< over โ1,0,1 0. Uniformly random ๐/ over โค/
0.
Discrete Gaussian ๐ / over โค/
0.
๐๐ ๐๐ ๐๐ โฆ ๐๐6๐ โ๐๐6๐ ๐๐ ๐๐ โฆ ๐๐6๐ โฆ
computation bootstrapping noise plaintext Bootstrapping performs decryption homomorphically.
Reference: Chen and Han, Eurocryptโ18
Reference: Cheon et al., Asiacryptโ17
computation Mult undecryptable noise plaintext
computation bootstrapping noise plaintext
bootstrapping plaintext is lost
bootstrapping plaintext is lost Bootstrappable Encryption Scheme Let ๐ทe be the set of circuits that ๐น can compactly and correctly evaluate. We say that ๐น is bootstrappable with the respect to gate ฮ if ๐ธ๐๐e ฮ โ ๐ทe. Correctness of Homomorphic Encryption HE scheme ๐น is correct for a circuit ๐ท if for any plaintexts ๐Z, โฆ , ๐k it holds: If ct = Evaluatee(๐ท, Enc ๐Z , โฆ , Enc ๐k ), then Dece ๐๐ข = ๐ท ๐Z, โฆ , ๐k .
bootstrapping plaintext is lost Bootstrappable Encryption Scheme Let ๐ทe be the set of circuits that ๐น can compactly and correctly evaluate. We say that ๐น is bootstrappable with the respect to gate ฮ if ๐ธ๐๐e ฮ โ ๐ทe. Correctness of Homomorphic Encryption HE scheme ๐น is correct for a circuit ๐ท if for any plaintexts ๐Z, โฆ , ๐k it holds: If ct = Evaluatee(๐ท, Enc ๐Z , โฆ , Enc ๐k ), then Dece ๐๐ข = ๐ท ๐Z, โฆ , ๐k .
Inverse DFT* *with primitive roots of unity
๐u ๐06Z โฆ
๐ must divide n/2
๐u ๐8{6Z โฆ ๐Z
๐u ๐0/8{ ๐(0/8{)(8{6Z) ๐ โฆ ๐0/8{
~
~ computation
DFT*
1/โ~ *with primitive roots of unity ๐u ๐06Z ๐u ๐06Z
๐u ๐06Z
๐u ๐06Z
๐u ๐06Z
๐u ๐06Z
Rotations by ๐๐ slots are automorphisms of ๐ fixing ๐~ = โค ๐
ล โนห /(๐, ๐0 + 1), ๐~ โ ๐.
๐ / secret key public key ๐/ ๐<(โ)
๐ / secret key public key ๐/ ๐<(โ)
Given a public key ๐๐ and an encoding ๐ โ ๐/ compute
๐ /
๐< ๐ /
๐ / secret key public key ๐/ ๐<(โ)
Given a public key ๐๐ and an encoding ๐ โ ๐/ compute
๐ /
๐< ๐ /
Given a secret key ๐ก and a ciphertext ๐๐ข = (๐u, ๐Z) compute
/ = ๐u + ๐Z โ ๐ก mod ๐ = ๐ + ๐ noise
๐๐ข โ ๐/
8
๐๐ขโฒ โ ๐/โ
8 , ๐โฒ > ๐
Plaintext Cleartext vector Ciphertext Input Output ๐ ๐
8{
= ๐๐ข ๐ก
/
๐๐ โฆ ๐๐6๐ โ ๐(๐
8{)
๐๐ โฆ ๐๐6๐
๐๐ข โ ๐/
8
๐๐ขโฒ โ ๐/โ
8 , ๐โฒ > ๐
Plaintext Cleartext vector Ciphertext Input Output ๐ ๐
8{
= ๐๐ข ๐ก โ ๐ฝ ๐ โ ๐ ๐๐ โฆ ๐๐6๐ ๐๐ โฆ ๐๐6๐ โ ๐(๐
8{)
๐๐ข โ ๐/
8
๐๐ขโฒ โ ๐/โ
8 , ๐โฒ > ๐
Plaintext Cleartext vector Ciphertext Input Output ModRaise ๐๐ข โ ๐ลกโบ
8 , ๐ u > ๐
๐ ๐
8{ + ๐ฝ ๐ โ ๐ ลกโบ
๐๐ โฆ ๐๐6๐ ๐๐ โฆ ๐๐6๐ ๐ ๐
8{
= ๐๐ข ๐ก โ ๐ฝ ๐ โ ๐ โ ๐(๐
8{)
๐๐ข โ ๐/
8
๐๐ขโฒ โ ๐/โ
8 , ๐โฒ > ๐
Plaintext Cleartext vector Ciphertext Input Output ModRaise ๐๐ข โ ๐ลกโบ
8 , ๐ u > ๐
SubSum ๐๐ขZ โ ๐ลกโข
8
โ ๐ ๐
8{ + ๐ฝ ๐ 8{ โ ๐ ลกโข
๐๐ โฆ ๐๐6๐ ๐๐ โฆ ๐๐6๐ โ ๐(๐
8{)
๐ ๐
8{ + ๐ฝ ๐ โ ๐ ลกโบ
๐ ๐
8{
= ๐๐ข ๐ก โ ๐ฝ ๐ โ ๐
๐๐ข โ ๐/
8
๐๐ขโฒ โ ๐/โ
8 , ๐โฒ > ๐
Plaintext Cleartext vector Ciphertext Input Output ModRaise ๐๐ข โ ๐ลกโบ
8 , ๐ u > ๐
SubSum ๐๐ขZ โ ๐ลกโข
8
โ ๐ข(๐
8{) ลกโข
๐๐ โฆ ๐๐6๐ ๐๐ โฆ ๐๐6๐ โ ๐(๐
8{)
๐ ๐
8{ + ๐ฝ ๐ โ ๐ ลกโบ
๐ ๐
8{
= ๐๐ข ๐ก โ ๐ฝ ๐ โ ๐
๐๐ข โ ๐/
8
๐๐ขโฒ โ ๐/โ
8 , ๐โฒ > ๐
Plaintext Cleartext vector Ciphertext Input Output ModRaise ๐๐ข โ ๐ลกโบ
8 , ๐ u > ๐
SubSum ๐๐ขZ โ ๐ลกโข
8
๐๐ข8 โ ๐ลกโน
8
๐๐ โฆ ๐๐๐6๐ CoefToSlot (inverse DFT) ๐๐ โฆ ๐๐6๐ ๐๐ โฆ ๐๐6๐ โ ๐(๐
8{)
๐ ๐
8{ + ๐ฝ ๐ โ ๐ ลกโบ
๐ ๐
8{
= ๐๐ข ๐ก โ ๐ฝ ๐ โ ๐ โ ๐ข(๐
8{) ลกโข
Plaintext Cleartext vector Ciphertext Input Output ModRaise SubSum ๐๐ขZ โ ๐ลกโข
8
๐๐ข8 โ ๐ลกโน
8
Mod ๐ ๐๐ข< โ ๐ลกลธ
8
๐๐ โฆ ๐๐๐6๐ CoefToSlot (inverse DFT) ๐๐ โฆ ๐๐6๐ ๐๐ โฆ ๐๐6๐ โ ๐(๐
8{)
โ ๐ข(๐
8{) ลกโข
๐๐ โฆ ๐๐๐6๐ ๐๐ข โ ๐/
8
๐๐ขโฒ โ ๐/โ
8 , ๐โฒ > ๐
๐๐ข โ ๐ลกโบ
8 , ๐ u > ๐
๐ ๐
8{ + ๐ฝ ๐ โ ๐ ลกโบ
๐ ๐
8{
= ๐๐ข ๐ก โ ๐ฝ ๐ โ ๐
Plaintext Cleartext vector Ciphertext Input Output ModRaise SubSum ๐๐ขZ โ ๐ลกโข
8
๐๐ข8 โ ๐ลกโน
8
๐๐ข< โ ๐ลกลธ
8
๐๐ข โ ๐ลกยก
8
โ ๐(๐
8{) ลกยก
CoefToSlot (inverse DFT) SlotToCoef (DFT) ๐๐ โฆ ๐๐6๐ ๐๐ โฆ ๐๐6๐ โ ๐(๐
8{)
โ ๐ข(๐
8{) ลกโข
๐๐ โฆ ๐๐๐6๐ ๐๐ โฆ ๐๐๐6๐ ๐๐ข โ ๐/
8
๐๐ขโฒ โ ๐/โ
8 , ๐โฒ > ๐
๐๐ข โ ๐ลกโบ
8 , ๐ u > ๐
๐ ๐
8{ + ๐ฝ ๐ โ ๐ ลกโบ
๐ ๐
8{
= ๐๐ข ๐ก โ ๐ฝ ๐ โ ๐ Mod ๐
๐๐ข~ โ ๐/โ
8 , ๐โฒ = ๐
Plaintext Cleartext vector Ciphertext Input Output ModRaise SubSum ๐๐ขZ โ ๐ลกโข
8
CoefToSlot (inverse DFT) ๐๐ข8 โ ๐ลกโน
8
๐๐ข< โ ๐ลกลธ
8
SlotToCoef (DFT) ๐๐ข โ ๐ลกยก
8
๐๐ โฆ ๐๐6๐ ๐๐ โฆ ๐๐6๐ โ ๐(๐
8{)
๐๐ โฆ ๐๐๐6๐ โ ๐ข(๐
8{) ลกโข
๐๐ โฆ ๐๐๐6๐ โ ๐(๐
8{) ลกยก
๐๐ข โ ๐/
8
๐๐ข โ ๐ลกโบ
8 , ๐ u > ๐
๐ ๐
8{ + ๐ฝ ๐ โ ๐ ลกโบ
๐ ๐
8{
= ๐๐ข ๐ก โ ๐ฝ ๐ โ ๐ Mod ๐
8{ + ๐ฝ ๐ โ ๐ ลกโบ
8{ + ๐ฝ ๐ 8{ โ ๐ ลกโข
ยคยฅu 8{6Z
done homomorphically
done homomorphically
done homomorphically
done homomorphically
๐ยคโs are sparser than ๐.
The columns of ๐ดยคโs need to be encoded into the plaintext space.
done homomorphically
done homomorphically
๐ยคโs are sparser than ๐.
The columns of ๐ดยคโs need to be encoded into the plaintext space. CoefToSlot ๐๐ขZ โ ๐ลกโข
8
SlotToCoef ๐๐ข< โ ๐ลกลธ
8
Since ๐ Z > ๐ <, homomorphic operations in CoefToSlot are heavier than those of SlotToCoeff. Thus, use more FFT in CoefToSlot (๐ > ๐โฒ).
done homomorphically
done homomorphically
ลกโบ = ๐ ๐ 8{ + ๐ฝ ๐ โ ๐,
ลกโบ = ๐ ๐ 8{ + ๐ฝ ๐ โ ๐,
ยฑ < ๐ฟ
ลกโบ = ๐ ๐ 8{ + ๐ฝ ๐ โ ๐,
ยฑ < ๐ฟ โค 1 + ๐ฅ๐ข(๐ก)/2
ลกโบ = ๐ ๐ 8{ + ๐ฝ ๐ โ ๐,
ยฑ < ๐ฟ โค 1 + ๐ฅ๐ข(๐ก)/2 ๐ฆ / โ ๐ 2๐ sin 2๐๐ฆ ๐ , ๐ฆ โ โ๐ฟ๐, ๐ฟ๐
ลกโบ = ๐ ๐ 8{ + ๐ฝ ๐ โ ๐,
ยฑ < ๐ฟ โค 1 + ๐ฅ๐ข(๐ก)/2 ๐ฆ / โ ๐ 2๐ sin 2๐๐ฆ ๐ = ๐ 2๐ cos 2๐๐ฆ ๐ โ ๐ 2 , ๐ฆ โ โ๐ฟ๐, ๐ฟ๐
Taylor + double-angle formula for sine
Chebyshev
Hermite + Chebyshev nodes + double-angle formula for cosine
Taylor + double-angle formula for sine
Chebyshev
Hermite + Chebyshev nodes + double-angle formula for cosine
Taylor + double-angle formula for sine
Chebyshev
Hermite + Chebyshev nodes + double-angle formula for cosine
๐ = 2048 max ๐ฟ = 57 ๐ = 4096 max ๐ฟ = 90 ๐ = 8192 max ๐ฟ = 125
๐ = 16384 max ๐ฟ = 177 ๐ = 32768 max ๐ฟ = 255 ๐ = 65536 max ๐ฟ = 360
๐ = 16384 max ๐ฟ = 177 ๐ = 32768 max ๐ฟ = 255 ๐ = 65536 max ๐ฟ = 360
deg ๐ฟ deg โ 7๐ฟ + 25
deg ๐ฟ deg โ 7๐ฟ + 25 Using Paterson-Stockmeyer such approximation require:
2 7๐ฟ + 25 + log8(2 7๐ฟ + 25 ) multiplications
deg ๐ฟ deg โ 7๐ฟ + 25 Using Paterson-Stockmeyer such approximation require:
2 7๐ฟ + 25 + log8(2 7๐ฟ + 25 ) multiplications
Example: ๐ = 65536 โ ๐ฟ = 360:
1. Take a sufficiently large ๐ฟ = 2k.
1. Take a sufficiently large ๐ฟ = 2k. 2. Approximate cos 2๐๐ฆ โ
ร 8ร in the range [โ๐, ๐] (e.g using Chebyshev).
1. Take a sufficiently large ๐ฟ = 2k. 2. Approximate cos 2๐๐ฆ โ
ร 8ร in the range [โ๐, ๐] (e.g using Chebyshev).
3. Compute ๐ iterations of the double-angle formula.
1. Take a sufficiently large ๐ฟ = 2k. 2. Approximate cos 2๐๐ฆ โ
ร 8ร in the range [โ๐, ๐] (e.g using Chebyshev).
3. Compute ๐ iterations of the double-angle formula.
๐ = 65536 โ ๐ฟ = 2ร
1. Take a sufficiently large ๐ฟ = 2k. 2. Approximate cos 2๐๐ฆ โ
ร 8ร in the range [โ๐, ๐] (e.g using Chebyshev).
3. Compute ๐ iterations of the double-angle formula.
๐ = 65536 โ ๐ฟ = 2ร: cos 2๐๐ฆ โ ๐ 2๐ฟ โ ๐ ๐ , deg ๐ ๐ = 26
1. Take a sufficiently large ๐ฟ = 2k. 2. Approximate cos 2๐๐ฆ โ
ร 8ร in the range [โ๐, ๐] (e.g using Chebyshev).
3. Compute ๐ iterations of the double-angle formula.
๐ = 65536 โ ๐ฟ = 2ร: cos 2๐๐ฆ โ ๐ 2๐ฟ โ ๐ ๐ , deg ๐ ๐ = 26 9 iterations of the double-angle formula
1. Take a sufficiently large ๐ฟ = 2k. 2. Approximate cos 2๐๐ฆ โ
ร 8ร in the range [โ๐, ๐] (e.g using Chebyshev).
3. Compute ๐ iterations of the double-angle formula.
๐ = 65536 โ ๐ฟ = 2ร: cos 2๐๐ฆ โ ๐ 2๐ฟ โ ๐ ๐ , deg ๐ ๐ = 26 9 iterations of the double-angle formula Total cost:
# slots CtoS levels StoC levels After levels
sec
msec 4096 2 2 9 179 44 3 2 8 114 28 8192 3 2 8 204 25 4 2 7 121 15 16384 4 3 6 181 11 5 3 5 159 10 ๐ = 65536, ฮ = 2โu, ๐ โ 2รu, ๐ = 128 bits Input data: z โ โ, |Re ๐จ |, |Im(๐จ)| < 16. Number of experiments per parameter set: 100 Precision before bootstrapping: โ 33 bits Precision after bootstrapping: โ 8 bits
๐ = 65536, ฮ = 2โu, ๐ โ 2รu, ๐ = 128 bits Input data: z โ โ, |Re ๐จ |, |Im(๐จ)| < 16. Number of experiments per parameter set: 100 Precision before bootstrapping: โ 33 bits Precision after bootstrapping: โ 8 bits Memory consumption: ~47GB (mostly due to key-switching keys) # slots CtoS levels StoC levels After levels
sec
msec 4096 2 2 9 179 44 3 2 8 114 28 8192 3 2 8 204 25 4 2 7 121 15 16384 4 3 6 181 11 5 3 5 159 10
slots 1024 16384 Total time, sec After precision, bits After levels HK19 HK19 Ours Ours