57
ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions Unified Point Addition Formulæ and Side-Channel Attacks Douglas Stebila 1 and Nicolas Th´ eriault D.S.: Institute for Quantum Computing, University of Waterloo, Waterloo, Ontario, Canada N.T.: Fields Institute, Toronto, Ontario, Canada CHES 2006 – Fri. Oct. 13, 2006 1 Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´ eriault University of Waterloo/Fields Institute Unified Point Addition Formulæ and Side-Channel Attacks

Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Unified Point Addition Formulæ andSide-Channel Attacks

Douglas Stebila1 and Nicolas Theriault

D.S.: Institute for Quantum Computing,University of Waterloo, Waterloo, Ontario, CanadaN.T.: Fields Institute, Toronto, Ontario, Canada

CHES 2006 – Fri. Oct. 13, 2006

1Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 2: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Outline

ECC and side-channel analysis

Attack scenario

Affine unified formula

Projective unified formula

Conclusions

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 3: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Elliptic curves

I In this presentation we will work with elliptic curves inWeierstraß form over prime fields Fp of characteristic p > 3,so the curve has the form:

y2 = x3 + ax + b mod p

I The point addition and doubling formulæ are:

x3 = λ2 − x1 − x2 mod p,

y3 = λ(x1 − x3)− y1 mod p,

λ =

