P OLYNOMIAL PLAINTEXT MODULUS [CLPX18] Replace t by X b : = Z / b n - - PowerPoint PPT Presentation

p olynomial plaintext modulus clpx18
SMART_READER_LITE
LIVE PREVIEW

P OLYNOMIAL PLAINTEXT MODULUS [CLPX18] Replace t by X b : = Z / b n - - PowerPoint PPT Presentation

E FFICIENTLY PROCESSING COMPLEX - VALUED DATA IN HOMOMORPHIC ENCRYPTION C. Bootland, W. Castryck, I. Iliashenko and F . Vercauteren M ATHCRYPT 2018, A UG 19, 2018 H OMOMORPHIC ENCRYPTION ct ( msg 1 ) ct ( msg 2 ) = ct ( msg 1 msg 2 )


slide-1
SLIDE 1

EFFICIENTLY PROCESSING

COMPLEX-VALUED DATA IN HOMOMORPHIC ENCRYPTION

  • C. Bootland, W. Castryck, I. Iliashenko and F

. Vercauteren

MATHCRYPT 2018, AUG 19, 2018

slide-2
SLIDE 2

HOMOMORPHIC ENCRYPTION

ct(msg1) ⋆ ct(msg2) = ct(msg1 ∗ msg2)

1/18

slide-3
SLIDE 3

HOMOMORPHIC ENCRYPTION

ct(msg1) ⋆ ct(msg2) = ct(msg1 ∗ msg2) Most schemes (BGV, Bra − FV, HEAAN) are defined over Rq = Z[X]/ q, Xn + 1 . and based on

Decision Ring-LWE

Sample a

$

← − Rq, secret s ← χk and noise e ← χe. Compute b = a · s + e. Distinguish (b, a) ∈ R2

q from a uniformly random pair.

1/18

slide-4
SLIDE 4

HOMOMORPHIC ENCRYPTION

General approach: Encrypt(msg ∈ P ⊆ Rq) : ct = (msg, 0) + (b, a) Evaluate(ct, . . . ) = ct′ Decrypt(ct′ ∈ R2

q) : ct′[0] − ct′[1] · s = msg′ + e′ → msg′

e′ < B, where B depends on P.

2/18

slide-5
SLIDE 5

HOMOMORPHIC ENCRYPTION

General approach: Encrypt(msg ∈ P ⊆ Rq) : ct = (msg, 0) + (b, a) Evaluate(ct, . . . ) = ct′ Decrypt(ct′ ∈ R2

q) : ct′[0] − ct′[1] · s = msg′ + e′ → msg′

e′ < B, where B depends on P.

Typical choice: Ciphertext: Rq = Z[X]/ q, Xn + 1 with q ≃ poly(n) Plaintext: Rt = Z[X]/ t, Xn + 1 for some t ≥ 2 and t ≪ q

Coefficient representatives are taken in [q/2, q/2) and [t/2, t/2), respectively.

2/18

slide-6
SLIDE 6

DATA ENCODING

Z → Rt (Bra − FV, BGV):

a [a]t

0 . . . 0

– Bijective as long as |a| < t/2.

3/18

slide-7
SLIDE 7

DATA ENCODING

Z → Rt (Bra − FV, BGV):

a [a]t

0 . . . 0

– Bijective as long as |a| < t/2.

Q → Rt (Bra − FV, BGV):

ai . . . a0 a–1 . . . a–f

  • frac. part
  • int. part

[ai]t . . . [a0]t [–a–1]t . . . [–a–f]t 0 . . .

– Bijective as long as plaintext coefficients < t/2 and i + f < n.

3/18

slide-8
SLIDE 8

DATA ENCODING

Z → Rt (Bra − FV, BGV):

a [a]t

0 . . . 0

– Bijective as long as |a| < t/2.

Q → Rt (Bra − FV, BGV):

ai . . . a0 a–1 . . . a–f

  • frac. part
  • int. part

