An Efficient and Parallel Gaussian Sampler for Lattices Chris - - PowerPoint PPT Presentation

an efficient and parallel gaussian sampler for lattices
SMART_READER_LITE
LIVE PREVIEW

An Efficient and Parallel Gaussian Sampler for Lattices Chris - - PowerPoint PPT Presentation

An Efficient and Parallel Gaussian Sampler for Lattices Chris Peikert Georgia Tech CRYPTO 2010 1 / 10 Lattice-Based Crypto L R n b 2 b 1 2 / 10 Lattice-Based Crypto L R n p 1 p 2 2 / 10 Lattice-Based Crypto L R n b 2 p 1 b 1 =


slide-1
SLIDE 1

An Efficient and Parallel Gaussian Sampler for Lattices Chris Peikert

Georgia Tech CRYPTO 2010

1 / 10

slide-2
SLIDE 2

Lattice-Based Crypto

L ⊂ Rn

b1 b2 2 / 10

slide-3
SLIDE 3

Lattice-Based Crypto

L ⊂ Rn

p1 p2 2 / 10

slide-4
SLIDE 4

Lattice-Based Crypto

L ⊂ Rn

b1 b2 p1 p2

= ⇒

(Images courtesy xkcd.org) 2 / 10

slide-5
SLIDE 5

Lattice-Based Crypto

L ⊂ Rn

b1 b2 p1 p2

= ⇒

(Images courtesy xkcd.org)

✔ Asymptotically efficient & highly parallelizable

2 / 10

slide-6
SLIDE 6

Lattice-Based Crypto

L ⊂ Rn

b1 b2 p1 p2

= ⇒

(Images courtesy xkcd.org)

✔ Asymptotically efficient & highly parallelizable ✔ Worst-case assumptions (& quantum-resistant?)

[Ajtai’96,. . . ]

2 / 10

slide-7
SLIDE 7

Lattice-Based Crypto

L ⊂ Rn

b1 b2 p1 p2

= ⇒

(Images courtesy xkcd.org)

✔ Asymptotically efficient & highly parallelizable ✔ Worst-case assumptions (& quantum-resistant?)

[Ajtai’96,. . . ]

✔ Many rich applications:

⋆ ‘Hash-and-sign’ signatures

[GPV’08, CHKP’10, R’10, B’10]

⋆ (Hierarchical) IBE

[GPV’08, CHKP’10, ABB’10a, ABB’10b]

⋆ Fully homomorphic encryption

[G’09, SV’10, vDGHV’10]

2 / 10

slide-8
SLIDE 8

Gaussian Sampling on Lattices

◮ Given ‘good’ basis B and center c, sample discrete Gaussian on L

c b1 b2

[B’93,R’03,AR’04,MR’04,. . . ]

3 / 10

slide-9
SLIDE 9

Gaussian Sampling on Lattices

◮ Given ‘good’ basis B and center c, sample discrete Gaussian on L

⋆ ‘Zero-knowledge’ operation: leaks no information about B [GPV’08] c b1 b2

[B’93,R’03,AR’04,MR’04,. . . ]

3 / 10

slide-10
SLIDE 10

Gaussian Sampling on Lattices

◮ Given ‘good’ basis B and center c, sample discrete Gaussian on L

⋆ ‘Zero-knowledge’ operation: leaks no information about B [GPV’08] c b1 b2

[B’93,R’03,AR’04,MR’04,. . . ]

Crypto Applications ◮ ‘Answering queries:’ signing, (H)IBE key extraction, (NI)ZK

3 / 10

slide-11
SLIDE 11

Gaussian Sampling on Lattices

◮ Given ‘good’ basis B and center c, sample discrete Gaussian on L

⋆ ‘Zero-knowledge’ operation: leaks no information about B [GPV’08] c b1 b2

[B’93,R’03,AR’04,MR’04,. . . ]

Crypto Applications ◮ ‘Answering queries:’ signing, (H)IBE key extraction, (NI)ZK ◮ Worst-case / average-case reductions

[GPV’08,P’09,LPR’10,G’10]

3 / 10

slide-12
SLIDE 12

Gaussian Sampling on Lattices

◮ Given ‘good’ basis B and center c, sample discrete Gaussian on L

⋆ ‘Zero-knowledge’ operation: leaks no information about B [GPV’08] c b1 b2

[B’93,R’03,AR’04,MR’04,. . . ]

Crypto Applications ◮ ‘Answering queries:’ signing, (H)IBE key extraction, (NI)ZK ◮ Worst-case / average-case reductions

[GPV’08,P’09,LPR’10,G’10]

