SABER: Module-LWR based KEM - NIST · 2018. 9. 27. · Saber-KEM:k= 3,t= 23, = 4 3 2 136 primal 199...

26
SABER: Module-LWR based KEM J. P. D’Anvers A. Karmakar S. S. Roy F. Vercauteren imec - COSIC

Transcript of SABER: Module-LWR based KEM - NIST · 2018. 9. 27. · Saber-KEM:k= 3,t= 23, = 4 3 2 136 primal 199...

Page 1: SABER: Module-LWR based KEM - NIST · 2018. 9. 27. · Saber-KEM:k= 3,t= 23, = 4 3 2 136 primal 199 181 992 1344 1088 dual 198 180 FireSaber-KEM:k= 4,t= 25, = 3 5 2 165 primal 270

SABER:Module-LWR based KEMJ. P. D’Anvers A. Karmakar S. S. Roy F. Vercauteren

imec - COSIC

Page 2: SABER: Module-LWR based KEM - NIST · 2018. 9. 27. · Saber-KEM:k= 3,t= 23, = 4 3 2 136 primal 199 181 992 1344 1088 dual 198 180 FireSaber-KEM:k= 4,t= 25, = 3 5 2 165 primal 270

LWE vs. LWR 1/10

Setup: modulus q ∈ Z, dimension l

LWE: samples of the form(aaa, b = aaaTsss+ e

)∈ Zl×1q × Zq

aaa← U(Zl×1q ), uniform random for each samplesecret vector sss ∈ Zl×1q fixed for all samplese← χ(Zq) small error

LWR: LWE with deterministic noise due to scaling and rounding(aaa, b =

⌊pq(aaaTsss)

⌉)∈ Zl×1q × Zp

q/p determines inherent noise

Page 3: SABER: Module-LWR based KEM - NIST · 2018. 9. 27. · Saber-KEM:k= 3,t= 23, = 4 3 2 136 primal 199 181 992 1344 1088 dual 198 180 FireSaber-KEM:k= 4,t= 25, = 3 5 2 165 primal 270

LWE vs. LWR 1/10

Setup: modulus q ∈ Z, dimension lLWE: samples of the form(

aaa, b = aaaTsss+ e)∈ Zl×1q × Zq

aaa← U(Zl×1q ), uniform random for each samplesecret vector sss ∈ Zl×1q fixed for all samplese← χ(Zq) small error

LWR: LWE with deterministic noise due to scaling and rounding(aaa, b =

⌊pq(aaaTsss)

⌉)∈ Zl×1q × Zp

q/p determines inherent noise

Page 4: SABER: Module-LWR based KEM - NIST · 2018. 9. 27. · Saber-KEM:k= 3,t= 23, = 4 3 2 136 primal 199 181 992 1344 1088 dual 198 180 FireSaber-KEM:k= 4,t= 25, = 3 5 2 165 primal 270

LWE vs. LWR 1/10

Setup: modulus q ∈ Z, dimension lLWE: samples of the form(

aaa, b = aaaTsss+ e)∈ Zl×1q × Zq

aaa← U(Zl×1q ), uniform random for each samplesecret vector sss ∈ Zl×1q fixed for all samplese← χ(Zq) small error

LWR: LWE with deterministic noise due to scaling and rounding(aaa, b =

⌊pq(aaaTsss)

⌉)∈ Zl×1q × Zp

q/p determines inherent noise

Page 5: SABER: Module-LWR based KEM - NIST · 2018. 9. 27. · Saber-KEM:k= 3,t= 23, = 4 3 2 136 primal 199 181 992 1344 1088 dual 198 180 FireSaber-KEM:k= 4,t= 25, = 3 5 2 165 primal 270

Module-LWE & Module-LWR 2/10

Replace Zq by larger ring Rq = Zq[X]/(f(X))

Dimension l is now product of module rank k and deg(f)

LWE Module-LWEl = 768 k = 3 and f(X) = x256 + 1

aaaT = [a0, a1, . . . , a767] aaaT = [a0, a1, a2], ai ∈ RqsssT = [s0, s1, . . . , s767] sssT = [s0, s1, s2], si ∈ Rqb = aaaTsss+ e ∈ Zq b = aaaTsss+ e ∈ Rq