[ai]t . . . [a0]t [–a–1]t . . . [–a–f]t 0 . . .

– Bijective as long as plaintext coefficients < t/2 and i + f < n.

Cn/2 → R (HEAAN): (a1, . . . , an/2) →

  • FFT −1(a1, . . . , an/2, an/2, . . . , a1)∗

* with primitive roots of unity and scaling

– Introduces approximation error.

3/18

slide-9
SLIDE 9

POLYNOMIAL PLAINTEXT MODULUS [CLPX18]

Replace t by X − b: RX−b = R/ X − b ∼ = Z/ bn + 1 .

4/18

slide-10
SLIDE 10

POLYNOMIAL PLAINTEXT MODULUS [CLPX18]

Replace t by X − b: RX−b = R/ X − b ∼ = Z/ bn + 1 . Encoding: Z → RX−b : a → small a(x) ≡ a mod (X − b)

4/18

slide-11
SLIDE 11

POLYNOMIAL PLAINTEXT MODULUS [CLPX18]

Replace t by X − b: RX−b = R/ X − b ∼ = Z/ bn + 1 . Encoding: Z → RX−b : a → small a(x) ≡ a mod (X − b) + Bijective as long as |a| ≤ (bn + 1)/2 (often exponential!). + Noise depends on b (can be just 2!). – Not applicable to BGV: qi’s must be in Θ(bn + 1).

4/18

slide-12
SLIDE 12

GOING FURTHER: ARBITRARY PLAINTEXT MODULUS?

Rg(X) = R/ g(X) ∼ =???

5/18

slide-13
SLIDE 13

GOING FURTHER: ARBITRARY PLAINTEXT MODULUS?

Rg(X) = R/ g(X) ∼ =??? If g(X) = X2 + b, Rg(X) ∼ = Z[X]/

  • bn/2 + 1, X2 + b
  • .

5/18

slide-14
SLIDE 14

GOING FURTHER: ARBITRARY PLAINTEXT MODULUS?

Rg(X) = R/ g(X) ∼ =??? If g(X) = X2 + b, Rg(X) ∼ = Z[X]/

  • bn/2 + 1, X2 + b
  • .

Moreover, if b ≡ α2 mod (bn/2 + 1), the map i → α−1 · X defines an isomorphism Rg(X) ∼ = Z[i]/

  • bn/2 + 1
  • .

5/18

slide-15
SLIDE 15

GOING FURTHER: ARBITRARY PLAINTEXT MODULUS?

Rg(X) = R/ g(X) ∼ =??? If g(X) = X2 + b, Rg(X) ∼ = Z[X]/

  • bn/2 + 1, X2 + b
  • .

Moreover, if b ≡ α2 mod (bn/2 + 1), the map i → α−1 · X defines an isomorphism Rg(X) ∼ = Z[i]/

  • bn/2 + 1
  • .

We can encode big Gaussian integers!

5/18

slide-16
SLIDE 16

GENERALIZATION TO CYCLOTOMIC INTEGERS

Use g(X) = Xm + b with b ≡ αm mod (bn/m + 1), then Z[ζ2m]/

  • bn/m + 1

= RXm+b.

6/18

slide-17
SLIDE 17

GENERALIZATION TO CYCLOTOMIC INTEGERS

Use g(X) = Xm + b with b ≡ αm mod (bn/m + 1), then Z[ζ2m]/

  • bn/m + 1

= RXm+b. Encoding:

  • 1. Encode 2m-th roots of unity:
  • i<m

ai · ζi

2m → i<m

ai · α−i · Xi

6/18

slide-18
SLIDE 18

GENERALIZATION TO CYCLOTOMIC INTEGERS

Use g(X) = Xm + b with b ≡ αm mod (bn/m + 1), then Z[ζ2m]/

  • bn/m + 1

= RXm+b. Encoding:

  • 1. Encode 2m-th roots of unity:
  • i<m

ai · ζi

2m → i<m

ai · α−i · Xi

  • 2. Expand coefficients in base b:
  • i<m