◮ Narrower Gaussian ⇒ smaller keys ⇒ more efficient schemes

3 / 10

slide-13
SLIDE 13

The GPV Sampling Algorithm

◮ ‘Nearest-plane’ algorithm w/ randomized rounding [Babai’86,Klein’00]

c b1 b2 4 / 10

slide-14
SLIDE 14

The GPV Sampling Algorithm

◮ ‘Nearest-plane’ algorithm w/ randomized rounding [Babai’86,Klein’00]

c b1 b2 4 / 10

slide-15
SLIDE 15

The GPV Sampling Algorithm

◮ ‘Nearest-plane’ algorithm w/ randomized rounding [Babai’86,Klein’00]

c b1 b2 4 / 10

slide-16
SLIDE 16

The GPV Sampling Algorithm

◮ ‘Nearest-plane’ algorithm w/ randomized rounding [Babai’86,Klein’00]

c b1 b2 4 / 10

slide-17
SLIDE 17

The GPV Sampling Algorithm

◮ ‘Nearest-plane’ algorithm w/ randomized rounding [Babai’86,Klein’00]

c b1 b2

Good News, and Bad News. . .

4 / 10

slide-18
SLIDE 18

The GPV Sampling Algorithm

◮ ‘Nearest-plane’ algorithm w/ randomized rounding [Babai’86,Klein’00]

c b1 b2

Good News, and Bad News. . . ✔ Narrow: width ≈ max bi = max dist between adjacent ‘planes’

4 / 10

slide-19
SLIDE 19

The GPV Sampling Algorithm

◮ ‘Nearest-plane’ algorithm w/ randomized rounding [Babai’86,Klein’00]

c b1 b2

Good News, and Bad News. . . ✔ Narrow: width ≈ max bi = max dist between adjacent ‘planes’ ✗ Not efficient: time = Ω(n3) , high-precision real arithmetic

4 / 10

slide-20
SLIDE 20

The GPV Sampling Algorithm

◮ ‘Nearest-plane’ algorithm w/ randomized rounding [Babai’86,Klein’00]

c b1 b2

Good News, and Bad News. . . ✔ Narrow: width ≈ max bi = max dist between adjacent ‘planes’ ✗ Not efficient: time = Ω(n3) , high-precision real arithmetic ✗ Inherently sequential: n adaptive iterations

4 / 10

slide-21
SLIDE 21

The GPV Sampling Algorithm

◮ ‘Nearest-plane’ algorithm w/ randomized rounding [Babai’86,Klein’00]

c b1 b2

Good News, and Bad News. . . ✔ Narrow: width ≈ max bi = max dist between adjacent ‘planes’ ✗ Not efficient: time = Ω(n3) , high-precision real arithmetic ✗ Inherently sequential: n adaptive iterations ✗ No efficiency improvement for ring-based crypto [NTRU’98,M’02,. . . ]

4 / 10

slide-22
SLIDE 22

Our Contributions

1 A new Gaussian sampling algorithm for lattices.

5 / 10

slide-23
SLIDE 23

Our Contributions

1 A new Gaussian sampling algorithm for lattices.

Key Features

⋆ Simple & efficient: ≈ 4n2 online adds and mults, modulo a small integer 5 / 10

slide-24
SLIDE 24

Our Contributions

1 A new Gaussian sampling algorithm for lattices.

Key Features

⋆ Simple & efficient: ≈ 4n2 online adds and mults, modulo a small integer

Even better: ˜ O(n) time for ring-based schemes!

5 / 10

slide-25
SLIDE 25

Our Contributions

1 A new Gaussian sampling algorithm for lattices.

Key Features

⋆ Simple & efficient: ≈ 4n2 online adds and mults, modulo a small integer

Even better: ˜ O(n) time for ring-based schemes!

⋆ Fully parallelizable: n2/P operations on each of P ≤ n2 processors 5 / 10

slide-26
SLIDE 26

Our Contributions

1 A new Gaussian sampling algorithm for lattices.

Key Features

⋆ Simple & efficient: ≈ 4n2 online adds and mults, modulo a small integer

Even better: ˜ O(n) time for ring-based schemes!

⋆ Fully parallelizable: n2/P operations on each of P ≤ n2 processors ⋆ High quality: for crypto lattices, same∗ Gaussian width as GPV 5 / 10

slide-27
SLIDE 27

Our Contributions

1 A new Gaussian sampling algorithm for lattices.

Key Features

⋆ Simple & efficient: ≈ 4n2 online adds and mults, modulo a small integer

Even better: ˜ O(n) time for ring-based schemes!