Module-LWR: scaling and rounding coefficient-wise

Page 6: SABER: Module-LWR based KEM - NIST · 2018. 9. 27. · Saber-KEM:k= 3,t= 23, = 4 3 2 136 primal 199 181 992 1344 1088 dual 198 180 FireSaber-KEM:k= 4,t= 25, = 3 5 2 165 primal 270

SABER Parameter Choices 3/10

Simplicity: moduli p|q are powers of 2⊕ all security levels p = 210 and q = 213

⊕ easy sampling⊕ no modular arithmetic⊕ easy rounding = add constant and chop⊕ scaling is uniform no NTT for fast multiplication⊕ Toom-Cook: division by 8, so work mod 216 to multiply

Only one polynomial ring Rq = Zq[x]/(x256 + 1) with q = 213

Rank of module 2, 3, 4 depending on security levelSecrets sampled from centered binomial distribution βµ

Sample easy as∑µi=1 ai −

∑µi=1 bi with ai, bi ∈ {0, 1}

Page 7: SABER: Module-LWR based KEM - NIST · 2018. 9. 27. · Saber-KEM:k= 3,t= 23, = 4 3 2 136 primal 199 181 992 1344 1088 dual 198 180 FireSaber-KEM:k= 4,t= 25, = 3 5 2 165 primal 270

SABER Parameter Choices 3/10

Simplicity: moduli p|q are powers of 2⊕ all security levels p = 210 and q = 213

⊕ easy sampling⊕ no modular arithmetic⊕ easy rounding = add constant and chop⊕ scaling is uniform no NTT for fast multiplication⊕ Toom-Cook: division by 8, so work mod 216 to multiply

Only one polynomial ring Rq = Zq[x]/(x256 + 1) with q = 213

Rank of module 2, 3, 4 depending on security levelSecrets sampled from centered binomial distribution βµ

Sample easy as∑µi=1 ai −

∑µi=1 bi with ai, bi ∈ {0, 1}

Page 8: SABER: Module-LWR based KEM - NIST · 2018. 9. 27. · Saber-KEM:k= 3,t= 23, = 4 3 2 136 primal 199 181 992 1344 1088 dual 198 180 FireSaber-KEM:k= 4,t= 25, = 3 5 2 165 primal 270

SABER Parameter Choices 3/10

Simplicity: moduli p|q are powers of 2⊕ all security levels p = 210 and q = 213

⊕ easy sampling⊕ no modular arithmetic⊕ easy rounding = add constant and chop⊕ scaling is uniform no NTT for fast multiplication⊕ Toom-Cook: division by 8, so work mod 216 to multiply

Only one polynomial ring Rq = Zq[x]/(x256 + 1) with q = 213

Rank of module 2, 3, 4 depending on security level

Secrets sampled from centered binomial distribution βµSample easy as

∑µi=1 ai −

∑µi=1 bi with ai, bi ∈ {0, 1}

Page 9: SABER: Module-LWR based KEM - NIST · 2018. 9. 27. · Saber-KEM:k= 3,t= 23, = 4 3 2 136 primal 199 181 992 1344 1088 dual 198 180 FireSaber-KEM:k= 4,t= 25, = 3 5 2 165 primal 270

SABER Parameter Choices 3/10

Simplicity: moduli p|q are powers of 2⊕ all security levels p = 210 and q = 213

⊕ easy sampling⊕ no modular arithmetic⊕ easy rounding = add constant and chop⊕ scaling is uniform no NTT for fast multiplication⊕ Toom-Cook: division by 8, so work mod 216 to multiply

Only one polynomial ring Rq = Zq[x]/(x256 + 1) with q = 213

Rank of module 2, 3, 4 depending on security levelSecrets sampled from centered binomial distribution βµ

Sample easy as∑µi=1 ai −

∑µi=1 bi with ai, bi ∈ {0, 1}

Page 10: SABER: Module-LWR based KEM - NIST · 2018. 9. 27. · Saber-KEM:k= 3,t= 23, = 4 3 2 136 primal 199 181 992 1344 1088 dual 198 180 FireSaber-KEM:k= 4,t= 25, = 3 5 2 165 primal 270

