Elliptic Curve Cryptography and Security of Embedded Devices Ph.D. - - PowerPoint PPT Presentation

elliptic curve cryptography and security of embedded
SMART_READER_LITE
LIVE PREVIEW

Elliptic Curve Cryptography and Security of Embedded Devices Ph.D. - - PowerPoint PPT Presentation

Elliptic Curve Cryptography and Security of Embedded Devices Ph.D. Defense Vincent Verneuil Institut de Math ematiques de Bordeaux Inside Secure June 13th, 2012 V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices 1


slide-1
SLIDE 1

Elliptic Curve Cryptography and Security of Embedded Devices

Ph.D. Defense Vincent Verneuil

Institut de Math´ ematiques de Bordeaux Inside Secure

June 13th, 2012

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

1 / 64

slide-2
SLIDE 2

Outline

Introduction RSA and Elliptic Curve Cryptography Scalar Multiplication Implementation Side-Channel Analysis Improved Atomic Pattern for Scalar Multiplication Square Always Exponentiation Horizontal Correlation Analysis Long-Integer Multiplication Blinding and Shuffling Collision-Correlation Analysis on AES Conclusion

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

2 / 64

slide-3
SLIDE 3

Outline

Introduction RSA and Elliptic Curve Cryptography Scalar Multiplication Implementation Side-Channel Analysis Improved Atomic Pattern for Scalar Multiplication Square Always Exponentiation Horizontal Correlation Analysis Long-Integer Multiplication Blinding and Shuffling Collision-Correlation Analysis on AES Conclusion

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

2 / 64

slide-4
SLIDE 4

Outline

Introduction RSA and Elliptic Curve Cryptography Scalar Multiplication Implementation Side-Channel Analysis Improved Atomic Pattern for Scalar Multiplication Square Always Exponentiation Horizontal Correlation Analysis Long-Integer Multiplication Blinding and Shuffling Collision-Correlation Analysis on AES Conclusion

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

2 / 64

slide-5
SLIDE 5

RSA (Rivest-Shamir-Adleman)

A Method for Obtaining Digital Signatures and Public-Key Cryptosystems, 1978.

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

3 / 64

slide-6
SLIDE 6

RSA (Rivest-Shamir-Adleman)

A Method for Obtaining Digital Signatures and Public-Key Cryptosystems, 1978.

Key generation

◮ pick at random two primes p and q,

and compute n = p ×q

◮ choose e and compute d such that:

e ×d ≡ 1 mod (p −1)(q −1)

Public key

= {n,e}

Private key

= {p,q,d}

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

3 / 64

slide-7
SLIDE 7

RSA (Rivest-Shamir-Adleman)

Encryption / Decryption

To encrypt a message m: c = me mod n To decrypt c: m = cd mod n

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

4 / 64

slide-8
SLIDE 8

RSA (Rivest-Shamir-Adleman)

Encryption / Decryption

To encrypt a message m: c = me mod n To decrypt c: m = cd mod n

Security assumption

Given = {n,e}, how to recover d = e−1 mod (p −1)(q −1) ? Factorize n to recover p and q !

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

4 / 64

slide-9
SLIDE 9

Elliptic Curve Cryptography

Independently introduced by Koblitz and Miller in 1985.

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

5 / 64

slide-10
SLIDE 10

Elliptic Curve Equation

Let K be a field, and E /K an elliptic curve. Then the set of K-rational points E (K) ⊂ P2(K) is an abelian group, with neutral element O. On a field K = Fp, p > 3, it has an affine equation: y2 = x3 +ax +b

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

6 / 64

slide-11
SLIDE 11

Elliptic Curve Group Law

Let P1 = (x1,y1) and P2 = (x2,y2), P1,P2 = O. P3 = P1 +P2 is given by:

  • x3 = m2 −x1 −x2

y3 = m(x1 −x3)−y1

  • P1
  • P2

K = R

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

7 / 64

slide-12
SLIDE 12

Elliptic Curve Group Law

Let P1 = (x1,y1) and P2 = (x2,y2), P1,P2 = O. P3 = P1 +P2 is given by:

  • x3 = m2 −x1 −x2

y3 = m(x1 −x3)−y1 m = y2 −y1 x2 −x1 if P1 = ±P2

  • P1
  • P2
  • −P3
  • P3

O

K = R

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

7 / 64

slide-13
SLIDE 13

Elliptic Curve Group Law

Let P1 = (x1,y1) and P2 = (x2,y2), P1,P2 = O. P3 = P1 +P2 is given by:

  • x3 = m2 −x1 −x2

y3 = m(x1 −x3)−y1

  • P1 = P2

K = R

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

7 / 64

slide-14
SLIDE 14

Elliptic Curve Group Law

Let P1 = (x1,y1) and P2 = (x2,y2), P1,P2 = O. P3 = P1 +P2 is given by:

  • x3 = m2 −x1 −x2

y3 = m(x1 −x3)−y1 m = 3x12 +a 2y1 if P1 = P2

  • P1 = P2
  • −P3
  • P3

O

K = R

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

7 / 64

slide-15
SLIDE 15

Scalar Multiplication

Given a point P in E (K) and a positive integer d, we denote dP = P +P +···+P

  • d times

.

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

8 / 64

slide-16
SLIDE 16

Scalar Multiplication

Given a point P in E (K) and a positive integer d, we denote dP = P +P +···+P

  • d times

.

Elliptic Curve Discrete Logarithm Problem (ECDLP)

Given P in E (K) and dP, 1 ≤ d ≤ #E (K), find d ? Much harder than or factoring (which can be solved in subexponential time).

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

8 / 64

slide-17
SLIDE 17

Cryptosystems Comparison

Estimated equivalent key lengths for ECC and RSA: Security level 80 112 128 192 256 ECC 160 224 256 384 512 RSA 1024 2048 3072 8192 15360 ③ Very interesting in embedded devices having limited resources.

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

9 / 64

slide-18
SLIDE 18

Outline

Introduction RSA and Elliptic Curve Cryptography Scalar Multiplication Implementation Side-Channel Analysis Improved Atomic Pattern for Scalar Multiplication Square Always Exponentiation Horizontal Correlation Analysis Long-Integer Multiplication Blinding and Shuffling Collision-Correlation Analysis on AES Conclusion

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

9 / 64

slide-19
SLIDE 19

Embedded Devices Constraints

Efficiency

◮ Most transactions have to take less than 500 ms ◮ Small amount of RAM ◮ Very low power (hence low frequency) for contactless devices

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

10 / 64

slide-20
SLIDE 20

Embedded Devices Constraints

Efficiency

◮ Most transactions have to take less than 500 ms ◮ Small amount of RAM ◮ Very low power (hence low frequency) for contactless devices

Arithmetic optimizations

◮ Exponentiation / scalar multiplication ◮ Group operations and point representation ◮ Modular arithmetic

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

10 / 64

slide-21
SLIDE 21

Fp Operations Theoretical Cost

Expensive operations Significant operations Negligible operations

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

11 / 64

slide-22
SLIDE 22

Fp Operations Theoretical Cost

Expensive operations

◮ Inversion (I)

Significant operations Negligible operations

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

11 / 64

slide-23
SLIDE 23

Fp Operations Theoretical Cost

Expensive operations

◮ Inversion (I)

Significant operations

◮ Multiplication (M) ◮ Squaring (S, S/M ≈ 0.8)

Negligible operations

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

11 / 64

slide-24
SLIDE 24

Fp Operations Theoretical Cost

Expensive operations

◮ Inversion (I)

Significant operations

◮ Multiplication (M) ◮ Squaring (S, S/M ≈ 0.8)

Negligible operations

◮ Addition (A) ◮ Subtraction (A) ◮ Negation (N)

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

11 / 64

slide-25
SLIDE 25

Fp Operations Theoretical Cost

Expensive operations

◮ Inversion (I)

Significant operations

◮ Multiplication (M) ◮ Squaring (S, S/M ≈ 0.8)

Negligible operations

◮ Addition (A) ◮ Subtraction (A) ◮ Negation (N)

For ECC keylengths, A/M ≈ 0.2 and N/M ≈ 0.1

  • n most smart cards.
  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

11 / 64

slide-26
SLIDE 26

Exponentiation Algorithms

Square and multiply

Left-to-right Right-to-left

md = md0 ×

  • md1 ×
  • ...
  • mdℓ−12 ...

22 md = mdℓ−12ℓ−1 ×mdℓ−22ℓ−2 ×...×md0