⋆ Fully parallelizable: n2/P operations on each of P ≤ n2 processors ⋆ High quality: for crypto lattices, same∗ Gaussian width as GPV

2 A general ‘convolution theorem’ for discrete Gaussians.

Other applications: LWE error distribution, bi-deniable encryption [OP’10], . . .

5 / 10

slide-28
SLIDE 28

A First Attempt

◮ [Babai’86] ‘simple rounding:’ c → B · ⌊B−1 · c⌉ . (Fast & Parallel!)

c b1 b2 6 / 10

slide-29
SLIDE 29

A First Attempt

◮ [Babai’86] ‘simple rounding:’ c → B · ⌊B−1 · c⌉ . (Fast & Parallel!)

c b1 b2 6 / 10

slide-30
SLIDE 30

A First Attempt

◮ [Babai’86] ‘simple rounding:’ c → B · ⌊B−1 · c⌉ . (Fast & Parallel!) ◮ Deterministic rounding is insecure [NguyenRegev’06] . . .

c b1 b2 6 / 10

slide-31
SLIDE 31

A First Attempt

◮ [Babai’86] ‘simple rounding:’ c → B · ⌊B−1 · c⌉$. (Fast & Parallel!) ◮ Deterministic rounding is insecure [NguyenRegev’06] . . . . . . but what about randomized rounding?

c b1 b2 6 / 10

slide-32
SLIDE 32

A First Attempt

◮ [Babai’86] ‘simple rounding:’ c → B · ⌊B−1 · c⌉$. (Fast & Parallel!) ◮ Deterministic rounding is insecure [NguyenRegev’06] . . . . . . but what about randomized rounding?

c b1 b2 6 / 10

slide-33
SLIDE 33

A First Attempt

◮ [Babai’86] ‘simple rounding:’ c → B · ⌊B−1 · c⌉$. (Fast & Parallel!) ◮ Deterministic rounding is insecure [NguyenRegev’06] . . . . . . but what about randomized rounding?

c b1 b2

◮ Non-spherical distribution: has covariance Σ := Exp

x

  • x · xt

≈ B · Bt.

6 / 10

slide-34
SLIDE 34

A First Attempt

◮ [Babai’86] ‘simple rounding:’ c → B · ⌊B−1 · c⌉$. (Fast & Parallel!) ◮ Deterministic rounding is insecure [NguyenRegev’06] . . . . . . but what about randomized rounding?

c b1 b2

◮ Non-spherical distribution: has covariance Σ := Exp

x

  • x · xt

≈ B · Bt. Covariance can be measured — and it leaks B! (up to rotation)

6 / 10

slide-35
SLIDE 35

Inspiration: Some Facts About Gaussians

1 Continuous Gaussian ⇐

⇒ positive definite covariance matrix Σ.

(pos def: ut Σ u > 0 for all unit u.)

7 / 10

slide-36
SLIDE 36

Inspiration: Some Facts About Gaussians

1 Continuous Gaussian ⇐

⇒ positive definite covariance matrix Σ.

(pos def: ut Σ u > 0 for all unit u.)

Spherical Gaussian ⇐ ⇒ covariance s2 I.

7 / 10

slide-37
SLIDE 37

Inspiration: Some Facts About Gaussians

1 Continuous Gaussian ⇐

⇒ positive definite covariance matrix Σ.

(pos def: ut Σ u > 0 for all unit u.)

Spherical Gaussian ⇐ ⇒ covariance s2 I.

2 Convolution of Gaussians:

+ = Σ1 + Σ2 = Σ = s2 I

7 / 10

slide-38
SLIDE 38

Inspiration: Some Facts About Gaussians

1 Continuous Gaussian ⇐

⇒ positive definite covariance matrix Σ.

(pos def: ut Σ u > 0 for all unit u.)

Spherical Gaussian ⇐ ⇒ covariance s2 I.

2 Convolution of Gaussians:

+ = Σ1 + Σ2 = Σ = s2 I

3 Given Σ1, how small can s be? For Σ2 := s2 I − Σ1,

7 / 10

slide-39
SLIDE 39

Inspiration: Some Facts About Gaussians

1 Continuous Gaussian ⇐

⇒ positive definite covariance matrix Σ.

(pos def: ut Σ u > 0 for all unit u.)

Spherical Gaussian ⇐ ⇒ covariance s2 I.

2 Convolution of Gaussians:

+ = Σ1 + Σ2 = Σ = s2 I

3 Given Σ1, how small can s be? For Σ2 := s2 I − Σ1,