SABER Module-LWR Key Agreement 4/10

Page 11: SABER: Module-LWR based KEM - NIST · 2018. 9. 27. · Saber-KEM:k= 3,t= 23, = 4 3 2 136 primal 199 181 992 1344 1088 dual 198 180 FireSaber-KEM:k= 4,t= 25, = 3 5 2 165 primal 270

SABER Module-LWR Encryption 5/10

Equivalent of standard Regev-type LWE encryption

KeyGen:seedAAA ← U({0, 1}256), AAA← gen(seedAAA) ∈ Rk×kq

sss← βµ(Rk×1q ), bbb = chop(AAAsss+ hhh, q, p) ∈ Rk×1p

pk := (bbb, seedAAA), sk := sss

Encrypt: pk = (bbb, seedAAA),m ∈M; r

AAA← gen(seedAAA) ∈ Rk×lq

s′s′s′ ← βµ(Rk×1q ), bbb′ = chop(AAATsss′ + hhh, q, p) ∈ Rk×1p

v′ = bbbTsss′ ∈ Rpcm = chop(v′ + h1 +

p2m, p, 2t) ∈ R2t

c := (cm, b′b′b′)

Decrypt: sk = sss, (cm, b′b′b′)

v = bbb′Tsss ∈ Rpm′ = chop(v − p

2tcm + h2, p, 2) ∈ R2

Page 12: SABER: Module-LWR based KEM - NIST · 2018. 9. 27. · Saber-KEM:k= 3,t= 23, = 4 3 2 136 primal 199 181 992 1344 1088 dual 198 180 FireSaber-KEM:k= 4,t= 25, = 3 5 2 165 primal 270

SABER Module-LWR Encryption 5/10

Equivalent of standard Regev-type LWE encryptionKeyGen:

seedAAA ← U({0, 1}256), AAA← gen(seedAAA) ∈ Rk×kq

sss← βµ(Rk×1q ), bbb = chop(AAAsss+ hhh, q, p) ∈ Rk×1p

pk := (bbb, seedAAA), sk := sss

Encrypt: pk = (bbb, seedAAA),m ∈M; r

AAA← gen(seedAAA) ∈ Rk×lq

s′s′s′ ← βµ(Rk×1q ), bbb′ = chop(AAATsss′ + hhh, q, p) ∈ Rk×1p

v′ = bbbTsss′ ∈ Rpcm = chop(v′ + h1 +

p2m, p, 2t) ∈ R2t

c := (cm, b′b′b′)

Decrypt: sk = sss, (cm, b′b′b′)

v = bbb′Tsss ∈ Rpm′ = chop(v − p

2tcm + h2, p, 2) ∈ R2

Page 13: SABER: Module-LWR based KEM - NIST · 2018. 9. 27. · Saber-KEM:k= 3,t= 23, = 4 3 2 136 primal 199 181 992 1344 1088 dual 198 180 FireSaber-KEM:k= 4,t= 25, = 3 5 2 165 primal 270

SABER Module-LWR Encryption 5/10

Equivalent of standard Regev-type LWE encryptionKeyGen:

seedAAA ← U({0, 1}256), AAA← gen(seedAAA) ∈ Rk×kq

sss← βµ(Rk×1q ), bbb = chop(AAAsss+ hhh, q, p) ∈ Rk×1p

pk := (bbb, seedAAA), sk := sss

Encrypt: pk = (bbb, seedAAA),m ∈M; r

AAA← gen(seedAAA) ∈ Rk×lq

s′s′s′ ← βµ(Rk×1q ), bbb′ = chop(AAATsss′ + hhh, q, p) ∈ Rk×1p

v′ = bbbTsss′ ∈ Rpcm = chop(v′ + h1 +

p2m, p, 2t) ∈ R2t

c := (cm, b′b′b′)

Decrypt: sk = sss, (cm, b′b′b′)

v = bbb′Tsss ∈ Rpm′ = chop(v − p

2tcm + h2, p, 2) ∈ R2

Page 14: SABER: Module-LWR based KEM - NIST · 2018. 9. 27. · Saber-KEM:k= 3,t= 23, = 4 3 2 136 primal 199 181 992 1344 1088 dual 198 180 FireSaber-KEM:k= 4,t= 25, = 3 5 2 165 primal 270