Input: m,n,d ∈ N Output: md mod n a ← 1 for i = ℓ−1 to 0 do a ← a2 mod n if di = 1 then a ← a×m mod n return a Input: m,n,d ∈ N Output: md mod n a ← 1 ; b ← m for i = 0 to ℓ−1 do if di = 1 then a ← a×b mod n b ← b2 mod n return a

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

12 / 64

slide-27
SLIDE 27

Scalar Multiplication Algorithms

Double and add

Left-to-right Right-to-left

dP = d0P +2(d1P +2(...+2(dℓ−1P)...)) dP = dℓ−12ℓ−1P +dℓ−22ℓ−2P +...+d0P

Input: P ∈ E (K),d ∈ N Output: dP R ← O for i = ℓ−1 to 0 do R ← 2R if di = 1 then R ← R +P return R Input: P ∈ E (K),d ∈ N Output: dP R ← O ; Q ← P for i = 0 to ℓ−1 do if di = 1 then R ← R +Q Q ← 2Q return R

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

13 / 64

slide-28
SLIDE 28

Refined Algorithms

Non-Adjacent Form (NAF)

Signed representation minimizing the number of non-zero digits (1/3 vs 1/2). Hence minimize the number of additions.

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

14 / 64

slide-29
SLIDE 29

Refined Algorithms

Non-Adjacent Form (NAF)

Signed representation minimizing the number of non-zero digits (1/3 vs 1/2). Hence minimize the number of additions.

Sliding window algorithms

Precompute 3P,5P,... to process several scalar bits at a time. Can be combined with the NAF method.

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

14 / 64

slide-30
SLIDE 30

Refined Algorithms

Non-Adjacent Form (NAF)

Signed representation minimizing the number of non-zero digits (1/3 vs 1/2). Hence minimize the number of additions.

Sliding window algorithms

Precompute 3P,5P,... to process several scalar bits at a time. Can be combined with the NAF method.

Co-Z Addition

Euclidean Addition Chains [Meloni, WAIFI 2007] Co-Z binary ladder [Goundar, Joye & Miyaji, CHES 2010]

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

14 / 64

slide-31
SLIDE 31

Outline

Introduction RSA and Elliptic Curve Cryptography Scalar Multiplication Implementation Side-Channel Analysis Improved Atomic Pattern for Scalar Multiplication Square Always Exponentiation Horizontal Correlation Analysis Long-Integer Multiplication Blinding and Shuffling Collision-Correlation Analysis on AES Conclusion

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

14 / 64

slide-32
SLIDE 32

Side-Channel Analysis Framework

Cryptographic

  • peration

Inputs Outputs Secret key

slide-33
SLIDE 33

Side-Channel Analysis Framework

Device Outputs Cryptographic

  • peration

Inputs Secret key leakages

slide-34
SLIDE 34

Side-Channel Analysis Framework

Device Outputs Cryptographic

  • peration

Inputs Secret key leakages Measurements

slide-35
SLIDE 35

Side-Channel Analysis Framework

Device Outputs Cryptographic

  • peration

Inputs Secret key leakages Measurements Model & assumptions

slide-36
SLIDE 36

Side-Channel Analysis Framework

Device Outputs Cryptographic

  • peration

Inputs Secret key leakages Measurements Model & assumptions Information on secret key

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

15 / 64

slide-37
SLIDE 37

Simple Side-Channel Analysis (SSCA)

Left-to-right square & multiply

Side-channel leakage: power, EM, etc. The whole exponent may be recovered using a single trace.

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

16 / 64

slide-38
SLIDE 38

Regular Exponentiation

Left-to-right algorithms

Square & multiply:

. . .

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

17 / 64

slide-39
SLIDE 39

Regular Exponentiation

Left-to-right algorithms

Square & multiply:

. . .

Square & multiply always:

. . .

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

17 / 64

slide-40
SLIDE 40

Regular Exponentiation

Left-to-right algorithms

Square & multiply:

. . .

Square & multiply always:

. . .

Montgomery ladder:

. . .

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

17 / 64

slide-41
SLIDE 41

Regular Exponentiation Algorithms

Left-to-right “Montgomery ladder” Input: m,n,d ∈ N Output: md mod n

1: R0 ← 1 2: R1 ← m 3: for i = ℓ−1 to 0 do 4:

R1−di ← R0 ×R1 mod n

5:

Rdi ← Rdi

2 mod n

6: return R0

Right-to-left “Joye ladder” Input: m,n,d ∈ N Output: md mod n

1: R0 ← 1 2: R1 ← m 3: for i = 0 to ℓ−1 do 4:

R1−di ← R1−di

2 mod n

5:

R1−di ← R1−di ×Rdi mod n

6: return R0

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

18 / 64

slide-42
SLIDE 42

Regular Scalar Multiplication

Left-to-right algorithms

Double & add:

. . .

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

19 / 64

slide-43
SLIDE 43

Regular Scalar Multiplication

Left-to-right algorithms

Double & add:

. . .

Double & add always:

. . .

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

19 / 64

slide-44
SLIDE 44

Regular Scalar Multiplication

Left-to-right algorithms

Double & add:

. . .

Double & add always:

. . .

Montgomery ladders:

. . .

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

19 / 64

slide-45
SLIDE 45

Regular Scalar Multiplication Algorithms

Left-to-right “Montgomery ladder” Input: P ∈ E (K),d ∈ N Output: dP

1: R0 ← O 2: R1 ← P 3: for i = ℓ−1 to 0 do 4:

R1−di ← R0 +R1

5:

Rdi ← 2Rdi

6: return R0

Right-to-left “Joye ladder” Input: P ∈ E (K),d ∈ N Output: dP

1: R0 ← O 2: R1 ← P 3: for i = 0 to ℓ−1 do 4:

R1−di ← 2R1−di

5:

R1−di ← R1−di +Rdi

6: return R0

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

20 / 64

slide-46
SLIDE 46

Regular Atomic Exponentiation

Square & multiply:

. . .

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

21 / 64

slide-47
SLIDE 47

Regular Atomic Exponentiation

Square & multiply:

. . .

Atomic multiply always:

. . .

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

21 / 64

slide-48
SLIDE 48

Regular Atomic Scalar Multiplication

Double & add:

. . .

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

22 / 64

slide-49
SLIDE 49

Regular Atomic Scalar Multiplication

Double & add:

. . .

Atomic add always (with a unified group addition):

. . .

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

22 / 64

slide-50
SLIDE 50

Regular Atomic Scalar Multiplication

Double & add:

. . .

Atomic add always (with a unified group addition):

. . .

Atomic scalar multiplication using a smaller pattern:

. . . Dbl. Dbl. Add. Dbl. Add. . . .

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

22 / 64

slide-51
SLIDE 51

Leakage on Manipulated Data

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

23 / 64

slide-52
SLIDE 52

Leakage on Manipulated Data

Noise is generally too high to exploit this leakage directly ③

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

23 / 64

slide-53
SLIDE 53

Leakage on Manipulated Data

Noise is generally too high to exploit this leakage directly ③ Many acquisitions are used to reduce noise influence

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

23 / 64

slide-54
SLIDE 54

Differential Analysis Principle

Measure N times a side-channel leakage with different data involved and consider the traces T 1,T 2,...,T n. ③ T 1

t t +ω

T 2

t t +ω

. . . T N

t t +ω

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

24 / 64

slide-55
SLIDE 55

Differential Analysis Principle

Measure N times a side-channel leakage with different data involved and consider the traces T 1,T 2,...,T n.

◮ align vertically the traces on

the targeted operation using signal processing tools ③ T 1

t t +ω

T 2

t t +ω

. . . T N

t t +ω

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

24 / 64

slide-56
SLIDE 56

Differential Analysis Principle

Measure N times a side-channel leakage with different data involved and consider the traces T 1,T 2,...,T n.

◮ align vertically the traces on

the targeted operation using signal processing tools

◮ perform statistical treatment

between traces, known inputs

  • r outputs and a guess on a

few key bits ③ T 1

t t +ω

T 2

t t +ω

. . . T N

t t +ω

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

24 / 64

slide-57
SLIDE 57

Differential Analysis Principle

Measure N times a side-channel leakage with different data involved and consider the traces T 1,T 2,...,T n.

◮ align vertically the traces on

the targeted operation using signal processing tools

◮ perform statistical treatment

between traces, known inputs

  • r outputs and a guess on a

few key bits ③ Validate the guess or not T 1

t t +ω

T 2

t t +ω

. . . T N

t t +ω

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

24 / 64

slide-58
SLIDE 58

Differential Side-Channel Analysis

Original method introduced in [Kocher, Jaffe & Jun, CRYPTO’99]

◮ Hamming weight leakage model ◮ Difference of means as a distinguisher

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

