fast lattice-based encryption: stretching...

28
Fast Lattice-Based Encryption: Stretching SPRING Charles Bouillaguet 1 Claire Delaplace 1,2 Pierre-Alain Fouque 2 Paul Kirchner 3 1 CFHP team, CRIStAL, Université de Lille, France 2 EMSEC team, IRISA, Université de Rennes 1, France 3 École Normale Supérieure, Paris, France PQCrypto, 2017 Claire Delaplace SPRING PQCrypto 17 1 / 14

Upload: dophuc

Post on 19-Jun-2019

229 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Fast Lattice-Based Encryption: Stretching SPRING2017.pqcrypto.org/conference/slides/lbcI/Delaplace_pqc17.pdfFast Lattice-Based Encryption: Stretching SPRING CharlesBouillaguet 1ClaireDelaplace;

Fast Lattice-Based Encryption: Stretching SPRING

Charles Bouillaguet1 Claire Delaplace1,2 Pierre-Alain Fouque2 PaulKirchner3

1CFHP team, CRIStAL, Université de Lille, France

2EMSEC team, IRISA, Université de Rennes 1, France

3École Normale Supérieure, Paris, France

PQCrypto, 2017

Claire Delaplace SPRING PQCrypto 17 1 / 14

Page 2: Fast Lattice-Based Encryption: Stretching SPRING2017.pqcrypto.org/conference/slides/lbcI/Delaplace_pqc17.pdfFast Lattice-Based Encryption: Stretching SPRING CharlesBouillaguet 1ClaireDelaplace;

Previous Work

Motivation

Goal: Efficient (competitive with AES) PRF/PRG with strong design

Lattice based PRF and PRG

Why?Strong designProof of security assuminghard lattices problemPost Quantum Security

IssuePRF/PRG: deterministicprimitivesLattice based cryptography:not deterministic

Solution [BPR12]Derandomizing (Ring)-LWEIntroduce a family of provably secure PRF under (Ring)-LWE assumption

Claire Delaplace SPRING PQCrypto 17 2 / 14

Page 3: Fast Lattice-Based Encryption: Stretching SPRING2017.pqcrypto.org/conference/slides/lbcI/Delaplace_pqc17.pdfFast Lattice-Based Encryption: Stretching SPRING CharlesBouillaguet 1ClaireDelaplace;

Previous Work

Motivation

Goal: Efficient (competitive with AES) PRF/PRG with strong design

Lattice based PRF and PRG

Why?Strong designProof of security assuminghard lattices problemPost Quantum Security

IssuePRF/PRG: deterministicprimitivesLattice based cryptography:not deterministic

Solution [BPR12]Derandomizing (Ring)-LWEIntroduce a family of provably secure PRF under (Ring)-LWE assumption

Claire Delaplace SPRING PQCrypto 17 2 / 14

Page 4: Fast Lattice-Based Encryption: Stretching SPRING2017.pqcrypto.org/conference/slides/lbcI/Delaplace_pqc17.pdfFast Lattice-Based Encryption: Stretching SPRING CharlesBouillaguet 1ClaireDelaplace;

Previous Work

Motivation

Goal: Efficient (competitive with AES) PRF/PRG with strong design

Lattice based PRF and PRG

Why?Strong designProof of security assuminghard lattices problemPost Quantum Security

IssuePRF/PRG: deterministicprimitivesLattice based cryptography:not deterministic

Solution [BPR12]Derandomizing (Ring)-LWEIntroduce a family of provably secure PRF under (Ring)-LWE assumption

Claire Delaplace SPRING PQCrypto 17 2 / 14

Page 5: Fast Lattice-Based Encryption: Stretching SPRING2017.pqcrypto.org/conference/slides/lbcI/Delaplace_pqc17.pdfFast Lattice-Based Encryption: Stretching SPRING CharlesBouillaguet 1ClaireDelaplace;

Previous Work

Derandomizing RING-LWE

Polynomial Ring: Rq = Zq[X ]/(X n + 1)q ≥ 2 integer; n power of two

RING Learning With Error (RLWE)s ∈ Rq secretei random independent errors (drawn from a discrete gaussian distribution)Distinguish (ai , ai · s + ei ) from uniform over Rq × Rq

RING Learning With Rounding (RLWR)2 ≤ p ≤ q