SABER Module-LWR Encryption 5/10

Equivalent of standard Regev-type LWE encryptionKeyGen:

seedAAA ← U({0, 1}256), AAA← gen(seedAAA) ∈ Rk×kq

sss← βµ(Rk×1q ), bbb = chop(AAAsss+ hhh, q, p) ∈ Rk×1p

pk := (bbb, seedAAA), sk := sss

Encrypt: pk = (bbb, seedAAA),m ∈M; r

AAA← gen(seedAAA) ∈ Rk×lq

s′s′s′ ← βµ(Rk×1q ), bbb′ = chop(AAATsss′ + hhh, q, p) ∈ Rk×1p

v′ = bbbTsss′ ∈ Rpcm = chop(v′ + h1 +

p2m, p, 2t) ∈ R2t

c := (cm, b′b′b′)

Decrypt: sk = sss, (cm, b′b′b′)

v = bbb′Tsss ∈ Rpm′ = chop(v − p

2tcm + h2, p, 2) ∈ R2

Page 15: SABER: Module-LWR based KEM - NIST · 2018. 9. 27. · Saber-KEM:k= 3,t= 23, = 4 3 2 136 primal 199 181 992 1344 1088 dual 198 180 FireSaber-KEM:k= 4,t= 25, = 3 5 2 165 primal 270

SABER Module-LWR KEM 6/10

KeyGen: same as before, but sk includes z ∈ U({0, 1}256)Encaps: pk = (bbb, seedAAA)

m← U({0, 1}256)(K, r) = G(pk,m)c = Saber.Enc(pk,m; r)K = H(K, c)return (c,K)

Decaps: sk = (sss, z), pk = (bbb, seedAAA), c

m′ = Saber.Dec(sss, c)(K ′, r′) = G(pk,m′)c′ = Saber.Enc(pk,m′; r′)if c = c′ return K = H(K ′, c)else return K = H(z, c)

Page 16: SABER: Module-LWR based KEM - NIST · 2018. 9. 27. · Saber-KEM:k= 3,t= 23, = 4 3 2 136 primal 199 181 992 1344 1088 dual 198 180 FireSaber-KEM:k= 4,t= 25, = 3 5 2 165 primal 270

SABER Module-LWR KEM Parameters 7/10

Common parameters: q = 213, p = 210, f(x) = x256 + 1

cat failure attack class. quant. pk (B) sk∗ (B) ct (B)

LightSaber-KEM: k = 2, t = 22, µ = 5

1 2−120primal 126 115

672 992 736dual 126 115

Saber-KEM: k = 3, t = 23, µ = 4

3 2−136primal 199 181

992 1344 1088dual 198 180

FireSaber-KEM: k = 4, t = 25, µ = 3

5 2−165primal 270 246

1312 1760 1472dual 270 245

∗ includes the public key

Page 17: SABER: Module-LWR based KEM - NIST · 2018. 9. 27. · Saber-KEM:k= 3,t= 23, = 4 3 2 136 primal 199 181 992 1344 1088 dual 198 180 FireSaber-KEM:k= 4,t= 25, = 3 5 2 165 primal 270

SABER Module-LWR KEM Performance 8/10

Platform: Intel(R) Core(TM) i7-6600U, 2.60GHz withhyper-threading, Turbo-Boost, and multi-core support disabled

Saber-KEM: C implementation

Keygen: 190,420 cyclesEncaps: 279,291 cyclesDecaps: 306,346 cycles

Saber-KEM: AVX2 optimized (can be improved)Keygen: 101,138 cyclesEncaps: 125,392 cyclesDecaps: 129,138 cycles

Page 18: SABER: Module-LWR based KEM - NIST · 2018. 9. 27. · Saber-KEM:k= 3,t= 23, = 4 3 2 136 primal 199 181 992 1344 1088 dual 198 180 FireSaber-KEM:k= 4,t= 25, = 3 5 2 165 primal 270

SABER KEM ⊕ and 9/10

⊕ Easy to implement: no modular reductions, no rounding, norejection sampling, no random lifting

⊕ Modular structure and flexibility: only need to implementarithmetic in Rq with q = 213 and f(x) = x256 + 1