25 / 64

slide-59
SLIDE 59

Differential Side-Channel Analysis

Original method introduced in [Kocher, Jaffe & Jun, CRYPTO’99]

◮ Hamming weight leakage model ◮ Difference of means as a distinguisher

Correlation analysis introduced in [Brier, Clavier & Olivier, CHES 2004]

◮ Hamming weight/distance leakage model ◮ Pearson correlation factor as a distinguisher

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

25 / 64

slide-60
SLIDE 60

Countermeasures for RSA Exponentiation

◮ Exponent blinding d′ = d +r(p −1)(q −1)

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

26 / 64

slide-61
SLIDE 61

Countermeasures for RSA Exponentiation

◮ Exponent blinding d′ = d +r(p −1)(q −1) ◮ Message/ciphertext additive blinding m′ = m +rn mod cn, r < c

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

26 / 64

slide-62
SLIDE 62

Countermeasures for RSA Exponentiation

◮ Exponent blinding d′ = d +r(p −1)(q −1) ◮ Message/ciphertext additive blinding m′ = m +rn mod cn, r < c ◮ Message/ciphertext multiplicative blinding m′ = r em mod n,

result recovered as r −1(m′)d mod n

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

26 / 64

slide-63
SLIDE 63

Countermeasures for Scalar Multiplication

From [Coron, CHES’99]:

◮ Scalar blinding d′ = d +r#E (Fp)

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

27 / 64

slide-64
SLIDE 64

Countermeasures for Scalar Multiplication

From [Coron, CHES’99]:

◮ Scalar blinding d′ = d +r#E (Fp) ◮ Base point projective coordinates blinding (r 2X : r 3Y : rZ)

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

27 / 64

slide-65
SLIDE 65

Countermeasures for Scalar Multiplication

From [Coron, CHES’99]:

◮ Scalar blinding d′ = d +r#E (Fp) ◮ Base point projective coordinates blinding (r 2X : r 3Y : rZ) ◮ Input point blinding Q = d(P +R), result recovered as Q −S with

S = dR

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

27 / 64

slide-66
SLIDE 66

Outline

Introduction RSA and Elliptic Curve Cryptography Scalar Multiplication Implementation Side-Channel Analysis Improved Atomic Pattern for Scalar Multiplication Square Always Exponentiation Horizontal Correlation Analysis Long-Integer Multiplication Blinding and Shuffling Collision-Correlation Analysis on AES Conclusion

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

27 / 64

slide-67
SLIDE 67

Our Contribution

◮ New atomic pattern for right-to-left scalar multiplication implementation ◮ Fastest implementation for standard curves considering addition cost

A/M ≥ 0.1

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

28 / 64

slide-68
SLIDE 68

Our Contribution

◮ New atomic pattern for right-to-left scalar multiplication implementation ◮ Fastest implementation for standard curves considering addition cost

A/M ≥ 0.1

Theoretical comparison (S/M = 0.8, A/M = 0.2)

Previous right-to-left NAF atomic scalar multiplication: - 20 % (M/bit) Best previous scalar multiplication (Co-Z Montgomery ladder (X :Z)-only):

  • 3.6 % (M/bit)
  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

28 / 64

slide-69
SLIDE 69

Atomic Right-to-Left Scalar Multiplication

Mixed coordinates

   ◮ Multiplication ◮ Addition ◮ Negation ◮ Addition

Operations expression using the atomic pattern

Addition :

  • [11M+5S]

Doubling :

  • [3M+5S]
  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

29 / 64

slide-70
SLIDE 70

Atomic Right-to-Left Scalar Multiplication

Mixed coordinates

   ◮ Multiplication ◮ Addition ◮ Negation ◮ Addition

   ◮ Squaring ◮ Addition ◮ Negation ◮ Addition

Operations expression using the atomic pattern

Addition :

  • [11M+5S]

Doubling :

  • [3M+5S]
  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

29 / 64

slide-71
SLIDE 71

Atomic Right-to-Left Scalar Multiplication

Mixed coordinates

   ◮ Multiplication ◮ Addition ◮ Negation ◮ Addition

   ◮ Squaring ◮ Addition ◮ Negation ◮ Addition

Operations expression using the atomic pattern

Addition :

  • [11M+5S]

Doubling :

  • [3M+5S]
  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

29 / 64

slide-72
SLIDE 72

Atomic Right-to-Left Scalar Multiplication

Mixed coordinates

   ◮ Multiplication ◮ Addition ◮ Negation ◮ Addition

   ◮ Squaring ◮ Addition ◮ Negation ◮ Addition

Operations expression using the atomic pattern

Addition : [11M+5S] Doubling :

  • [3M+5S]

Extended pattern :

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

29 / 64

slide-73
SLIDE 73

Atomic Right-to-Left Scalar Multiplication

◮Sq. ◮Add. ◮Neg. ◮Add. ◮Mult. ◮Add. ◮Neg. ◮Add. ◮Mult. ◮Add. ◮Neg. ◮Add. ◮Mult. ◮Add. ◮Neg. ◮Add. ◮Sq. ◮Add. ◮Neg. ◮Add. ◮Mult. ◮Add. ◮Neg. ◮Add. ◮Mult. ◮Add. ◮Neg. ◮Add. ◮Mult. ◮Add. ◮Neg. ◮Add.

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

30 / 64

slide-74
SLIDE 74

Atomic Right-to-Left Scalar Multiplication

  • Add. 1
  • Add. 2

◮Sq. ◮Add. ◮Neg. ◮Add. ◮Mult. ◮Add. ◮Neg. ◮Add. ◮Mult. ◮Add. ◮Neg. ◮Add. ◮Mult. ◮Add. ◮Neg. ◮Add. ◮Sq. ◮Add. ◮Neg. ◮Add. ◮Mult. ◮Add. ◮Neg. ◮Add. ◮Mult. ◮Add. ◮Neg. ◮Add. ◮Mult. ◮Add. ◮Neg. ◮Add.                                                             R1 ← Z22 ⋆ ⋆ ⋆ R2 ← X1 ·R1 ⋆ ⋆ ⋆ R1 ← R1 ·Z2 ⋆ ⋆ ⋆ R3 ← Y1 ·R1 ⋆ ⋆ ⋆ R1 ← Z12 ⋆ ⋆ ⋆ R4 ← R1 ·X2 ⋆ R4 ← −R4 R4 ← R2 +R4 R1 ← Z1 ·R1 ⋆ ⋆ ⋆ R1 ← R1 ·Y2 ⋆ R1 ← −R1 R1 ← R3 +R1                                                             R6 ← R42 ⋆ ⋆ ⋆ R5 ← Z1 ·Z2 ⋆ ⋆ ⋆ Z3 ← R5 ·R4 ⋆ ⋆ ⋆ R2 ← R2 ·R6 ⋆ R1 ← −R1 ⋆ R5 ← R12 ⋆ R3 ← −R3 ⋆ R4 ← R4 ·R6 R6 ← R5 +R4 R2 ← −R2 R6 ← R6 +R2 R3 ← R3 ·R4 X3 ← R2 +R6 ⋆ R2 ← X3 +R2 R1 ← R1 ·R2 Y3 ← R3 +R1 ⋆ ⋆

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

30 / 64

slide-75
SLIDE 75

Atomic Right-to-Left Scalar Multiplication

  • Add. 1
  • Add. 2