ai · α−iXi →

i<m

  • j<n/m

cijbjXi

6/18

slide-19
SLIDE 19

GENERALIZATION TO CYCLOTOMIC INTEGERS

Use g(X) = Xm + b with b ≡ αm mod (bn/m + 1), then Z[ζ2m]/

  • bn/m + 1

= RXm+b. Encoding:

  • 1. Encode 2m-th roots of unity:
  • i<m

ai · ζi

2m → i<m

ai · α−i · Xi

  • 2. Expand coefficients in base b:
  • i<m

ai · α−iXi →

i<m

  • j<n/m

cijbjXi

  • 3. Use b ≡ −Xm mod (Xm + b)
  • i
  • j cijbjXi →

i

  • j

cij(−X)mjXi

6/18

slide-20
SLIDE 20

GENERALIZATION TO CYCLOTOMIC INTEGERS

Use g(X) = Xm + b with b ≡ αm mod (bn/m + 1), then Z[ζ2m]/

  • bn/m + 1

= RXm+b. Encoding:

  • 1. Encode 2m-th roots of unity:
  • i<m

ai · ζi

2m → i<m

ai · α−i · Xi

  • 2. Expand coefficients in base b:
  • i<m

ai · α−iXi →

i<m

  • j<n/m

cijbjXi

  • 3. Use b ≡ −Xm mod (Xm + b)
  • i
  • j cijbjXi →

i

  • j

cij(−X)mjXi As a result, |cij| ≤ ⌊(b + 1)/2⌋.

6/18

slide-21
SLIDE 21

GENERALIZATION TO CYCLOTOMIC INTEGERS

Decoding:

  • 1. Reduction modulo Xm + b
  • i<n

ciXi →

i<n

ciXi mod (Xm + b)

7/18

slide-22
SLIDE 22

GENERALIZATION TO CYCLOTOMIC INTEGERS

Decoding:

  • 1. Reduction modulo Xm + b
  • i<n

ciXi →

i<n

ciXi mod (Xm + b)

  • 2. Decode 2m-th roots of unity:
  • i<m

c′

iXi → i<m

c′

iαiζi 2m

7/18

slide-23
SLIDE 23

GENERALIZATION TO CYCLOTOMIC INTEGERS

Decoding:

  • 1. Reduction modulo Xm + b
  • i<n

ciXi →

i<n

ciXi mod (Xm + b)

  • 2. Decode 2m-th roots of unity:
  • i<m

c′

iXi → i<m

c′

iαiζi 2m

  • 3. Take a representative of c′

iαi in

  • bn/m/2
  • ,
  • bn/m/2
  • 7/18
slide-24
SLIDE 24

HOW TO CHOOSE b?

If b = 2m/2, then α ≡ bn/4m(bn/2m − 1) mod (bn/m + 1).

8/18

slide-25
SLIDE 25

HOW TO CHOOSE b?

If b = 2m/2, then α ≡ bn/4m(bn/2m − 1) mod (bn/m + 1). If an odd b satisfies b ≡ αm mod (bn/m + 1), then b ≡ ±1 mod 4m.

8/18

slide-26
SLIDE 26

HOW TO CHOOSE b?

If b = 2m/2, then α ≡ bn/4m(bn/2m − 1) mod (bn/m + 1). If an odd b satisfies b ≡ αm mod (bn/m + 1), then b ≡ ±1 mod 4m.

Finding b requires factorization of generalized Fermat numbers.

8/18

slide-27
SLIDE 27

HOW TO ENCODE ARBITRARY COMPLEX NUMBERS?

Z[ζ2m] → RXm+b

9/18

slide-28
SLIDE 28

HOW TO ENCODE ARBITRARY COMPLEX NUMBERS?

C ? − → Z[ζ2m] → RXm+b

9/18

slide-29
SLIDE 29

HOW TO ENCODE ARBITRARY COMPLEX NUMBERS?

C ? − → Z[ζ2m] → RXm+b Fractional encoding [CLPX18]