⊕ Less randomness since no error sampling as for LWE⊕ Low bandwith: more compact than LWE-based schemes, even

with compression

No NTT, so resort to Karatsuba and Toom-Cook No signature scheme

Page 19: SABER: Module-LWR based KEM - NIST · 2018. 9. 27. · Saber-KEM:k= 3,t= 23, = 4 3 2 136 primal 199 181 992 1344 1088 dual 198 180 FireSaber-KEM:k= 4,t= 25, = 3 5 2 165 primal 270

SABER KEM ⊕ and 9/10

⊕ Easy to implement: no modular reductions, no rounding, norejection sampling, no random lifting

⊕ Modular structure and flexibility: only need to implementarithmetic in Rq with q = 213 and f(x) = x256 + 1

⊕ Less randomness since no error sampling as for LWE⊕ Low bandwith: more compact than LWE-based schemes, even

with compression No NTT, so resort to Karatsuba and Toom-Cook No signature scheme

Page 20: SABER: Module-LWR based KEM - NIST · 2018. 9. 27. · Saber-KEM:k= 3,t= 23, = 4 3 2 136 primal 199 181 992 1344 1088 dual 198 180 FireSaber-KEM:k= 4,t= 25, = 3 5 2 165 primal 270

SABER Conclusions 10/10

S

ecure p

A

daptable

B

elgian

E

fficient

R

ounding Trumps∗ all . . .∗ Research not funded by the Donald

Page 21: SABER: Module-LWR based KEM - NIST · 2018. 9. 27. · Saber-KEM:k= 3,t= 23, = 4 3 2 136 primal 199 181 992 1344 1088 dual 198 180 FireSaber-KEM:k= 4,t= 25, = 3 5 2 165 primal 270

SABER Conclusions 10/10

Simple

ecure p

A

daptable

B

elgian

E

fficient

R

ounding Trumps∗ all . . .∗ Research not funded by the Donald

Page 22: SABER: Module-LWR based KEM - NIST · 2018. 9. 27. · Saber-KEM:k= 3,t= 23, = 4 3 2 136 primal 199 181 992 1344 1088 dual 198 180 FireSaber-KEM:k= 4,t= 25, = 3 5 2 165 primal 270

SABER Conclusions 10/10

Secure pA

daptable

B

elgian

E

fficient

R

ounding Trumps∗ all . . .∗ Research not funded by the Donald

Page 23: SABER: Module-LWR based KEM - NIST · 2018. 9. 27. · Saber-KEM:k= 3,t= 23, = 4 3 2 136 primal 199 181 992 1344 1088 dual 198 180 FireSaber-KEM:k= 4,t= 25, = 3 5 2 165 primal 270

SABER Conclusions 10/10

Secure pAdaptableB

elgian

E

fficient

R

ounding Trumps∗ all . . .∗ Research not funded by the Donald

Page 24: SABER: Module-LWR based KEM - NIST · 2018. 9. 27. · Saber-KEM:k= 3,t= 23, = 4 3 2 136 primal 199 181 992 1344 1088 dual 198 180 FireSaber-KEM:k= 4,t= 25, = 3 5 2 165 primal 270

SABER Conclusions 10/10

Secure pAdaptableBelgianE

fficient

R

ounding Trumps∗ all . . .∗ Research not funded by the Donald

Page 25: SABER: Module-LWR based KEM - NIST · 2018. 9. 27. · Saber-KEM:k= 3,t= 23, = 4 3 2 136 primal 199 181 992 1344 1088 dual 198 180 FireSaber-KEM:k= 4,t= 25, = 3 5 2 165 primal 270

SABER Conclusions 10/10

Secure pAdaptableBelgianEfficientR

ounding Trumps∗ all . . .∗ Research not funded by the Donald

Page 26: SABER: Module-LWR based KEM - NIST · 2018. 9. 27. · Saber-KEM:k= 3,t= 23, = 4 3 2 136 primal 199 181 992 1344 1088 dual 198 180 FireSaber-KEM:k= 4,t= 25, = 3 5 2 165 primal 270

SABER Conclusions 10/10

Secure pAdaptableBelgianEfficientRounding Trumps∗ all . . .∗ Research not funded by the Donald