Dbl. ◮Sq. ◮Add. ◮Neg. ◮Add. ◮Mult. ◮Add. ◮Neg. ◮Add. ◮Mult. ◮Add. ◮Neg. ◮Add. ◮Mult. ◮Add. ◮Neg. ◮Add. ◮Sq. ◮Add. ◮Neg. ◮Add. ◮Mult. ◮Add. ◮Neg. ◮Add. ◮Mult. ◮Add. ◮Neg. ◮Add. ◮Mult. ◮Add. ◮Neg. ◮Add.                                                             R1 ← Z22 ⋆ ⋆ ⋆ R2 ← X1 ·R1 ⋆ ⋆ ⋆ R1 ← R1 ·Z2 ⋆ ⋆ ⋆ R3 ← Y1 ·R1 ⋆ ⋆ ⋆ R1 ← Z12 ⋆ ⋆ ⋆ R4 ← R1 ·X2 ⋆ R4 ← −R4 R4 ← R2 +R4 R1 ← Z1 ·R1 ⋆ ⋆ ⋆ R1 ← R1 ·Y2 ⋆ R1 ← −R1 R1 ← R3 +R1                                                             R6 ← R42 ⋆ ⋆ ⋆ R5 ← Z1 ·Z2 ⋆ ⋆ ⋆ Z3 ← R5 ·R4 ⋆ ⋆ ⋆ R2 ← R2 ·R6 ⋆ R1 ← −R1 ⋆ R5 ← R12 ⋆ R3 ← −R3 ⋆ R4 ← R4 ·R6 R6 ← R5 +R4 R2 ← −R2 R6 ← R6 +R2 R3 ← R3 ·R4 X3 ← R2 +R6 ⋆ R2 ← X3 +R2 R1 ← R1 ·R2 Y3 ← R3 +R1 ⋆ ⋆                                                             R1 ← X12 R2 ← Y1 +Y1 ⋆ ⋆ Z2 ← R2 ·Z1 R4 ← R1 +R1 ⋆ ⋆ R3 ← R2 ·Y1 R6 ← R3 +R3 ⋆ ⋆ R2 ← R6 ·R3 R1 ← R4 +R1 ⋆ R1 ← R1 +W1 R3 ← R12 ⋆ ⋆ ⋆ R4 ← R6 ·X1 R5 ← W1 +W1 R4 ← −R4 R3 ← R3 +R4 W2 ← R2 ·R5 X2 ← R3 +R4 R2 ← −R2 R6 ← R4 +X2 R4 ← R6 ·R1 ⋆ R4 ← −R4 Y2 ← R4 +R2

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

30 / 64

slide-76
SLIDE 76

Atomic Right-to-Left Scalar Multiplication

  • Add. 1
  • Add. 2

Dbl. ◮Sq. ◮Add. ◮Neg. ◮Add. ◮Mult. ◮Add. ◮Neg. ◮Add. ◮Mult. ◮Add. ◮Neg. ◮Add. ◮Mult. ◮Add. ◮Neg. ◮Add. ◮Sq. ◮Add. ◮Neg. ◮Add. ◮Mult. ◮Add. ◮Neg. ◮Add. ◮Mult. ◮Add. ◮Neg. ◮Add. ◮Mult. ◮Add. ◮Neg. ◮Add.                                                             R1 ← Z22 ⋆ ⋆ ⋆ R2 ← X1 ·R1 ⋆ ⋆ ⋆ R1 ← R1 ·Z2 ⋆ ⋆ ⋆ R3 ← Y1 ·R1 ⋆ ⋆ ⋆ R1 ← Z12 ⋆ ⋆ ⋆ R4 ← R1 ·X2 ⋆ R4 ← −R4 R4 ← R2 +R4 R1 ← Z1 ·R1 ⋆ ⋆ ⋆ R1 ← R1 ·Y2 ⋆ R1 ← −R1 R1 ← R3 +R1                                                             R6 ← R42 ⋆ ⋆ ⋆ R5 ← Z1 ·Z2 ⋆ ⋆ ⋆ Z3 ← R5 ·R4 ⋆ ⋆ ⋆ R2 ← R2 ·R6 ⋆ R1 ← −R1 ⋆ R5 ← R12 ⋆ R3 ← −R3 ⋆ R4 ← R4 ·R6 R6 ← R5 +R4 R2 ← −R2 R6 ← R6 +R2 R3 ← R3 ·R4 X3 ← R2 +R6 ⋆ R2 ← X3 +R2 R1 ← R1 ·R2 Y3 ← R3 +R1 ⋆ ⋆                                                             R1 ← X12 R2 ← Y1 +Y1 ⋆ ⋆ Z2 ← R2 ·Z1 R4 ← R1 +R1 ⋆ ⋆ R3 ← R2 ·Y1 R6 ← R3 +R3 ⋆ ⋆ R2 ← R6 ·R3 R1 ← R4 +R1 ⋆ R1 ← R1 +W1 R3 ← R12 ⋆ ⋆ ⋆ R4 ← R6 ·X1 R5 ← W1 +W1 R4 ← −R4 R3 ← R3 +R4 W2 ← R2 ·R5 X2 ← R3 +R4 R2 ← −R2 R6 ← R4 +X2 R4 ← R6 ·R1 ⋆ R4 ← −R4 Y2 ← R4 +R2

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

30 / 64

slide-77
SLIDE 77

Atomic Right-to-Left Scalar Multiplication

  • Add. 1
  • Add. 2

Dbl. ◮Sq. ◮Add. ◮Mult. ◮Add. ◮Mult. ◮Add. ◮Mult. ◮Add. ◮Neg. ◮Add. ◮Sq. ◮Neg. ◮Mult. ◮Add. ◮Neg. ◮Add. ◮Mult. ◮Add. ◮Neg. ◮Add. ◮Mult. ◮Add. ◮Neg. ◮Add.                                                             R1 ← Z22 ⋆ R2 ← X1 ·R1 ⋆ R1 ← R1 ·Z2 ⋆ R3 ← Y1 ·R1 ⋆ ⋆ ⋆ R1 ← Z12 ⋆ R4 ← R1 ·X2 ⋆ R4 ← −R4 R4 ← R2 +R4 R1 ← Z1 ·R1 ⋆ ⋆ ⋆ R1 ← R1 ·Y2 ⋆ R1 ← −R1 R1 ← R3 +R1                                                             R6 ← R42 ⋆ R5 ← Z1 ·Z2 ⋆ Z3 ← R5 ·R4 ⋆ R2 ← R2 ·R6 ⋆ R1 ← −R1 ⋆ R5 ← R12 R3 ← −R3 R4 ← R4 ·R6 R6 ← R5 +R4 R2 ← −R2 R6 ← R6 +R2 R3 ← R3 ·R4 X3 ← R2 +R6 ⋆ R2 ← X3 +R2 R1 ← R1 ·R2 Y3 ← R3 +R1 ⋆ ⋆                                                             R1 ← X12 R2 ← Y1 +Y1 Z2 ← R2 ·Z1 R4 ← R1 +R1 R3 ← R2 ·Y1 R6 ← R3 +R3 R2 ← R6 ·R3 R1 ← R4 +R1 ⋆ R1 ← R1 +W1 R3 ← R12 ⋆ R4 ← R6 ·X1 R5 ← W1 +W1 R4 ← −R4 R3 ← R3 +R4 W2 ← R2 ·R5 X2 ← R3 +R4 R2 ← −R2 R6 ← R4 +X2 R4 ← R6 ·R1 ⋆ R4 ← −R4 Y2 ← R4 +R2

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

30 / 64

slide-78
SLIDE 78

Atomic Right-to-Left Scalar Multiplication

  • Add. 1
  • Add. 2

Dbl. Sq. Add. Mult. Add. Mult. Add. Mult. Add. Add. Sq. Mult. Add. Sub. Mult. Sub. Sub. Mult. Sub.                                 R1 ← Z22 ⋆ R2 ← Y1 ·Z2 ⋆ R5 ← Y2 ·Z1 ⋆ R3 ← R1 ·R2 ⋆ ⋆ R4 ← Z12 R2 ← R5 ·R4 ⋆ R2 ← R2 −R3 R5 ← R1 ·X1 ⋆ ⋆ R6 ← X2 ·R4 R6 ← R6 −R5                                 R1 ← R62 ⋆ R4 ← R5 ·R1 ⋆ R5 ← R1 ·R6 ⋆ R1 ← Z1 ·R6 ⋆ ⋆ R6 ← R22 Z3 ← R1 ·Z2 R1 ← R4 +R4 R6 ← R6 −R1 R1 ← R5 ·R3 X3 ← R6 −R5 R4 ← R4 −X3 R3 ← R4 ·R2 Y3 ← R3 −R1                                 R1 ← X12 R2 ← Y1 +Y1 Z2 ← R2 ·Z1 R4 ← R1 +R1 R3 ← R2 ·Y1 R6 ← R3 +R3 R2 ← R6 ·R3 R1 ← R4 +R1 R1 ← R1 +W1 R3 ← R12 R4 ← R6 ·X1 R5 ← W1 +W1 R3 ← R3 −R4 W2 ← R2 ·R5 X2 ← R3 −R4 R6 ← R4 −X2 R4 ← R6 ·R1 Y2 ← R4 −R2

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

31 / 64

slide-79
SLIDE 79

Atomic Right-to-Left Scalar Multiplication

  • Add. 1
  • Add. 2