approximates C → P + i · P, where P ⊂ Q encodes elements of P to Zbn/2+1 (i.e. m = 2)

Integer coefficient approximation [CSV17]

solves a CVP instance in the lattice Z[ζ2m]

9/18

slide-30
SLIDE 30

FRACTIONAL ENCODING

Encoding

  • 1. Choose P =
  • c +

d bn/4

  • ⊂ Q with c, d ∈ Z

|c| , |d| ≤ bn/4−1

2

, for even b |c| ≤ (bn/4−1−1)b

2(b−1)

; |d| ≤ (bn/4−1)b

2(b−1) , for odd b 10/18

slide-31
SLIDE 31

FRACTIONAL ENCODING

Encoding

  • 1. Choose P =
  • c +

d bn/4

  • ⊂ Q with c, d ∈ Z

|c| , |d| ≤ bn/4−1

2

, for even b |c| ≤ (bn/4−1−1)b

2(b−1)

; |d| ≤ (bn/4−1)b

2(b−1) , for odd b

  • 2. Approximate z ∈ C to some x0

y0 + i · x1 y1 with x0 y0 , x1 y1 ∈ P.

10/18

slide-32
SLIDE 32

FRACTIONAL ENCODING

Encoding

  • 1. Choose P =
  • c +

d bn/4

  • ⊂ Q with c, d ∈ Z

|c| , |d| ≤ bn/4−1

2

, for even b |c| ≤ (bn/4−1−1)b

2(b−1)

; |d| ≤ (bn/4−1)b

2(b−1) , for odd b

  • 2. Approximate z ∈ C to some x0

y0 + i · x1 y1 with x0 y0 , x1 y1 ∈ P.

  • 3. Encode

x0 y0 +i · x1 y1 → x0 y0

  • bn/2+1

+i · x1 y1

  • bn/2+1

∈ Z[i]/

  • bn/2 + 1
  • .

10/18

slide-33
SLIDE 33

FRACTIONAL ENCODING

Encoding

  • 1. Choose P =
  • c +

d bn/4

  • ⊂ Q with c, d ∈ Z

|c| , |d| ≤ bn/4−1

2

, for even b |c| ≤ (bn/4−1−1)b

2(b−1)

; |d| ≤ (bn/4−1)b

2(b−1) , for odd b

  • 2. Approximate z ∈ C to some x0

y0 + i · x1 y1 with x0 y0 , x1 y1 ∈ P.

  • 3. Encode

x0 y0 +i · x1 y1 → x0 y0

  • bn/2+1

+i · x1 y1

  • bn/2+1

∈ Z[i]/

  • bn/2 + 1
  • .

Decoding x + i · y →          [x·bn/4]bn/2+1+i·[y·bn/4]bn/2+1

bn/4

, for odd b [x·bn/4−1]bn/2+1+i·[y·bn/4−1]bn/2+1

bn/4−1

, for even b

10/18

slide-34
SLIDE 34

INTEGER COEFFICIENT APPROXIMATION

Encoding

  • 1. For a given z ∈ C, choose constants C, T > 0 and compute

ai = ⌈ℜ(Cζi

2m)⌋, bi = ⌈ℑ(Cζi 2m)⌋

11/18

slide-35
SLIDE 35

INTEGER COEFFICIENT APPROXIMATION

Encoding

  • 1. For a given z ∈ C, choose constants C, T > 0 and compute

ai = ⌈ℜ(Cζi

2m)⌋, bi = ⌈ℑ(Cζi 2m)⌋

  • 2. Solve:

SVP in the lattice given by

     a0 b0 Im . . . . . . . . . am−1 bm−1 . . . ⌈ℜ(Cz)⌋ ⌈ℑ(Cz)⌋ T      OR

CVP in the lattice given by

   a0 b0 Im . . . . . . am−1 bm−1   

with a target vector:

(0, . . . , 0, ⌈ℜ(Cz)⌋, ⌈ℑ(Cz)⌋)