{y1−y2

x1−x2mod p, if x1 6= x2 (addition),

3x21+a

2y1mod p, if x1 = x2 (doubling).

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 4: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Elliptic curves

I In this presentation we will work with elliptic curves inWeierstraß form over prime fields Fp of characteristic p > 3,so the curve has the form:

y2 = x3 + ax + b mod p

I The point addition and doubling formulæ are:

x3 = λ2 − x1 − x2 mod p,

y3 = λ(x1 − x3)− y1 mod p,

λ =

{y1−y2

x1−x2mod p, if x1 6= x2 (addition),

3x21+a

2y1mod p, if x1 = x2 (doubling).

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 5: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Simple side-channel attacks on ECC point multiplicationAlgorithm: Double-and-add point multiplicationInput: Point P , scalar k =

∑`−1j=0 kj2j .

Output: Point kP .

1. Q← P .

2. If k`−1 = 1 then R← P else R← O.

3. For i from `− 2 to 0 do:3.1 [Double] Q← 2Q.

3.2 [Add] If ki = 1 then R← R + Q

4. Return R.

I If the double-and-add algorithm is used for pointmultiplication with the textbook formulæ, then it can be easyto read off the key bits if a side-channel exists thatdistinguishes point additions from point doublings.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 6: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Simple side-channel attacks on ECC point multiplicationAlgorithm: Double-and-add point multiplicationInput: Point P , scalar k =

∑`−1j=0 kj2j .

Output: Point kP .

1. Q← P .

2. If k`−1 = 1 then R← P else R← O.

3. For i from `− 2 to 0 do:3.1 [Double] Q← 2Q.

3.2 [Add] If ki = 1 then R← R + Q

4. Return R.

I If the double-and-add algorithm is used for pointmultiplication with the textbook formulæ, then it can be easyto read off the key bits if a side-channel exists thatdistinguishes point additions from point doublings.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 7: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Simple side-channel attacks on ECC point multiplicationAlgorithm: Double-and-add point multiplicationInput: Point P , scalar k =

∑`−1j=0 kj2j .

Output: Point kP .

1. Q← P .

2. If k`−1 = 1 then R← P else R← O.

3. For i from `− 2 to 0 do:3.1 [Double] Q← 2Q.

3.2 [Add] If ki = 1 then R← R + Q

4. Return R.

I If the double-and-add algorithm is used for pointmultiplication with the textbook formulæ, then it can be easyto read off the key bits if a side-channel exists thatdistinguishes point additions from point doublings.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 8: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Model for side-channel analysis

I Find operations in the formulæ that distinguish point additionfrom point doubling.

I Use side-channel analysis to observe these distinguishingoperations and identify corresponding point additions andpoint doublings.

I Model the sequence using a Markov process and applystatistical analysis to limit the possible key space.

I Perform a brute-force search on the remaining key space.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 9: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Model for side-channel analysis

I Find operations in the formulæ that distinguish point additionfrom point doubling.

I Use side-channel analysis to observe these distinguishingoperations and identify corresponding point additions andpoint doublings.

I Model the sequence using a Markov process and applystatistical analysis to limit the possible key space.

I Perform a brute-force search on the remaining key space.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 10: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Model for side-channel analysis

I Find operations in the formulæ that distinguish point additionfrom point doubling.

I Use side-channel analysis to observe these distinguishingoperations and identify corresponding point additions andpoint doublings.

I Model the sequence using a Markov process and applystatistical analysis to limit the possible key space.

I Perform a brute-force search on the remaining key space.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 11: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Model for side-channel analysis

I Find operations in the formulæ that distinguish point additionfrom point doubling.

I Use side-channel analysis to observe these distinguishingoperations and identify corresponding point additions andpoint doublings.

I Model the sequence using a Markov process and applystatistical analysis to limit the possible key space.

I Perform a brute-force search on the remaining key space.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 12: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Defence techniques

I Defence against simple side-channel analysis:I insert dummy operations,I use multiplication algorithms that behave regularly, orI unify point addition and doubling formulæ or consider other

parameterizations.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 13: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Results

I We give a projective version of the unified point additionformulæ of [BDJ04].

I We apply an extension of an attack of [Wal04] to these affineand projective formulæ and show that it is a feasible attack.

I We suggest countermeasures to avoid these attacks.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 14: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Results

I We give a projective version of the unified point additionformulæ of [BDJ04].

I We apply an extension of an attack of [Wal04] to these affineand projective formulæ and show that it is a feasible attack.

I We suggest countermeasures to avoid these attacks.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 15: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Results

I We give a projective version of the unified point additionformulæ of [BDJ04].

I We apply an extension of an attack of [Wal04] to these affineand projective formulæ and show that it is a feasible attack.

I We suggest countermeasures to avoid these attacks.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 16: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Goal of the attack

I A large number of keys are used for scalar multiplication (eachkey is used only once). We want to find some (but not all) ofthe keys used.

I The attack is successful if a non-negligible proportion of thekeys can be computed at a cost which is considerably lowerthan before the attack.

I Walter [Wal04] looks for the most easily computable key outof an (average) set of 512 keys.

I This corresponds to observing 512 traces of pointmultiplication using different keys and then choosing the tracethat is most susceptible to attack.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 17: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Goal of the attack

I A large number of keys are used for scalar multiplication (eachkey is used only once). We want to find some (but not all) ofthe keys used.

I The attack is successful if a non-negligible proportion of thekeys can be computed at a cost which is considerably lowerthan before the attack.

I Walter [Wal04] looks for the most easily computable key outof an (average) set of 512 keys.

I This corresponds to observing 512 traces of pointmultiplication using different keys and then choosing the tracethat is most susceptible to attack.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 18: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Assumptions of attack

I Point multiplication implemented using double-and-add.

I Field multiplication is done using Montgomery modularmultiplication with conditional subtraction.

I A conditional subtraction can be detected.

I These assumptions are justifiable:I Double-and-add style multiplication is often used in

memory-constrained environments.I Montgomery modular multiplication with conditional

subtraction is widely used.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 19: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Assumptions of attack

I Point multiplication implemented using double-and-add.

I Field multiplication is done using Montgomery modularmultiplication with conditional subtraction.

I A conditional subtraction can be detected.I These assumptions are justifiable:

I Double-and-add style multiplication is often used inmemory-constrained environments.

I Montgomery modular multiplication with conditionalsubtraction is widely used.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 20: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Montgomery modular multiplication

Algorithm: Montgomery modular multiplicationInput: A,B, P such that A,B < R ≤ r−n, P coprime to R.Output: C such that C ≡ ABr−n mod P , C < R.

1. C ← AB.

2. C ← (C + (−p−1C mod R)p)/R.

3. If C ≥ R then C ← C − P .

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 21: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Montgomery modular multiplication

Algorithm: Montgomery modular multiplicationInput: A,B, P such that A,B < R ≤ r−n, P coprime to R.Output: C such that C ≡ ABr−n mod P , C < R.

1. C ← AB.

2. C ← (C + (−p−1C mod R)p)/R.

3. If C ≥ R then C ← C − P .

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 22: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Brier, Dechene, and Joye’s unified formula – affine form

I [BDJ04] give an infinite family of unified point additionformulæ; we choose the most efficient one.

I Unified form of λ:

λ =(x1 + x2)2 − x1x2 + a + (−1)δ(y1 − y2)

y1 + y2 + (−1)δ(x1 − x2),

where δ = 0 when y1 + y2 + x1 − x2 6= 0 and δ = 1 otherwise.

I The form of x3 and y3 is not changed, only the form of λ ischanged.

I This unified formula requires y1 + y2 + (−1)δ(x1 − x2) 6= 0.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 23: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Brier, Dechene, and Joye’s unified formula – affine form

I [BDJ04] give an infinite family of unified point additionformulæ; we choose the most efficient one.

I Unified form of λ:

λ =(x1 + x2)2 − x1x2 + a + (−1)δ(y1 − y2)

y1 + y2 + (−1)δ(x1 − x2),

where δ = 0 when y1 + y2 + x1 − x2 6= 0 and δ = 1 otherwise.

I The form of x3 and y3 is not changed, only the form of λ ischanged.

I This unified formula requires y1 + y2 + (−1)δ(x1 − x2) 6= 0.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 24: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Brier, Dechene, and Joye’s unified formula – affine form

I [BDJ04] give an infinite family of unified point additionformulæ; we choose the most efficient one.

I Unified form of λ:

λ =(x1 + x2)2 − x1x2 + a + (−1)δ(y1 − y2)

y1 + y2 + (−1)δ(x1 − x2),

where δ = 0 when y1 + y2 + x1 − x2 6= 0 and δ = 1 otherwise.

I The form of x3 and y3 is not changed, only the form of λ ischanged.

I This unified formula requires y1 + y2 + (−1)δ(x1 − x2) 6= 0.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 25: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Application of [Wal04]’s attack

λ =(x1 + x2)2 − x1x2 + a + (−1)δ (y1 − y2)

y1 + y2 + (−1)δ (x1 − x2)

I Parts of [Wal04]’s attack can be applied here.I A modular subtraction a− b mod p is implemented as

follows:

1. c← a− b.2. if c < 0 then

I If a conditional addition occurs in the computation of either(y1 − y2) or (x1 − x2), then the operation cannot be a pointdoubling.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 26: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Application of [Wal04]’s attack

λ =(x1 + x2)2 − x1x2 + a + (−1)δ (y1 − y2)

y1 + y2 + (−1)δ (x1 − x2)

I Parts of [Wal04]’s attack can be applied here.I A modular subtraction a− b mod p is implemented as

follows:

1. c← a− b.2. if c < 0 then c← c + p

I If a conditional addition occurs in the computation of either(y1 − y2) or (x1 − x2), then the operation cannot be a pointdoubling.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 27: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Application of [Wal04]’s attack

λ =(x1 + x2)2 − x1x2 + a + (−1)δ (y1 − y2)

y1 + y2 + (−1)δ (x1 − x2)

I Parts of [Wal04]’s attack can be applied here.I A modular subtraction a− b mod p is implemented as

follows:

1. c← a− b.2. if c < 0 then c← c + p

I If a conditional addition occurs in the computation of either(y1 − y2) or (x1 − x2), then the operation cannot be a pointdoubling.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 28: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Application of [Wal04]’s attack

λ =(x1 + x2)2 − x1x2 + a + (−1)δ (y1 − y2)

y1 + y2 + (−1)δ (x1 − x2)

I Parts of [Wal04]’s attack can be applied here.I A modular subtraction a− b mod p is implemented as

follows:

1. c← a− b.2. if c < 0 then c← c + p

I If a conditional addition occurs in the computation of either(y1 − y2) or (x1 − x2), then the operation cannot be a pointdoubling.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 29: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Attack analysis assumptions

I Assume that the bit length of the key is known and ismaximal (this is true roughly 1/2 the time).

I Assume that the total number of point operations (additionsand doublings) is known.

I This implies we know the number of point additions that needto be identified.

I Example:I 192-bit key with 285 point operations and 84 identified point

additions.I This leaves 285− 192− 84 = 9 unidentified point additions.I The size of the keyspace is upper bounded by

(1929

).

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 30: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Attack analysis assumptions

I Assume that the bit length of the key is known and ismaximal (this is true roughly 1/2 the time).

I Assume that the total number of point operations (additionsand doublings) is known.

I This implies we know the number of point additions that needto be identified.

I Example:I 192-bit key with 285 point operations and 84 identified point

additions.I This leaves 285− 192− 84 = 9 unidentified point additions.I The size of the keyspace is upper bounded by

(1929

).

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 31: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Attack analysis assumptions

I Assume that the bit length of the key is known and ismaximal (this is true roughly 1/2 the time).

I Assume that the total number of point operations (additionsand doublings) is known.

I This implies we know the number of point additions that needto be identified.

I Example:I 192-bit key with 285 point operations and 84 identified point

additions.

I This leaves 285− 192− 84 = 9 unidentified point additions.I The size of the keyspace is upper bounded by

(1929

).

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 32: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Attack analysis assumptions

I Assume that the bit length of the key is known and ismaximal (this is true roughly 1/2 the time).

I Assume that the total number of point operations (additionsand doublings) is known.

I This implies we know the number of point additions that needto be identified.

I Example:I 192-bit key with 285 point operations and 84 identified point

additions.I This leaves 285− 192− 84 = 9 unidentified point additions.

I The size of the keyspace is upper bounded by(1929

).

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 33: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Attack analysis assumptions

I Assume that the bit length of the key is known and ismaximal (this is true roughly 1/2 the time).

I Assume that the total number of point operations (additionsand doublings) is known.

I This implies we know the number of point additions that needto be identified.

I Example:I 192-bit key with 285 point operations and 84 identified point

additions.I This leaves 285− 192− 84 = 9 unidentified point additions.I The size of the keyspace is upper bounded by

(1929

).

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 34: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Projective form of [BDJ04] formulaI Let xi = Xi/Zi, yi = Yi/Zi. Then

X3 = 2FW Y3 = R(G− 2W )− LFM Z3 = 2F 3

U1 = X1Z2 U2 = X2Z1

S1 = Y1Z2 S2 = Y2Z1

Z = Z1Z2 T = U1 + U2 M = S1 + S2

V = (−1)δ(U1 − U2) N = (−1)δ(S1 − S2)

E = M + V F = ZE L = FE

R = T 2 − U1U2 + Z(aZ + N) W = R2 −G

I If a conditional subtraction occurs in U1 but not U2 or vice

versa, then it is not a point doubling; similarly for S1 , S2 .

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 35: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Projective form of [BDJ04] formulaI Let xi = Xi/Zi, yi = Yi/Zi. Then

X3 = 2FW Y3 = R(G− 2W )− LFM Z3 = 2F 3

U1 = X1Z2 U2 = X2Z1

S1 = Y1Z2 S2 = Y2Z1

Z = Z1Z2 T = U1 + U2 M = S1 + S2

V = (−1)δ(U1 − U2) N = (−1)δ(S1 − S2)

E = M + V F = ZE L = FE

R = T 2 − U1U2 + Z(aZ + N) W = R2 −G

I If a conditional subtraction occurs in U1 but not U2 or vice

versa, then it is not a point doubling; similarly for S1 , S2 .

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 36: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Projective form of [BDJ04] formulaI Let xi = Xi/Zi, yi = Yi/Zi. Then

X3 = 2FW Y3 = R(G− 2W )− LFM Z3 = 2F 3

U1 = X1Z2 U2 = X2Z1

S1 = Y1Z2 S2 = Y2Z1

Z = Z1Z2 T = U1 + U2 M = S1 + S2

V = (−1)δ(U1 − U2) N = (−1)δ(S1 − S2)

E = M + V F = ZE L = FE

R = T 2 − U1U2 + Z(aZ + N) W = R2 −G

I If a conditional subtraction occurs in U1 but not U2 or vice

versa, then it is not a point doubling; similarly for S1 , S2 .

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 37: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Projective form of [BDJ04] formulaI Let xi = Xi/Zi, yi = Yi/Zi. Then

X3 = 2FW Y3 = R(G− 2W )− LFM Z3 = 2F 3

U1 = X1Z2 U2 = X2Z1

S1 = Y1Z2 S2 = Y2Z1

Z = Z1Z2 T = U1 + U2 M = S1 + S2

V = (−1)δ(U1 − U2) N = (−1)δ(S1 − S2)

E = M + V F = ZE L = FE

R = T 2 − U1U2 + Z(aZ + N) W = R2 −G

I If a conditional addition occurs in either U1 − U2 or

S1 − S2 , then it is not a point doubling.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 38: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Projective form of [BDJ04] formulaI Let xi = Xi/Zi, yi = Yi/Zi. Then

X3 = 2FW Y3 = R(G− 2W )− LFM Z3 = 2F 3

U1 = X1Z2 U2 = X2Z1

S1 = Y1Z2 S2 = Y2Z1

Z = Z1Z2 T = U1 + U2 M = S1 + S2

V = (−1)δ(U1 − U2) N = (−1)δ(S1 − S2)

E = M + V F = ZE L = FE

R = T 2 − U1U2 + Z(aZ + N) W = R2 −G

I If a conditional addition occurs in either U1 − U2 or

S1 − S2 , then it is not a point doubling.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 39: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Distinguishing point additions

I We now have four different conditional events which candistinguish a point addition from a point doubling:

1. conditional subtraction: one of U1 = X1Z2 , U2 = X2Z1

but not the other (prob.: pdiff)

2. conditional subtraction: one of S1 = Y1Z2 , S2 = Y2Z1

but not the other (prob.: pdiff)

3. conditional addition: V = (−1)δ(U1 − U2)

4. conditional addition: N = (−1)δ(S1 − S2)

I Under the assumption that these events occur independently,the probability of detecting a point addition when it occurs is

pdist = 1− (1− pdiff)2(1− padd)2 ≈910

.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 40: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Distinguishing point additions

I We now have four different conditional events which candistinguish a point addition from a point doubling:

1. conditional subtraction: one of U1 = X1Z2 , U2 = X2Z1

but not the other (prob.: pdiff)

2. conditional subtraction: one of S1 = Y1Z2 , S2 = Y2Z1

but not the other (prob.: pdiff)

3. conditional addition: V = (−1)δ(U1 − U2)

4. conditional addition: N = (−1)δ(S1 − S2)

I Under the assumption that these events occur independently,the probability of detecting a point addition when it occurs is

pdist = 1− (1− pdiff)2(1− padd)2 ≈910

.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 41: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Distinguishing point additions

I We now have four different conditional events which candistinguish a point addition from a point doubling:

1. conditional subtraction: one of U1 = X1Z2 , U2 = X2Z1

but not the other (prob.: pdiff)

2. conditional subtraction: one of S1 = Y1Z2 , S2 = Y2Z1

but not the other (prob.: pdiff)

3. conditional addition: V = (−1)δ(U1 − U2)

4. conditional addition: N = (−1)δ(S1 − S2)

I Under the assumption that these events occur independently,the probability of detecting a point addition when it occurs is

pdist = 1− (1− pdiff)2(1− padd)2 ≈910

.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 42: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Distinguishing point additions

I We now have four different conditional events which candistinguish a point addition from a point doubling:

1. conditional subtraction: one of U1 = X1Z2 , U2 = X2Z1

but not the other (prob.: pdiff)

2. conditional subtraction: one of S1 = Y1Z2 , S2 = Y2Z1

but not the other (prob.: pdiff)

3. conditional addition: V = (−1)δ(U1 − U2)

4. conditional addition: N = (−1)δ(S1 − S2)

I Under the assumption that these events occur independently,the probability of detecting a point addition when it occurs is

pdist = 1− (1− pdiff)2(1− padd)2 ≈910

.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 43: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Distinguishing point additions

I We now have four different conditional events which candistinguish a point addition from a point doubling:

1. conditional subtraction: one of U1 = X1Z2 , U2 = X2Z1

but not the other (prob.: pdiff)

2. conditional subtraction: one of S1 = Y1Z2 , S2 = Y2Z1

but not the other (prob.: pdiff)

3. conditional addition: V = (−1)δ(U1 − U2)

4. conditional addition: N = (−1)δ(S1 − S2)

I Under the assumption that these events occur independently,the probability of detecting a point addition when it occurs is

pdist = 1− (1− pdiff)2(1− padd)2 ≈910

.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 44: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Distinguishing point additions

I We now have four different conditional events which candistinguish a point addition from a point doubling:

1. conditional subtraction: one of U1 = X1Z2 , U2 = X2Z1

but not the other (prob.: pdiff ≈ 3/8)

2. conditional subtraction: one of S1 = Y1Z2 , S2 = Y2Z1

but not the other (prob.: pdiff ≈ 3/8)

3. conditional addition: V = (−1)δ(U1 − U2)

4. conditional addition: N = (−1)δ(S1 − S2)

I Under the assumption that these events occur independently,the probability of detecting a point addition when it occurs is

pdist = 1− (1− pdiff)2(1− padd)2 ≈910

.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 45: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Distinguishing point additions

I We now have four different conditional events which candistinguish a point addition from a point doubling:

1. conditional subtraction: one of U1 = X1Z2 , U2 = X2Z1

but not the other (prob.: pdiff ≈ 3/8)

2. conditional subtraction: one of S1 = Y1Z2 , S2 = Y2Z1

but not the other (prob.: pdiff ≈ 3/8)

3. conditional addition: V = (−1)δ(U1 − U2) (prob.: padd ≈ 12 )

4. conditional addition: N = (−1)δ(S1 − S2) (prob.: padd ≈ 12 )

I Under the assumption that these events occur independently,the probability of detecting a point addition when it occurs is

pdist = 1− (1− pdiff)2(1− padd)2 ≈910

.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 46: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Distinguishing point additions

I We now have four different conditional events which candistinguish a point addition from a point doubling:

1. conditional subtraction: one of U1 = X1Z2 , U2 = X2Z1

but not the other (prob.: pdiff ≈ 3/8)

2. conditional subtraction: one of S1 = Y1Z2 , S2 = Y2Z1

but not the other (prob.: pdiff ≈ 3/8)

3. conditional addition: V = (−1)δ(U1 − U2) (prob.: padd ≈ 12 )

4. conditional addition: N = (−1)δ(S1 − S2) (prob.: padd ≈ 12 )

I Under the assumption that these events occur independently,the probability of detecting a point addition when it occurs is

pdist = 1− (1− pdiff)2(1− padd)2 ≈910

.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 47: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Number of unidentified additions

I The number of unidentified additions in a key of length nfollows a binomial distribution with success probability

1− pdist

2≈ 1

20.

I From this we get the expected number of missing additionsand the probability that at most k additions are not identified.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 48: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Number of unidentified additions

I The number of unidentified additions in a key of length nfollows a binomial distribution with success probability

1− pdist

2≈ 1

20.

I From this we get the expected number of missing additionsand the probability that at most k additions are not identified.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 49: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Analysis of attack for multiple curve sizes

To compare with [Wal04], we look at the best (in terms ofunidentified point additions) of 512 random sample traces of apoint multiplication.

field size (bits): 192 256 384 521[Wal04]’s attack:

expected missing additions: 19.2 26.6 41.5 57.9search space: 217.6 230.4 256.0 284.2

our attack:expected missing additions: 2 4 8 13search space: 29.67 218.9 237.2 259.4

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 50: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Analysis of attack for multiple curve sizes

Instead of looking at the best of 512 random sample traces,consider how many traces are required to obtain a trace with atmost 3 unidentified point additions.

field size (bits): 192 256 384 521expected number of traces: 67 746 217.1 225.2

search space: 220.1 221.4 223.1 224.4

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 51: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Analysis of attack for multiple curve sizes

Instead of looking at the best of 512 random sample traces,consider how many traces are required to obtain a trace with atmost 3 unidentified point additions.

field size (bits): 192 256 384 521expected number of traces: 67 746 217.1 225.2

search space: 220.1 221.4 223.1 224.4

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 52: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Replace reduction mod p with constant-time operation

I Assume a, b, c ∈ {0, . . . , p− 1}.I Precompute multiples mp, m ∈ {1, 2}.

I Modular subtraction: a− b mod p becomes(2p + a− b)−mp, where m ∈ {1, 2} is chosen based on sizeof (2p + a− b).

I Modular addition: a + b mod p becomes (a + b + p)−mp,where m ∈ {1, 2} is chosen based on size of (a + b + p).

I Montgomery reduction: c mod p becomes (c + p)−mp,where m ∈ {1, 2} is chosen based on size of (c + p).

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 53: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Replace reduction mod p with constant-time operation

I Assume a, b, c ∈ {0, . . . , p− 1}.I Precompute multiples mp, m ∈ {1, 2}.I Modular subtraction: a− b mod p becomes

(2p + a− b)−mp, where m ∈ {1, 2} is chosen based on sizeof (2p + a− b).

I Modular addition: a + b mod p becomes (a + b + p)−mp,where m ∈ {1, 2} is chosen based on size of (a + b + p).

I Montgomery reduction: c mod p becomes (c + p)−mp,where m ∈ {1, 2} is chosen based on size of (c + p).

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 54: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Replace reduction mod p with constant-time operation

I Assume a, b, c ∈ {0, . . . , p− 1}.I Precompute multiples mp, m ∈ {1, 2}.I Modular subtraction: a− b mod p becomes

(2p + a− b)−mp, where m ∈ {1, 2} is chosen based on sizeof (2p + a− b).

I Modular addition: a + b mod p becomes (a + b + p)−mp,where m ∈ {1, 2} is chosen based on size of (a + b + p).

I Montgomery reduction: c mod p becomes (c + p)−mp,where m ∈ {1, 2} is chosen based on size of (c + p).

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 55: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Separate operations and modular reductions

I Assume a, b ∈ {0, . . . , p− 1}.I a + b is at most 2p− 2, which is only 1 bit longer than p− 1,

so we don’t need to reduce right away.

I Modify operations performed later (e.g., Montgomerymultiplication) to have a larger domain.

I Example: Reduction in Montgomery modular multiplicationallowed to return outputs between 0 and 2p− 1, and allowedto accept products between 0 and 16p2.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 56: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

Conclusions

I [BDJ04] provide an infinite family of unified point additionformulæ that unify the sequence of field operations. Theimplementation of these field operations still matters.

I Our extension of the attack of [Wal04] demonstrates thatcareful attention must be paid to the implementation of fieldoperations: every type of field operation should have constantruntime.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks

Page 57: Unified Point Addition Formulæ and Side-Channel Attacks · 2008. 1. 13. · Supported by Canada’s NSERC, Sun Microsystems, CIAR, MITACS, CFI, and ORDCF. D. Stebila and N.Th´eriault

ECC and side-channel analysis Attack scenario Affine unified formula Projective unified formula Conclusions

References

[BDJ04] E. Brier, I. Dechene, and M. Joye.Unified point addition formulæ for elliptic curve cryptosystems.In Embedded Cryptographic Hardware: Methodologies and Architectures, Nova Science Publishers,2004.

[BJ02] E. Brier and M. Joye.Weierstraß elliptic curves and side-channel attacks.In Public Key Cryptography – PKC 2002, LNCS 2274:87–100, Springer-Verlag, 2002.

[Joy05] M. Joye.Defences against side-channel analysis.In Advances in Elliptic Curve Cryptography, pp. 87–100, Cambridge University Press, 2005.

[Wal04] C. D. Walter.Simple power analysis of unified code for ECC double and add.In CHES 2004, LNCS 3156:191–204, Springer-Verlag, 2004.

D. Stebila and N.Theriault University of Waterloo/Fields Institute

Unified Point Addition Formulæ and Side-Channel Attacks