Dbl. Sq. Add. Mult. Add. Mult. Add. Mult. Add. Add. Sq. Mult. Add. Sub. Mult. Sub. Sub. Mult. Sub.                                 R1 ← Z22 ⋆ R2 ← Y1 ·Z2 ⋆ R5 ← Y2 ·Z1 ⋆ R3 ← R1 ·R2 ⋆ ⋆ R4 ← Z12 R2 ← R5 ·R4 ⋆ R2 ← R2 −R3 R5 ← R1 ·X1 ⋆ ⋆ R6 ← X2 ·R4 R6 ← R6 −R5                                 R1 ← R62 ⋆ R4 ← R5 ·R1 ⋆ R5 ← R1 ·R6 ⋆ R1 ← Z1 ·R6 ⋆ ⋆ R6 ← R22 Z3 ← R1 ·Z2 R1 ← R4 +R4 R6 ← R6 −R1 R1 ← R5 ·R3 X3 ← R6 −R5 R4 ← R4 −X3 R3 ← R4 ·R2 Y3 ← R3 −R1                                 R1 ← X12 R2 ← Y1 +Y1 Z2 ← R2 ·Z1 R4 ← R1 +R1 R3 ← R2 ·Y1 R6 ← R3 +R3 R2 ← R6 ·R3 R1 ← R4 +R1 R1 ← R1 +W1 R3 ← R12 R4 ← R6 ·X1 R5 ← W1 +W1 R3 ← R3 −R4 W2 ← R2 ·R5 X2 ← R3 −R4 R6 ← R4 −X2 R4 ← R6 ·R1 Y2 ← R4 −R2

8 multiplications → 6 multiplications + 2 squarings

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

31 / 64

slide-80
SLIDE 80

Atomic Right-to-Left Scalar Multiplication

  • Add. 1
  • Add. 2

Dbl. Sq. Add. Mult. Add. Mult. Add. Mult. Add. Add. Sq. Mult. Add. Sub. Mult. Sub. Sub. Mult. Sub.                                 R1 ← Z22 ⋆ R2 ← Y1 ·Z2 ⋆ R5 ← Y2 ·Z1 ⋆ R3 ← R1 ·R2 ⋆ ⋆ R4 ← Z12 R2 ← R5 ·R4 ⋆ R2 ← R2 −R3 R5 ← R1 ·X1 ⋆ ⋆ R6 ← X2 ·R4 R6 ← R6 −R5                                 R1 ← R62 ⋆ R4 ← R5 ·R1 ⋆ R5 ← R1 ·R6 ⋆ R1 ← Z1 ·R6 ⋆ ⋆ R6 ← R22 Z3 ← R1 ·Z2 R1 ← R4 +R4 R6 ← R6 −R1 R1 ← R5 ·R3 X3 ← R6 −R5 R4 ← R4 −X3 R3 ← R4 ·R2 Y3 ← R3 −R1                                 R1 ← X12 R2 ← Y1 +Y1 Z2 ← R2 ·Z1 R4 ← R1 +R1 R3 ← R2 ·Y1 R6 ← R3 +R3 R2 ← R6 ·R3 R1 ← R4 +R1 R1 ← R1 +W1 R3 ← R12 R4 ← R6 ·X1 R5 ← W1 +W1 R3 ← R3 −R4 W2 ← R2 ·R5 X2 ← R3 −R4 R6 ← R4 −X2 R4 ← R6 ·R1 Y2 ← R4 −R2

8 multiplications → 6 multiplications + 2 squarings 16 additions → 6 additions + 4 subtractions

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

31 / 64

slide-81
SLIDE 81

Atomic Right-to-Left Scalar Multiplication

  • Add. 1
  • Add. 2

Dbl. Sq. Add. Mult. Add. Mult. Add. Mult. Add. Add. Sq. Mult. Add. Sub. Mult. Sub. Sub. Mult. Sub.                                 R1 ← Z22 ⋆ R2 ← Y1 ·Z2 ⋆ R5 ← Y2 ·Z1 ⋆ R3 ← R1 ·R2 ⋆ ⋆ R4 ← Z12 R2 ← R5 ·R4 ⋆ R2 ← R2 −R3 R5 ← R1 ·X1 ⋆ ⋆ R6 ← X2 ·R4 R6 ← R6 −R5                                 R1 ← R62 ⋆ R4 ← R5 ·R1 ⋆ R5 ← R1 ·R6 ⋆ R1 ← Z1 ·R6 ⋆ ⋆ R6 ← R22 Z3 ← R1 ·Z2 R1 ← R4 +R4 R6 ← R6 −R1 R1 ← R5 ·R3 X3 ← R6 −R5 R4 ← R4 −X3 R3 ← R4 ·R2 Y3 ← R3 −R1                                 R1 ← X12 R2 ← Y1 +Y1 Z2 ← R2 ·Z1 R4 ← R1 +R1 R3 ← R2 ·Y1 R6 ← R3 +R3 R2 ← R6 ·R3 R1 ← R4 +R1 R1 ← R1 +W1 R3 ← R12 R4 ← R6 ·X1 R5 ← W1 +W1 R3 ← R3 −R4 W2 ← R2 ·R5 X2 ← R3 −R4 R6 ← R4 −X2 R4 ← R6 ·R1 Y2 ← R4 −R2

8 multiplications → 6 multiplications + 2 squarings 16 additions → 6 additions + 4 subtractions 8 negations → 0

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

31 / 64

slide-82
SLIDE 82

Implementation

192 bits ECDSA @ 30 MHz (CPU) & 50 MHz (CC) Original : 35 ms, Improved : 30 ms (- 14.5 %) Comparable RAM (≈ 500 Bytes) and Code size (≈ 3 KB)

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

32 / 64

slide-83
SLIDE 83

Outline

Introduction RSA and Elliptic Curve Cryptography Scalar Multiplication Implementation Side-Channel Analysis Improved Atomic Pattern for Scalar Multiplication Square Always Exponentiation Horizontal Correlation Analysis Long-Integer Multiplication Blinding and Shuffling Collision-Correlation Analysis on AES Conclusion

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

32 / 64

slide-84
SLIDE 84

Our Contribution

◮ New atomic algorithms using squarings only ◮ Immune to attacks distinguishing squarings from multiplications ◮ Better efficiency than regular ladders ◮ Exponentiation algorithms for parallelized squarings with best

performances to our knowledge

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

33 / 64

slide-85
SLIDE 85

Exponentiation Cost Summary

Algorithm Cost / bit S/M = 1 S/M = .8 # reg Square & multiply 1,2,3 0.5M +1S 1.5M 1.3M 2 Multiply always 2,3 1.5M 1.5M 1.5M 2 Regular ladders 1M +1S 2M 1.8M 2

1 algorithm unprotected towards the SPA 2 algorithm sensitive to S – M discrimination 3 possible sliding window optimization

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

34 / 64

slide-86
SLIDE 86

Replacing Multiplications by Squarings

x ×y = (x +y)2 −x2 −y2 2 (1) x ×y = x +y 2 2 − x −y 2 2 (2)

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

35 / 64

slide-87
SLIDE 87

Regular Atomic Exponentiation

Square & multiply:

. . .

Atomic Multiply always:

. . .

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

36 / 64

slide-88
SLIDE 88

Regular Atomic Exponentiation

Square & multiply:

. . .

Atomic Multiply always:

. . .

Atomic Square always:

. . .

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

36 / 64

slide-89
SLIDE 89

Atomic Left-to-Right Algorithm

Input: m,n,d ∈ N Output: md mod n

1: R0 ← 1 ; R1 ← m ; R2 ← 1 2: R3 ← m2/2 mod n 3: j ← 0 ; i ← k −1 4: while i ≥ 0 do 5:

RMj,0 ← RMj,1 +RMj,2 mod n

6:

RMj,3 ← RMj,3

2 mod n

7:

RMj,4 ← RMj,5/2 mod n

8:

RMj,6 ← RMj,7 −RMj,8 mod n

9:

j ← di(1+(j mod 3))

10:

i ← i −Mj,9

11: return R0 j = 0 j = 1 j = 2 j = 3 1 bit 0 bit 1 bit 0 bit M =     1 1 1 2 1 1 1 2 1 2 1 2 2 2 2 2 3 1 1 3 2 3 3 3 3 3 1 1 3 1    

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

37 / 64

slide-90
SLIDE 90

Atomic Right-to-Left Algorithm

Input: m,n,d ∈ N Output: md mod n

1: R0 ← m ; R1 ← 1 ; R2 ← 1 2: i ← 0 ; j ← 0 3: while i ≤ k −1 do 4:

j ← di(1+(j mod 3))

5:

RMj,0 ← RMj,1 +R0 mod n

6:

RMj,2 ← RMj,3/2 mod n

7:

RMj,4 ← RMj,5 −RMj,6 mod n

8:

RMj,3 ← RMj,3

2 mod n

9:

i ← i +Mj,7