S : Rq → Rp rounding functions ∈ Rq secretDistinguish (ai ,S(ai · s)) from uniform over Rq × Rp

Claire Delaplace SPRING PQCrypto 17 3 / 14

Page 6: Fast Lattice-Based Encryption: Stretching SPRING2017.pqcrypto.org/conference/slides/lbcI/Delaplace_pqc17.pdfFast Lattice-Based Encryption: Stretching SPRING CharlesBouillaguet 1ClaireDelaplace;

Previous Work

SPRING family of PRF

Polynomial Ring: Rq = Zq[X ]/(X n + 1)

Subset Product with Rounding over a RINGInput: x = (x1, . . . , xk) ∈ {0, 1}k

Secrets: (a,s1, . . . , sk) ∈ R∗q × (R∗

q )k

F (x1, . . . , xk) = S(a ·k∏

i=1

sixi )

Rounding FunctionRounding of each coefficient of a polynomial b:

Scoef (bi ) = bp · b̄i/qc, b̄i ≡ bi mod q

p power of two ⇒ Scoef (bi ): log2(p) high-order bits of bi

Claire Delaplace SPRING PQCrypto 17 4 / 14

Page 7: Fast Lattice-Based Encryption: Stretching SPRING2017.pqcrypto.org/conference/slides/lbcI/Delaplace_pqc17.pdfFast Lattice-Based Encryption: Stretching SPRING CharlesBouillaguet 1ClaireDelaplace;

Previous Work

Parameters choice

SPRING: F (x1, . . . , xk) = S(a ·∏k

i=1 sixi )

[BPR 12]q exponential in k

si short

⇒ Proof of Security (Assuming hardness of RLWE ) but not efficient

[BBLPR 14]q = 257, n = 128, k = 64, p = 2Efficient design but no proof of securityConcrete security analysis requiredOutput has a noticeable bias of 1/q

Claire Delaplace SPRING PQCrypto 17 5 / 14

Page 8: Fast Lattice-Based Encryption: Stretching SPRING2017.pqcrypto.org/conference/slides/lbcI/Delaplace_pqc17.pdfFast Lattice-Based Encryption: Stretching SPRING CharlesBouillaguet 1ClaireDelaplace;

Previous Work

Parameters choice

SPRING: F (x1, . . . , xk) = S(a ·∏k

i=1 sixi )

[BPR 12]q exponential in k

si short

⇒ Proof of Security (Assuming hardness of RLWE ) but not efficient

[BBLPR 14]q = 257, n = 128, k = 64, p = 2Efficient design but no proof of securityConcrete security analysis requiredOutput has a noticeable bias of 1/q

Claire Delaplace SPRING PQCrypto 17 5 / 14

Page 9: Fast Lattice-Based Encryption: Stretching SPRING2017.pqcrypto.org/conference/slides/lbcI/Delaplace_pqc17.pdfFast Lattice-Based Encryption: Stretching SPRING CharlesBouillaguet 1ClaireDelaplace;

Previous Work

Dealing with the Bias

SPRING: F (x1, . . . , xk) = S(a ·∏k

i=1 sixi )

Parameters: q = 257, n = 128, k = 64, p = 2

SPRING-CRT [BBLPR 14]Secrets drawn in R∗

2·q instead of R∗q

Even modulus: no biasAttacks to recover the bias

SPRING-BCH [BBLPR 14]Apply a BCH code with parameters [128, 64, 22] to the biased output

Reduce the bias to 1/q22 ' 2−176

Halve the output length

Claire Delaplace SPRING PQCrypto 17 6 / 14

Page 10: Fast Lattice-Based Encryption: Stretching SPRING2017.pqcrypto.org/conference/slides/lbcI/Delaplace_pqc17.pdfFast Lattice-Based Encryption: Stretching SPRING CharlesBouillaguet 1ClaireDelaplace;

Previous Work

Dealing with the Bias

SPRING: F (x1, . . . , xk) = S(a ·∏k

i=1 sixi )

Parameters: q = 257, n = 128, k = 64, p = 2

SPRING-CRT [BBLPR 14]Secrets drawn in R∗

2·q instead of R∗q

Even modulus: no biasAttacks to recover the bias

SPRING-BCH [BBLPR 14]Apply a BCH code with parameters [128, 64, 22] to the biased output