ut Σ2 u = s2 − ut Σ1 u > 0 ⇐ ⇒ s2 > max λi(Σ1)

7 / 10

slide-40
SLIDE 40

Inspiration: Some Facts About Gaussians

1 Continuous Gaussian ⇐

⇒ positive definite covariance matrix Σ.

(pos def: ut Σ u > 0 for all unit u.)

Spherical Gaussian ⇐ ⇒ covariance s2 I.

2 Convolution of Gaussians:

+ = Σ1 + Σ2 = Σ = s2 I

3 Given Σ1, how small can s be? For Σ2 := s2 I − Σ1,

ut Σ2 u = s2 − ut Σ1 u > 0 ⇐ ⇒ s2 > max λi(Σ1) When Σ1 = B Bt, any s > s1(B) := max singular val of B.

7 / 10

slide-41
SLIDE 41

Our New Sampling Algorithm

◮ Given basis B, center c, and s > s1(B), Σ1 = B Bt

c b1 b2 8 / 10

slide-42
SLIDE 42

Our New Sampling Algorithm

◮ Given basis B, center c, and s > s1(B),

1 Perturb c with covariance Σ2 := s2 I − Σ1

Σ1 = B Bt Σ2

c b1 b2 c′ 8 / 10

slide-43
SLIDE 43

Our New Sampling Algorithm

◮ Given basis B, center c, and s > s1(B),

1 Perturb c with covariance Σ2 := s2 I − Σ1 2 Randomly round: return B · ⌊B−1 · c′⌉$

Σ1 = B Bt Σ2

c b1 b2 c′ 8 / 10

slide-44
SLIDE 44

Our New Sampling Algorithm

◮ Given basis B, center c, and s > s1(B),

1 Perturb c with covariance Σ2 := s2 I − Σ1 2 Randomly round: return B · ⌊B−1 · c′⌉$

Σ1 = B Bt Σ2

c b1 b2 c′

‘Convolution’ Theorem Algorithm generates the discrete, spherical Gaussian over L.

8 / 10

slide-45
SLIDE 45

Our New Sampling Algorithm

◮ Given basis B, center c, and s > s1(B),

1 Perturb c with covariance Σ2 := s2 I − Σ1 2 Randomly round: return B · ⌊B−1 · c′⌉$

Σ1 = B Bt Σ2

c b1 b2 c′

‘Convolution’ Theorem Algorithm generates the discrete, spherical Gaussian over L.

(NB: not really a convolution, since step 2 depends on step 1. Proof uses ‘smoothing parameter’ [MR’04] to reduce to an actual convolution.)

8 / 10

slide-46
SLIDE 46

Our New Sampling Algorithm

◮ Given basis B, center c, and s > s1(B),

1 Perturb c with covariance Σ2 := s2 I − Σ1 2 Randomly round: return B · ⌊B−1 · c′⌉$

Σ1 = B Bt Σ2

c b1 b2 c′

Optimizing for Crypto Applications

1 Precompute offline: Σ2, B−1, perturbation(s)

8 / 10

slide-47
SLIDE 47

Our New Sampling Algorithm

◮ Given basis B, center c, and s > s1(B),

1 Perturb c with covariance Σ2 := s2 I − Σ1 2 Randomly round: return B · ⌊B−1 · c′⌉$

Σ1 = B Bt Σ2

c b1 b2 c′

Optimizing for Crypto Applications

1 Precompute offline: Σ2, B−1, perturbation(s) 2 Use integer perturbations and arithmetic

8 / 10

slide-48
SLIDE 48

Our New Sampling Algorithm

◮ Given basis B, center c, and s > s1(B),

1 Perturb c with covariance Σ2 := s2 I − Σ1 2 Randomly round: return B · ⌊B−1 · c′⌉$

Σ1 = B Bt Σ2

c b1 b2 c′

Optimizing for Crypto Applications

1 Precompute offline: Σ2, B−1, perturbation(s) 2 Use integer perturbations and arithmetic 3 Exploit ‘q-ary’ lattices: mod q operations, offline rounding

8 / 10

slide-49
SLIDE 49

Our New Sampling Algorithm

◮ Given basis B, center c, and s > s1(B),

1 Perturb c with covariance Σ2 := s2 I − Σ1 2 Randomly round: return B · ⌊B−1 · c′⌉$

Σ1 = B Bt Σ2

c b1 b2 c′

Optimizing for Crypto Applications

1 Precompute offline: Σ2, B−1, perturbation(s) 2 Use integer perturbations and arithmetic 3 Exploit ‘q-ary’ lattices: mod q operations, offline rounding 4 Batch multi-sample using fast matrix mult