10: return R1 j = 0 j = 1 j = 2 j = 3 1 bit 0 bit 1 bit 0 bit M =     2 2 1 2 1 2 2 1 1 2 1 1 2 1 2 1 1    

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

38 / 64

slide-91
SLIDE 91

Cost Comparison

Algorithm Cost / bit S/M = 1 S/M = .8 # reg Square & multiply 1,2,3 0.5M +1S 1.5M 1.3M 2 Multiply always 2,3 1.5M 1.5M 1.5M 2 Regular ladder 1M +1S 2M 1.8M 2 L.-to-r. square always3 2S 2M 1.6M 4 R.-to-l. square always3 2S 2M 1.6M 3 → 11 % speed-up over Montgomery ladder

1 algorithm unprotected towards the SPA 2 algorithm sensitive to S – M discrimination 3 possible sliding window optimization

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

39 / 64

slide-92
SLIDE 92

Implementation

AT90SC chip @ 30MHz with AdvX arithmetic coprocessor:

Algorithm Key len. (b) Code (B) RAM (B) Timing (ms)

  • Mont. ladder

512 360 128 30 1024 360 256 200 2048 360 512 1840 Square Always 512 510 192 28 1024 510 384 190 2048 510 768 1740

→ 5 % practical speed-up obtained in practice

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

40 / 64

slide-93
SLIDE 93

Parallelization

Motivation:

◮ Many devices are equipped with multi-core processors ◮ Parallelized Montgomery ladder : 1M / bit ◮ Squarings are independent in equations (1) and (2)

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

41 / 64

slide-94
SLIDE 94

Parallelization

Motivation:

◮ Many devices are equipped with multi-core processors ◮ Parallelized Montgomery ladder : 1M / bit ◮ Squarings are independent in equations (1) and (2)

We study how to optimize square always algorithms if two parallel squarings are available using space/time trade-offs.

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

41 / 64

slide-95
SLIDE 95

Cost Summary

We demonstrate that the cost of our parallelized algorithm using λ extra registers tends to:

  • 1+

1 4λ +2

  • S

Algorithm General cost S/M = 1 S/M = 0.8 Parallel Montgomery ladder 1M 1M 1M Parallel square always λ = 1 7S/6 1.17M 0.93M Parallel square always λ = 2 11S/10 1.10M 0.88M Parallel square always λ = 3 15S/14 1.07M 0.86M . . . . . . . . . . . . Parallel square always λ → ∞ 1S 1M 0.8M

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

42 / 64

slide-96
SLIDE 96

Outline

Introduction RSA and Elliptic Curve Cryptography Scalar Multiplication Implementation Side-Channel Analysis Improved Atomic Pattern for Scalar Multiplication Square Always Exponentiation Horizontal Correlation Analysis Long-Integer Multiplication Blinding and Shuffling Collision-Correlation Analysis on AES Conclusion

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

42 / 64

slide-97
SLIDE 97

Our Contribution

◮ New differential analysis on exponentiation using a single trace ◮ Any exponentiation algorithm can be subject to this attack ◮ Circumvent the exponent blinding countermeasure ◮ Require the knowledge of underlying modular multiplication

implementation

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

43 / 64

slide-98
SLIDE 98

Modular Multiplication Implementation

Schoolbook long-integer multiplication x ×y in base b with x,y < bk

Input: x = (xk−1xk−2 ...x0)b, y = (yk−1yk−2 ...y0)b Output: x ×y Uses: w = (w2k−1w2k−2 ...w0)

1: w ← (00...0) 2: for i = 0 to k −1 do 3:

c ← 0

4:

for j = 0 to k −1 do

5:

(uv)b ← wi+j +xi ×yj +c

6:

wi+j ← v

7:

c ← u

8:

wi+k ← c

9: return w

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

44 / 64

slide-99
SLIDE 99

Modular Multiplication Implementation

Rows and columns xk−1 . . . x2 x1 x0 × yk−1 . . . y2 y1 y0 + x0yk−1 . . . x0y2 x0y1 x0y0 + x1yk−1 x1yk−2 . . . x1y1 x1y0 + x2yk−1 x2yk−2 x2yk−3 . . . x2y0 . . . ... + xk−2yk−1 . . . xk−2y2 xk−2y1 xk−2y0 + xk−1yk−1 xk−1yk−2 . . . xk−1y1 xk−1y0 w2k−1 w2k−2 w2k−3 . . . w2 w1 w0

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

45 / 64

slide-100
SLIDE 100

Horizontal Correlation Analysis

Vertical: Horizontal:

. . . . . . . . . . . . . . . . . . . . .

  • Uses N segments from different

traces.

  • Uses k2 segments from a single

trace.

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

46 / 64

slide-101
SLIDE 101

Horizontal Side-Channel Analysis

T

T 1 T 2 T 3 . . . T s T s+1 T s+2 . . .

Ts 0,0 Ts 0,2

. . .

Ts 1,0 Ts 1,2

. . .

Ts 1,k−1

. . .

Ts k−1,0 Ts k−1,2

. . .

Ts k−1,k−1

We target single-multiplication segments T s

i,j of the s-th modular

multiplication inside a single leakage trace T.

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

47 / 64

slide-102
SLIDE 102

Horizontal Correlation Analysis

Considering an atomic multiply-always implementation: Input: m,n,d ∈ N Output: md mod n

1: R0 ← 1 2: R1 ← m 3: i ← ℓ−1 4: t ← 0 5: while i ≥ 0 do 6:

R0 ← R0 ×Rt mod n

7:

t ← t ⊕di

8:

i ← i −1+t

9: return R0

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

48 / 64

slide-103
SLIDE 103

Horizontal Correlation Analysis

Considering an atomic multiply-always implementation: Input: m,n,d ∈ N Output: md mod n

1: R0 ← 1 2: R1 ← m 3: i ← ℓ−1 4: t ← 0 5: while i ≥ 0 do 6:

R0 ← R0 ×Rt mod n

7:

t ← t ⊕di

8:

i ← i −1+t

9: return R0

◮ Execute a single RSA signature

md mod n and collect the execution power trace T.

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

48 / 64

slide-104
SLIDE 104

Horizontal Correlation Analysis

Considering an atomic multiply-always implementation: Input: m,n,d ∈ N Output: md mod n

1: R0 ← 1 2: R1 ← m 3: i ← ℓ−1 4: t ← 0 5: while i ≥ 0 do 6:

R0 ← R0 ×Rt mod n

7:

t ← t ⊕di

8:

i ← i −1+t

9: return R0

◮ Execute a single RSA signature

md mod n and collect the execution power trace T.

◮ Assuming u most significant bits of d are

known by the attacker: d = (dℓ−1 ...dℓ−u dℓ−(u+1) ...d1d0)

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

48 / 64

slide-105
SLIDE 105

Horizontal Correlation Analysis

Considering an atomic multiply-always implementation: Input: m,n,d ∈ N Output: md mod n

1: R0 ← 1 2: R1 ← m 3: i ← ℓ−1 4: t ← 0 5: while i ≥ 0 do 6:

R0 ← R0 ×Rt mod n

7:

t ← t ⊕di

8:

i ← i −1+t

9: return R0

◮ Execute a single RSA signature

md mod n and collect the execution power trace T.

◮ Assuming u most significant bits of d are

known by the attacker: d = (dℓ−1 ...dℓ−u dℓ−(u+1) ...d1d0)

◮ Let R(u)

denote the value of R0 after processing the u-th bit of d: R(u) = mdℓ−1...dℓ−u mod n

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

48 / 64

slide-106
SLIDE 106

Horizontal Correlation Analysis

Let v = u +HW(dℓ−1 ...dℓ−u) i.e. u-th bit ← → multiplication T v

R(u)

0 ✏✏✏

✶ PPP q

dℓ−u−1= 1 dℓ−u−1= 0

R(u) ×R(u) R(u) ×R(u)

✲ R(u)

2

×m

dℓ−u−2= 0,1

R(u)

2

×R(u)

2

··· ··· T v+1 T v+2

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

49 / 64

slide-107
SLIDE 107

Horizontal Correlation Analysis

Let v = u +HW(dℓ−1 ...dℓ−u) i.e. u-th bit ← → multiplication T v

R(u)

0 ✏✏✏

✶ PPP q

dℓ−u−1= 1 dℓ−u−1= 0

R(u) ×R(u) R(u) ×R(u)

✲ R(u)

2

×m

dℓ−u−2= 0,1

R(u)

2

×R(u)

2

··· ··· T v+1 T v+2

◮ Compute correlation between:

◮ trace segments T v+2

i,j

and values Dj = mj

  • r

◮ trace segments T v+2

i,j

and values Di,j = R(u)