11/18

slide-36
SLIDE 36

INTEGER COEFFICIENT APPROXIMATION

Encoding

  • 1. For a given z ∈ C, choose constants C, T > 0 and compute

ai = ⌈ℜ(Cζi

2m)⌋, bi = ⌈ℑ(Cζi 2m)⌋

  • 2. Solve:

SVP in the lattice given by

     a0 b0 Im . . . . . . . . . am−1 bm−1 . . . ⌈ℜ(Cz)⌋ ⌈ℑ(Cz)⌋ T      OR

CVP in the lattice given by

   a0 b0 Im . . . . . . am−1 bm−1   

with a target vector:

(0, . . . , 0, ⌈ℜ(Cz)⌋, ⌈ℑ(Cz)⌋)

  • 3. Use a SVP solution ±(z0, . . . , zm−1, . . . , −T) or a CVP solution

(z0, . . . , zm−1, ziai, zibi) and output

m−1

  • i=1

ziζi

2m ≃ z.

11/18

slide-37
SLIDE 37

BACK TO HE

C → Z[ζ2m] → RXm+b

12/18

slide-38
SLIDE 38

BACK TO HE

C → Z[ζ2m] → RXm+b

?

− → Rq

12/18

slide-39
SLIDE 39

ADAPTING THE BRA-FV SCHEME

Parameters

∆ = q

t

  • the decomposition base w, the error distribution χe and the key

distribution χk

KeyGen()

sk = (1, s) with s ← χk pk = ([−(as + e)]q , a) with a

$

← − Rq, e ← χe

evk = {([−(ais + ei)]q + wis2, ai)}i for ai

$

← − Rq, ei ← χe.

Encrypt (msg ∈ Rt)

u ← χk, e0, e1 ← χe ct =

  • [∆ · msg + u · pk[0] + e0]q , [u · pk[1] + e1]q
  • Decrypt
  • ct ∈ R2

q

  • t

q · [ct[0] + ct[1] · s]q

  • t = msg′

13/18

slide-40
SLIDE 40

ADAPTING THE BRA-FV SCHEME

Parameters

∆b =

  • q

Xm+b

mod (Xn + 1)

  • =

q bn/m+1 n/m

  • i=1

(−b)i−1Xn−im

  • the decomposition base w, the error distribution χe and the key

distribution χk

KeyGen()

sk = (1, s) with s ← χk pk = ([−(as + e)]q , a) with a

$

← − Rq, e ← χe

evk = {([−(ais + ei)]q + wis2, ai)}i for ai

$

← − Rq, ei ← χe.

Encrypt (msg ∈ RXm+b)

u ← χk, e0, e1 ← χe ct =

  • [∆b · msg + u · pk[0] + e0]q , [u · pk[1] + e1]q
  • Decrypt
  • ct ∈ R2

q

  • Xm+b

q

· [ct[0] + ct[1] · s]q

  • Xm+b = msg′

13/18

slide-41
SLIDE 41

NOISE GROWTH

Fresh encryption vMulcan ≤ t q √ 3n 2 tn + σ

  • 32
  • 2/3n + 6√n
  • After multiplication (of ciphertexts with noise v1, v2)

vMulcan ≤ t

3n + 8 √ 2 3 n

  • v1can + v2can

+ 3 v1can v2can + t q

3n + 8 √ 2 3 n + 8 √ 3(ℓ + 1)σwn + 40 3 √ 3n√n

  • .

14/18

slide-42
SLIDE 42

NOISE GROWTH

Fresh encryption vMulcan ≤ b + 1 q √ 3n 2 bn + σ

  • 32
  • 2/3n + 6√n
  • After multiplication (of ciphertexts with noise v1, v2)

vMulcan ≤ (b + 1)

3n + 8 √ 2 3 n

  • v1can + v2can

+ 3 v1can v2can + b + 1 q

3n + 8 √ 2 3 n + 8 √ 3(ℓ + 1)σwn + 40 3 √ 3n√n

  • .