8 / 10

slide-50
SLIDE 50

Our New Sampling Algorithm

◮ Given basis B, center c, and s > s1(B),

1 Perturb c with covariance Σ2 := s2 I − Σ1 2 Randomly round: return B · ⌊B−1 · c′⌉$

Σ1 = B Bt Σ2

c b1 b2 p1 p2

Some Perspective ◮ Resembles ‘perturbation’ heuristic of NTRUSign [HHG+’03]. But. . .

8 / 10

slide-51
SLIDE 51

Our New Sampling Algorithm

◮ Given basis B, center c, and s > s1(B),

1 Perturb c with covariance Σ2 := s2 I − Σ1 2 Randomly round: return B · ⌊B−1 · c′⌉$

Σ1 = B Bt Σ2

c b1 b2 p1 p2

Some Perspective ◮ Resembles ‘perturbation’ heuristic of NTRUSign [HHG+’03]. But. . . ◮ NTRU perturbations are deterministic & inherently online. And. . .

8 / 10

slide-52
SLIDE 52

Our New Sampling Algorithm

◮ Given basis B, center c, and s > s1(B),

1 Perturb c with covariance Σ2 := s2 I − Σ1 2 Randomly round: return B · ⌊B−1 · c′⌉$

Σ1 = B Bt Σ2

c b1 b2 p1 p2

Some Perspective ◮ Resembles ‘perturbation’ heuristic of NTRUSign [HHG+’03]. But. . . ◮ NTRU perturbations are deterministic & inherently online. And. . . ◮ They may be insecure anyway [MPSW’10].

8 / 10

slide-53
SLIDE 53

How Does the Quality Compare?

Narrower is Better! ◮ GPV: width ≈ B := max Gram-Schmidt length of B ≤ maxbi ◮ New: width ≈ s1(B) := max singular value of B

9 / 10

slide-54
SLIDE 54

How Does the Quality Compare?

Narrower is Better! ◮ GPV: width ≈ B := max Gram-Schmidt length of B ≤ maxbi ◮ New: width ≈ s1(B) := max singular value of B Bad News, and Good News. . .

9 / 10

slide-55
SLIDE 55

How Does the Quality Compare?

Narrower is Better! ◮ GPV: width ≈ B := max Gram-Schmidt length of B ≤ maxbi ◮ New: width ≈ s1(B) := max singular value of B Bad News, and Good News. . . ✗ In general,

  • B ≤ s1(B) ≤ n ·

B (Both inequalities are tight.)

9 / 10

slide-56
SLIDE 56

How Does the Quality Compare?

Narrower is Better! ◮ GPV: width ≈ B := max Gram-Schmidt length of B ≤ maxbi ◮ New: width ≈ s1(B) := max singular value of B Bad News, and Good News. . . ✗ In general,

  • B ≤ s1(B) ≤ n ·

B (Both inequalities are tight.) ✔ We show: for random cryptographic bases [AP’09,CHKP’10],

  • B ≈ s1(B)

because bases are ‘well-rounded.’

9 / 10

slide-57
SLIDE 57

Epilogue

◮ In an upcoming work [MP’10], we tackle basis generation and Gaussian sampling jointly. ⇒ Simple constructions, optimal constants, practical algorithms

10 / 10

slide-58
SLIDE 58

Epilogue

◮ In an upcoming work [MP’10], we tackle basis generation and Gaussian sampling jointly. ⇒ Simple constructions, optimal constants, practical algorithms ◮ Implementation: 1000s of samples / sec at moderate security.

(Without batching or parallelism!)

10 / 10

slide-59
SLIDE 59

Epilogue

◮ In an upcoming work [MP’10], we tackle basis generation and Gaussian sampling jointly. ⇒ Simple constructions, optimal constants, practical algorithms ◮ Implementation: 1000s of samples / sec at moderate security.

(Without batching or parallelism!)

⇒ Essentially as fast as the public-key operation. ⇒ Bottleneck: n2 cost inherent to general lattices. Ring-based schemes will be much faster!

10 / 10

slide-60
SLIDE 60

Epilogue

◮ In an upcoming work [MP’10], we tackle basis generation and Gaussian sampling jointly. ⇒ Simple constructions, optimal constants, practical algorithms ◮ Implementation: 1000s of samples / sec at moderate security.

(Without batching or parallelism!)

⇒ Essentially as fast as the public-key operation. ⇒ Bottleneck: n2 cost inherent to general lattices. Ring-based schemes will be much faster! ◮ Stay tuned . . . Thanks!

10 / 10