0,i ×mj

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

49 / 64

slide-108
SLIDE 108

Horizontal Correlation Analysis

Let v = u +HW(dℓ−1 ...dℓ−u) i.e. u-th bit ← → multiplication T v

R(u)

0 ✏✏✏

✶ PPP q

dℓ−u−1= 1 dℓ−u−1= 0

R(u) ×R(u) R(u) ×R(u)

✲ R(u)

2

×m

dℓ−u−2= 0,1

R(u)

2

×R(u)

2

··· ··· T v+1 T v+2

◮ Compute correlation between:

◮ trace segments T v+2

i,j

and values Dj = mj

  • r

◮ trace segments T v+2

i,j

and values Di,j = R(u)

0,i ×mj ◮ If correlation peak: dℓ−(u+1) = 1, or dℓ−(u+1) = 0 otherwise.

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

49 / 64

slide-109
SLIDE 109

Experimental Results

Correlation trace result on series of traces T v+2

i,j

with Dj = mj Correlation trace result on series of segments T v+2

i,j

with Di,j = R(u)

0,i ×mj

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

50 / 64

slide-110
SLIDE 110

Outline

Introduction RSA and Elliptic Curve Cryptography Scalar Multiplication Implementation Side-Channel Analysis Improved Atomic Pattern for Scalar Multiplication Square Always Exponentiation Horizontal Correlation Analysis Long-Integer Multiplication Blinding and Shuffling Collision-Correlation Analysis on AES Conclusion

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

50 / 64

slide-111
SLIDE 111

Our Contribution

◮ New countermeasure against differential analysis for RSA and

ECC

◮ Designed to protect from horizontal analysis ◮ Implemented at the multi-precision multiplication level

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

51 / 64

slide-112
SLIDE 112

Long-Integer Multiplication

Shuffling rows and blinding columns

Let us shuffle the rows of the multiplication:

xk−1 . . . x2 x1 x0 × yk−1 . . . y2 y1 y0 + x0yk−1 . . . x0y2 x0y1 x0y0 + x1yk−1 x1yk−2 . . . x1y1 x1y0 + x2yk−1 x2yk−2 x2yk−3 . . . x2y0 . . . ... + xk−2yk−1 . . . xk−2y2 xk−2y1 xk−2y0 + xk−1yk−1 xk−1yk−2 . . . xk−1y1 xk−1y0 w2k−1 w2k−2 w2k−3 . . . w2 w1 w0 ③ ③ ③

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

52 / 64

slide-113
SLIDE 113

Long-Integer Multiplication

Shuffling rows and blinding columns

Choose at random a permutation α of (0,1,...,k −1) and compute: (c,wα(i)+j)b = wα(i)+j +xα(i) ×yj +c

xk−1 . . . x2 x1 x0 × yk−1 . . . y2 y1 y0 + xk−2yk−1 . . . xk−2y2 xk−2y1 xk−2y0 + x0yk−1 . . . x0y2 x0y1 x0y0 + x2yk−1 x2yk−2 x2yk−3 . . . x2y0 . . . . . . + xk−1yk−1 xk−1yk−2 . . . xk−1y1 xk−1y0 + x1yk−1 x1yk−2 . . . x1y1 x1y0 w2k−1 w2k−2 w2k−3 . . . w2 w1 w0 ③ ③ ③

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

52 / 64

slide-114
SLIDE 114

Long-Integer Multiplication

Shuffling rows and blinding columns

Choose at random a permutation α of (0,1,...,k −1) and compute: (c,wα(i)+j)b = wα(i)+j +xα(i) ×yj +c Still necessary to blind columns: For each row α(i), choose at random a word r, compute and store r ×xα(i), blind each single-precision multiplication: (c,wα(i)+j)b = wα(i)+j +xα(i) ×(yj −r)+r ×xα(i) +c ③ ③ ③

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

52 / 64

slide-115
SLIDE 115

Long-Integer Multiplication

Shuffling rows and blinding columns

Choose at random a permutation α of (0,1,...,k −1) and compute: (c,wα(i)+j)b = wα(i)+j +xα(i) ×yj +c Still necessary to blind columns: For each row α(i), choose at random a word r, compute and store r ×xα(i), blind each single-precision multiplication: (c,wα(i)+j)b = wα(i)+j +xα(i) ×(yj −r)+r ×xα(i) +c ③ Provides k! different sequences of single-precision multiplications. ③ ③

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

52 / 64

slide-116
SLIDE 116

Long-Integer Multiplication

Shuffling rows and blinding columns

Choose at random a permutation α of (0,1,...,k −1) and compute: (c,wα(i)+j)b = wα(i)+j +xα(i) ×yj +c Still necessary to blind columns: For each row α(i), choose at random a word r, compute and store r ×xα(i), blind each single-precision multiplication: (c,wα(i)+j)b = wα(i)+j +xα(i) ×(yj −r)+r ×xα(i) +c ③ Provides k! different sequences of single-precision multiplications. ③ Requires k extra multiplications and 3 extra words of storage. ③

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

52 / 64

slide-117
SLIDE 117

Long-Integer Multiplication

Shuffling rows and blinding columns

Choose at random a permutation α of (0,1,...,k −1) and compute: (c,wα(i)+j)b = wα(i)+j +xα(i) ×yj +c Still necessary to blind columns: For each row α(i), choose at random a word r, compute and store r ×xα(i), blind each single-precision multiplication: (c,wα(i)+j)b = wα(i)+j +xα(i) ×(yj −r)+r ×xα(i) +c ③ Provides k! different sequences of single-precision multiplications. ③ Requires k extra multiplications and 3 extra words of storage. ③ Saves k +1 multiplications and 4k −1 words of storage compared to the full blinding countermeasure.

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

52 / 64

slide-118
SLIDE 118

Long-Integer Multiplication

Shuffling rows and columns

Let us now shuffle the rows and the columns of the multiplication: ③ ③ ③

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

53 / 64

slide-119
SLIDE 119

Long-Integer Multiplication

Shuffling rows and columns

Let us now shuffle the rows and the columns of the multiplication: Choose at random two permutations α,β of (0,1,...,k −1) and compute: (cβ(j),wα(i)+β(j))b = wα(i)+β(j) +xα(i) ×yβ(j) Carry propagation is more complicated and requires a k-word array c. ③ ③ ③

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

53 / 64

slide-120
SLIDE 120

Long-Integer Multiplication

Shuffling rows and columns

Let us now shuffle the rows and the columns of the multiplication: Choose at random two permutations α,β of (0,1,...,k −1) and compute: (cβ(j),wα(i)+β(j))b = wα(i)+β(j) +xα(i) ×yβ(j) Carry propagation is more complicated and requires a k-word array c. ③ Provides (k!)2 different sequences of single-precision multiplications. ③ ③

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

53 / 64

slide-121
SLIDE 121

Long-Integer Multiplication

Shuffling rows and columns

Let us now shuffle the rows and the columns of the multiplication: Choose at random two permutations α,β of (0,1,...,k −1) and compute: (cβ(j),wα(i)+β(j))b = wα(i)+β(j) +xα(i) ×yβ(j) Carry propagation is more complicated and requires a k-word array c. ③ Provides (k!)2 different sequences of single-precision multiplications. ③ Requires no extra multiplication but k extra words of storage. ③

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

53 / 64

slide-122
SLIDE 122

Long-Integer Multiplication

Shuffling rows and columns

Let us now shuffle the rows and the columns of the multiplication: Choose at random two permutations α,β of (0,1,...,k −1) and compute: (cβ(j),wα(i)+β(j))b = wα(i)+β(j) +xα(i) ×yβ(j) Carry propagation is more complicated and requires a k-word array c. ③ Provides (k!)2 different sequences of single-precision multiplications. ③ Requires no extra multiplication but k extra words of storage. ③ Saves k multiplications but uses additional storage compared to the previous countermeasure.

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

53 / 64

slide-123
SLIDE 123

Long-Integer Multiplication

For instance, using a 32-bit multiplier: bit length k! (k!)2 256 ≈ 215 ≈ 230 512 ≈ 244 ≈ 288 1024 ≈ 2117 ≈ 2235 ③ ③

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

54 / 64

slide-124
SLIDE 124

Long-Integer Multiplication

For instance, using a 32-bit multiplier: bit length k! (k!)2 256 ≈ 215 ≈ 230 512 ≈ 244 ≈ 288 1024 ≈ 2117 ≈ 2235 ③ Also compatible with interleaved multiplications and reductions. ③

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

54 / 64

slide-125
SLIDE 125

Long-Integer Multiplication