Reduce the bias to 1/q22 ' 2−176

Halve the output length

Claire Delaplace SPRING PQCrypto 17 6 / 14

Page 11: Fast Lattice-Based Encryption: Stretching SPRING2017.pqcrypto.org/conference/slides/lbcI/Delaplace_pqc17.pdfFast Lattice-Based Encryption: Stretching SPRING CharlesBouillaguet 1ClaireDelaplace;

SPRING with Rejection Sampling

Our Work: SPRING with Rejection SamplingSPRING: F (x1, . . . , xk) = S(a ·

∏ki=1 si

xi )

Parameters: q = 257, n = 128, k = 64, p ∈ {2, 4, 8, 16}

Rounding FunctionRounding of each coefficient:

bi →{

⊥ if bi = 256Scoef (bi ) otherwise

Scoef (bi ): log2(p) high order bits of bi

SPRING-RS� No bias� Variable output length

⇒ Let’s use it in counter mode (CTR) as a PRG.

Claire Delaplace SPRING PQCrypto 17 7 / 14

Page 12: Fast Lattice-Based Encryption: Stretching SPRING2017.pqcrypto.org/conference/slides/lbcI/Delaplace_pqc17.pdfFast Lattice-Based Encryption: Stretching SPRING CharlesBouillaguet 1ClaireDelaplace;

SPRING with Rejection Sampling

Our Work: SPRING with Rejection SamplingSPRING: F (x1, . . . , xk) = S(a ·

∏ki=1 si

xi )

Parameters: q = 257, n = 128, k = 64, p ∈ {2, 4, 8, 16}

Rounding FunctionRounding of each coefficient:

bi →{

⊥ if bi = 256Scoef (bi ) otherwise

Scoef (bi ): log2(p) high order bits of bi

SPRING-RS� No bias� Variable output length

⇒ Let’s use it in counter mode (CTR) as a PRG.

Claire Delaplace SPRING PQCrypto 17 7 / 14

Page 13: Fast Lattice-Based Encryption: Stretching SPRING2017.pqcrypto.org/conference/slides/lbcI/Delaplace_pqc17.pdfFast Lattice-Based Encryption: Stretching SPRING CharlesBouillaguet 1ClaireDelaplace;

SPRING with Rejection Sampling

Our Work: SPRING with Rejection SamplingSPRING: F (x1, . . . , xk) = S(a ·

∏ki=1 si

xi )

Parameters: q = 257, n = 128, k = 64, p ∈ {2, 4, 8, 16}

Rounding FunctionRounding of each coefficient:

bi →{

⊥ if bi = 256Scoef (bi ) otherwise

Scoef (bi ): log2(p) high order bits of bi

SPRING-RS� No bias� Variable output length

⇒ Let’s use it in counter mode (CTR) as a PRG.

Claire Delaplace SPRING PQCrypto 17 7 / 14

Page 14: Fast Lattice-Based Encryption: Stretching SPRING2017.pqcrypto.org/conference/slides/lbcI/Delaplace_pqc17.pdfFast Lattice-Based Encryption: Stretching SPRING CharlesBouillaguet 1ClaireDelaplace;

SPRING with Rejection Sampling

Counter Mode

Using Gray Code Counter

x F (x)0 0 S(a)1 1 S(a · s1)2 11 S(a · s1 · s2)3 10 S(a · s2)4 110 S(a · s2 · s3)...

......

SPRING CTRb Internal state, y outputInitialization: b ← a,y ← ⊥At Each Step:

I Update xI i flipped bit of xI b ← b · si if xi = 1I b ← b · s−1

i if xi = 0I y ← y ||S(b)

Return y

Only one polynomials product per stepRequire to store the s−1

i polynomials as well

Claire Delaplace SPRING PQCrypto 17 8 / 14

Page 15: Fast Lattice-Based Encryption: Stretching SPRING2017.pqcrypto.org/conference/slides/lbcI/Delaplace_pqc17.pdfFast Lattice-Based Encryption: Stretching SPRING CharlesBouillaguet 1ClaireDelaplace;

SPRING with Rejection Sampling

Counter Mode

Using Gray Code Counter

x F (x)0 0 S(a)1 1 S(a · s1)2 11 S(a · s1 · s2)3 10 S(a · s2)4 110 S(a · s2 · s3)...

......

SPRING CTRb Internal state, y outputInitialization: b ← a,y ← ⊥At Each Step:

I Update xI i flipped bit of xI b ← b · si if xi = 1I b ← b · s−1

i if xi = 0I y ← y ||S(b)

Return y

Only one polynomials product per stepRequire to store the s−1

i polynomials as well

Claire Delaplace SPRING PQCrypto 17 8 / 14

Page 16: Fast Lattice-Based Encryption: Stretching SPRING2017.pqcrypto.org/conference/slides/lbcI/Delaplace_pqc17.pdfFast Lattice-Based Encryption: Stretching SPRING CharlesBouillaguet 1ClaireDelaplace;

SPRING with Rejection Sampling

Implementation Tricks

Store the a, si s−1i in FFT evaluated form aev , si,ev , s−1

i,evI Coefficient wise productI One FFT per step to get the internal state b

Use SIMD vector instructionsI Perform operation in one fell swoop on a vector of dataI Intel core SSE2 and ARM Neon: 16 vectors of 8 coefficients per polynomialsI Intel core AVX2: 8 vectors of 16 coefficients per polynomials

Claire Delaplace SPRING PQCrypto 17 9 / 14

Page 17: Fast Lattice-Based Encryption: Stretching SPRING2017.pqcrypto.org/conference/slides/lbcI/Delaplace_pqc17.pdfFast Lattice-Based Encryption: Stretching SPRING CharlesBouillaguet 1ClaireDelaplace;

SPRING with Rejection Sampling

SPRING-RS in a Nutshell

Rounding y ← y ||S(b)

Rejection test

FFT

16 c 16 c 16 c 16 c 16 c 16 c 16 c 16 c

Initializationx = 0 . . . 00 bev ← aev

Claire Delaplace SPRING PQCrypto 17 10 / 14

Page 18: Fast Lattice-Based Encryption: Stretching SPRING2017.pqcrypto.org/conference/slides/lbcI/Delaplace_pqc17.pdfFast Lattice-Based Encryption: Stretching SPRING CharlesBouillaguet 1ClaireDelaplace;

SPRING with Rejection Sampling

SPRING-RS in a Nutshell

Rounding y ← y ||S(b)

Rejection test

FFT

Initializationx = 0 . . . 00 bev ← aev

b

FFT over

(Z257)128

Claire Delaplace SPRING PQCrypto 17 10 / 14

Page 19: Fast Lattice-Based Encryption: Stretching SPRING2017.pqcrypto.org/conference/slides/lbcI/Delaplace_pqc17.pdfFast Lattice-Based Encryption: Stretching SPRING CharlesBouillaguet 1ClaireDelaplace;

SPRING with Rejection Sampling

SPRING-RS in a Nutshell

Rounding y ← y ||S(b)

Rejection test BAD

FFT

Initializationx = 0 . . . 00 bev ← aev

b

FFT over

(Z257)128

Rejection test

Claire Delaplace SPRING PQCrypto 17 10 / 14

Page 20: Fast Lattice-Based Encryption: Stretching SPRING2017.pqcrypto.org/conference/slides/lbcI/Delaplace_pqc17.pdfFast Lattice-Based Encryption: Stretching SPRING CharlesBouillaguet 1ClaireDelaplace;

SPRING with Rejection Sampling

SPRING-RS in a Nutshell

Rounding y ← y ||S(b)

Rejection test

⊥S S S S S S S

BAD

FFT

Initializationx = 0 . . . 00 bev ← aev

b

FFT over

(Z257)128

Rejection test

Rounding y ← y ||S(b)

Claire Delaplace SPRING PQCrypto 17 10 / 14

Page 21: Fast Lattice-Based Encryption: Stretching SPRING2017.pqcrypto.org/conference/slides/lbcI/Delaplace_pqc17.pdfFast Lattice-Based Encryption: Stretching SPRING CharlesBouillaguet 1ClaireDelaplace;

SPRING with Rejection Sampling

SPRING-RS in a Nutshell

Rounding y ← y ||S(b)

Rejection test

FFT

Update

bev

bev

s1ev

bev · s1ev

x = 0 . . . 01

Point-wise

product

Claire Delaplace SPRING PQCrypto 17 10 / 14

Page 22: Fast Lattice-Based Encryption: Stretching SPRING2017.pqcrypto.org/conference/slides/lbcI/Delaplace_pqc17.pdfFast Lattice-Based Encryption: Stretching SPRING CharlesBouillaguet 1ClaireDelaplace;

SPRING with Rejection Sampling

SPRING-RS in a Nutshell

Rounding y ← y ||S(b)

Rejection test

FFT

Update

bev

x = 0 . . . 01

Claire Delaplace SPRING PQCrypto 17 10 / 14

Page 23: Fast Lattice-Based Encryption: Stretching SPRING2017.pqcrypto.org/conference/slides/lbcI/Delaplace_pqc17.pdfFast Lattice-Based Encryption: Stretching SPRING CharlesBouillaguet 1ClaireDelaplace;

SPRING with Rejection Sampling

SPRING-RS in a Nutshell

Rounding y ← y ||S(b)

Rejection test

FFT

b

FFT over

(Z257)128

bevNew Internalstate

Claire Delaplace SPRING PQCrypto 17 10 / 14

Page 24: Fast Lattice-Based Encryption: Stretching SPRING2017.pqcrypto.org/conference/slides/lbcI/Delaplace_pqc17.pdfFast Lattice-Based Encryption: Stretching SPRING CharlesBouillaguet 1ClaireDelaplace;

Security Analysis

Security Analysis of SPRING

With BPR12 parameters: Security proofWith efficient parameters

I No security proofI Resistant against known RLWE attacks

SPRING-RSmore output bits per coefficient returned

I More information given to the adversariesI Does not seem to weaken the scheme though

Using rejection samplingI Possible side channel leaksI Seems hard to recover the exact position of rejected coefficientsI The adversary would need to solve a polynomial system

Claire Delaplace SPRING PQCrypto 17 11 / 14

Page 25: Fast Lattice-Based Encryption: Stretching SPRING2017.pqcrypto.org/conference/slides/lbcI/Delaplace_pqc17.pdfFast Lattice-Based Encryption: Stretching SPRING CharlesBouillaguet 1ClaireDelaplace;

Perfomance

Performance

Performance (counter mode) in cycle per output bytesSPRING-BCH SPRING-CRT AES-CTR SPRING-RS

ARM Cortex A7 445 41 59Core i7 Ivy Bridge 46 23.5 1.3 (NI) 6

Core i5 Haswell 19.5 (AVX2) 0.68 (NI) 2.8 (AVX2)

Claire Delaplace SPRING PQCrypto 17 12 / 14

Page 26: Fast Lattice-Based Encryption: Stretching SPRING2017.pqcrypto.org/conference/slides/lbcI/Delaplace_pqc17.pdfFast Lattice-Based Encryption: Stretching SPRING CharlesBouillaguet 1ClaireDelaplace;

Conclusion

Other Points of the Paper

Reducing Key SizeUsing an other PRGUsing a smaller instantiation of SPRING-RS

SPRING-RS PRFReturn the rounding of the first non-rejected 96 coefficients of the productIf less than 96 coefficients are returned pad the output with zeros

Claire Delaplace SPRING PQCrypto 17 13 / 14

Page 27: Fast Lattice-Based Encryption: Stretching SPRING2017.pqcrypto.org/conference/slides/lbcI/Delaplace_pqc17.pdfFast Lattice-Based Encryption: Stretching SPRING CharlesBouillaguet 1ClaireDelaplace;

Conclusion

To Conclude

This work proposes a version of SPRING using rejection samplingEfficient as a PRG when used in counter modeNo security proofSeems to be resistant to known attacks

Open questionsIs there a security proof for SPRING with efficient parameters?Are there other attacks?

Thank you for your time !

Claire Delaplace SPRING PQCrypto 17 14 / 14

Page 28: Fast Lattice-Based Encryption: Stretching SPRING2017.pqcrypto.org/conference/slides/lbcI/Delaplace_pqc17.pdfFast Lattice-Based Encryption: Stretching SPRING CharlesBouillaguet 1ClaireDelaplace;

Conclusion

To Conclude

This work proposes a version of SPRING using rejection samplingEfficient as a PRG when used in counter modeNo security proofSeems to be resistant to known attacks

Open questionsIs there a security proof for SPRING with efficient parameters?Are there other attacks?

Thank you for your time !

Claire Delaplace SPRING PQCrypto 17 14 / 14