14/18

slide-43
SLIDE 43

NOISE GROWTH

Fresh encryption vMulcan ≤ b + 1 q √ 3n 2 bn + σ

  • 32
  • 2/3n + 6√n
  • After multiplication (of ciphertexts with noise v1, v2)

vMulcan ≤ (b + 1)

3n + 8 √ 2 3 n

  • v1can + v2can

+ 3 v1can v2can + b + 1 q

3n + 8 √ 2 3 n + 8 √ 3(ℓ + 1)σwn + 40 3 √ 3n√n

  • .

In practice, b ≪ t!

14/18

slide-44
SLIDE 44

BENCHMARK ENVIRONMENT

Regular circuits consisting of the following levels: . . . + + + . . . . . . + + + × next level A additional levels input with 16 bit precision

15/18

slide-45
SLIDE 45

REGULAR CIRCUIT DEPTH

n 4096 8192 16384 32768 log q 116 226 435 889 U A 3 10 3 10 3 10 3 10 232 DO 1 1 1 1 1 1 2 2 2 DM 5 5 4 9 9 7 12 11 10 14 14 13 DI 5 5 4 8 8 7 11 10 10 13 13 12 DF 5 5 4 9 8 7 11 10 10 13 13 12 264 DO — — — 1 1 1 2 1 1 DM 5 5 4 8 8 7 11 11 10 13 13 12 DI 5 4 4 8 7 7 10 10 9 12 12 12 DF 5 5 4 8 8 7 10 10 9 12 12 12

Real and imaginary parts of input data are bounded by U. DO: original Bra − FV with integer coefficient approximation in Z[ζ8]. DM: Bra − FV with t = X − b and separately encrypted real and imaginary parts of complex input. Needs twice more memory and additional operations! DI: ComFV with integer coefficient approximation in Z[ζ8]. DF : ComFV with fractional encoding.

16/18

slide-46
SLIDE 46

REGULAR CIRCUIT DEPTH

log q n 116 4096 input range (−232, 232)

14

Bra − FVI ComFVI ComFVF Bra − FVM 226 8192 435 16384 889 32768 (−264, 264)

13

3 10 Additive levels 3 10 3 10 3 10 Bra − FV with RX−b and separately encrypted real and imaginary parts (Bra − FVM). Needs twice more memory and additional operations! Bra − FV with integer coefficient approximation (Bra − FVI). ComFV with integer coefficient approximation (ComFVI). ComFV with fractional encoding (ComFVF ).

17/18

slide-47
SLIDE 47

CONCLUSION

+ New encoding method of complex numbers for FHE/SHE schemes. + New plaintext space allowing to encode big complex numbers. + Much slower noise growth in comparison to existing native Bra − FV encodings of complex numbers. + Almost the same depth but smaller memory usage and faster complex number operations in comparison to "High-Precision" method [CLPX18].

18/18

slide-48
SLIDE 48

CONCLUSION

+ New encoding method of complex numbers for FHE/SHE schemes. + New plaintext space allowing to encode big complex numbers. + Much slower noise growth in comparison to existing native Bra − FV encodings of complex numbers. + Almost the same depth but smaller memory usage and faster complex number operations in comparison to "High-Precision" method [CLPX18].

  • Hard to find an optimal b.
  • Limited packing functionality.

18/18

slide-49
SLIDE 49

CONCLUSION

+ New encoding method of complex numbers for FHE/SHE schemes. + New plaintext space allowing to encode big complex numbers. + Much slower noise growth in comparison to existing native Bra − FV encodings of complex numbers. + Almost the same depth but smaller memory usage and faster complex number operations in comparison to "High-Precision" method [CLPX18].

  • Hard to find an optimal b.
  • Limited packing functionality.

? Better methods to approximate complex numbers by cyclotomic integers. ? Polynomial ciphertext modulus

18/18

slide-50
SLIDE 50

THANK YOU. QUESTIONS?