For instance, using a 32-bit multiplier: bit length k! (k!)2 256 ≈ 215 ≈ 230 512 ≈ 244 ≈ 288 1024 ≈ 2117 ≈ 2235 ③ Also compatible with interleaved multiplications and reductions. ③ Studying the cost of these countermeasures for hardware implementations requires further investigation.

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

54 / 64

slide-126
SLIDE 126

Outline

Introduction RSA and Elliptic Curve Cryptography Scalar Multiplication Implementation Side-Channel Analysis Improved Atomic Pattern for Scalar Multiplication Square Always Exponentiation Horizontal Correlation Analysis Long-Integer Multiplication Blinding and Shuffling Collision-Correlation Analysis on AES Conclusion

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

54 / 64

slide-127
SLIDE 127

Our Contribution

◮ Improved collision-correlation techniques on AES defeating

some first-order protected implementations

◮ Need less than 1500 acquisitions in our experiments ◮ No need to establish a consumption model for correlation

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

55 / 64

slide-128
SLIDE 128

AES Overview

We focus on AES-128:

◮ message M = (m0 m1 ... m15) ◮ key K = (k0 k1 ... k15) ◮ ciphertext C = (c0 c1 ... c15) ◮ for i ∈ [0,15] we denote xi = mi ⊕ki

AES

message key SubBytes ShiftRows MixColumns subkey 1 ciphertext

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

56 / 64

slide-129
SLIDE 129

AES Overview

We focus on AES-128:

◮ message M = (m0 m1 ... m15) ◮ key K = (k0 k1 ... k15) ◮ ciphertext C = (c0 c1 ... c15) ◮ for i ∈ [0,15] we denote xi = mi ⊕ki

Our attack targets the first round SubBytes function AES

message key SubBytes ShiftRows MixColumns subkey 1 ciphertext

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

56 / 64

slide-130
SLIDE 130

Principle

Detect internal collisions between data processed in blinded S-Boxes in the first AES round:

data1⊕mask = data2⊕mask

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

57 / 64

slide-131
SLIDE 131

Principle

Detect internal collisions between data processed in blinded S-Boxes in the first AES round:

data1⊕mask = data2⊕mask

Two protections against first-order attacks are considered:

  • 1. substitution table masking: S′(xi ⊕u) = S(xi)⊕v, with u = v

same masks u and v for all bytes

  • 2. masked pseudo-inversion in F28 : I′(xi ⊕ui) = I(xi)⊕ui, for 0 ≤ i ≤ 15

16 different masks but same input and output masks

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

57 / 64

slide-132
SLIDE 132

Collision-Correlation Analysis

◮ Encrypt N times the same message M ◮ Collect the power traces T n, 0 ≤ n ≤ N −1 T 0 T 1 . . . T N−1

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

58 / 64

slide-133
SLIDE 133

Collision-Correlation Analysis

◮ Encrypt N times the same message M ◮ Collect the power traces T n, 0 ≤ n ≤ N −1 ◮ Consider two instructions whose

processing starts at times t0 and t1 l points are acquired per instruction processing

T 0

t0 t0 +l t1 t1 +l

T 1

t0 t0 +l t1 t1 +l

. . . T N−1

t0 t0 +l t1 t1 +l

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

58 / 64

slide-134
SLIDE 134

Collision-Correlation Analysis

◮ Encrypt N times the same message M ◮ Collect the power traces T n, 0 ≤ n ≤ N −1 ◮ Consider two instructions whose

processing starts at times t0 and t1 l points are acquired per instruction processing

◮ Construct the two series Θ0 = (T n

t0)n and

Θ1 = (T n

t1)n of power consumptions

segments

T 0

t0 t0 +l t1 t1 +l

T 1

t0 t0 +l t1 t1 +l

. . . T N−1

t0 t0 +l t1 t1 +l

Θ0 Θ1

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

58 / 64

slide-135
SLIDE 135

Collision-Correlation Analysis

◮ Encrypt N times the same message M ◮ Collect the power traces T n, 0 ≤ n ≤ N −1 ◮ Consider two instructions whose

processing starts at times t0 and t1 l points are acquired per instruction processing

◮ Construct the two series Θ0 = (T n

t0)n and

Θ1 = (T n

t1)n of power consumptions

segments

T 0

t0 t0 +l t1 t1 +l

T 1

t0 t0 +l t1 t1 +l

. . . T N−1

t0 t0 +l t1 t1 +l

Θ0 Θ1 ◮ Apply a statistical treatment to (Θ0,Θ1) to identify if same data was involved in T n

t0 and T n t1

◮ We choose the Pearson correlation factor

ˆ ρΘ0,Θ1(t) = cov(Θ0(t),Θ1(t)) σΘ0(t)σΘ1(t)

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

58 / 64

slide-136
SLIDE 136

First Attack Description (1)

Principle: detect when two SubBytes inputs (and outputs) are equal in first AES round

m4 ⊕k4 ⊕u m9 ⊕k9 ⊕u =

x′ x′

1

x′

2

x′

3

x′

4

x′

5

x′

6

x′

7

x′

8

x′

9 x′ 10 x′ 11 x′ 12 x′ 13 x′ 14 x′ 15

S′ S′ S′ S′ S′ S′ S′ S′ S′ S′ S′ S′ S′ S′ S′ S′ y′ y′

1

y′

2

y′

3

y′

4

y′

5

y′

6

y′

7

y′

8

y′

9 y′ 10 y′ 11 y′ 12 y′ 13 y′ 14 y′ 15

k4 ⊕k9 = m4 ⊕m9

Result: provide a relation between two key bytes

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

59 / 64

slide-137
SLIDE 137

First Attack Description (2)

◮ Encrypt N times the same message M and collect the N traces of first

AES round

◮ For the 120 possible pairs (i1,i2) compute ˆ

ρΘi1,Θi2 (t)

◮ When a correlation peak appears a relation between ki1 and ki2 is found ◮ Repeat for several random messages M until enough relations are found

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

60 / 64

slide-138
SLIDE 138

First Attack Description (2)

◮ Encrypt N times the same message M and collect the N traces of first

AES round

◮ For the 120 possible pairs (i1,i2) compute ˆ

ρΘi1,Θi2 (t)

◮ When a correlation peak appears a relation between ki1 and ki2 is found ◮ Repeat for several random messages M until enough relations are found

③On average 59 messages are needed Total number of traces = 59×N

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

60 / 64

slide-139
SLIDE 139

Experimental Results

Correlation traces obtained on real traces for N = 25

  • 0.5

0.5 1 100 125 150 175 200

Correlation Time

  • 0.5

0.5 1 100 125 150 175 200

Correlation Time

Total number of acquisitions : 25×59 ≈ 1500

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

61 / 64

slide-140
SLIDE 140

Second Attack Description (1)

Previous attack cannot be applied to masked inversion if masks are different for each byte

0⊕u3 x′

0 x′ 1 x′ 2 x′ 3 x′ 4

x′

15

... I′ I′ I′ I′ I′ I′ ... y′

0 y′ 1 y′ 2 y′ 3 y′ 4

y′

15

... 0⊕u3

  • r

1⊕u3 x′

0 x′ 1 x′ 2 x′ 3 x′ 4

x′

15

... I′ I′ I′ I′ I′ I′ ... y′

0 y′ 1 y′ 2 y′ 3 y′ 4

y′

15

... 1⊕u3

Collision between input and output reveals one key byte except one bit: ki = mi

  • r

ki = mi ⊕1

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

62 / 64

slide-141
SLIDE 141

Practical Results

Correlation traces obtained on simulated traces for the pseudo-inversion of the first byte in GF(28) with N = 16

  • 1
  • 0.5

0.5 1 10 20 30 40 50 60

Correlation Time

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

63 / 64

slide-142
SLIDE 142

Outline

Introduction RSA and Elliptic Curve Cryptography Scalar Multiplication Implementation Side-Channel Analysis Improved Atomic Pattern for Scalar Multiplication Square Always Exponentiation Horizontal Correlation Analysis Long-Integer Multiplication Blinding and Shuffling Collision-Correlation Analysis on AES Conclusion

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

63 / 64

slide-143
SLIDE 143

Conclusion

Concrete results of this thesis:

◮ 4 publications in international conferences (CHES, INDOCRYPT,

CARDIS, ICICS)

◮ 4 patent registrations

Personal benefits:

◮ Research with industrial constraints is motivating ◮ Both implementation and side-channel analysis covered in this

research

◮ Both high and low-level implementation studied ◮ Both public and private-key cryptography investigated

  • V. Verneuil - Elliptic Curve Cryptography and Security of Embedded Devices

64 / 64