breaking randomized mixed radix scalar multiplication
play

Breaking Randomized Mixed-Radix Scalar Multiplication Algorithms - PowerPoint PPT Presentation

Breaking Randomized Mixed-Radix Scalar Multiplication Algorithms emie Detrey 1 Laurent Imbert 2 J er 1 LORIA, Inria, CNRS, Univ. Lorraine, Nancy, France 2 LIRMM, CNRS, Univ. Montpellier, France Latincrypt 2019 Santiago de Chile Oct. 2,


  1. Breaking Randomized Mixed-Radix Scalar Multiplication Algorithms emie Detrey 1 Laurent Imbert 2 J´ er´ 1 LORIA, Inria, CNRS, Univ. Lorraine, Nancy, France 2 LIRMM, CNRS, Univ. Montpellier, France Latincrypt 2019 Santiago de Chile – Oct. 2, 2019

  2. Context Side-channel attacks and countermeasures for elliptic curve scalar multiplication: k , P �→ [ k ] P = P + P + · · · + P Randomization strategies ◮ scalar blinding, point/cordinates randomization 1/19

  3. Context Side-channel attacks and countermeasures for elliptic curve scalar multiplication: k , P �→ [ k ] P = P + P + · · · + P Randomization strategies ◮ scalar blinding, point/cordinates randomization ◮ randomized algorithms Idea: use a different, randomly selected addition chain for each scalar multiplication. ◮ Ex: binary signed digits failures [Oswald, Aigner’01], [Ha, Moon’02]. 1/19

  4. Context Side-channel attacks and countermeasures for elliptic curve scalar multiplication: k , P �→ [ k ] P = P + P + · · · + P Randomization strategies ◮ scalar blinding, point/cordinates randomization ◮ randomized algorithms Idea: use a different, randomly selected addition chain for each scalar multiplication. ◮ Ex: binary signed digits failures [Oswald, Aigner’01], [Ha, Moon’02]. ◮ Covering Systems of Congruences [Guerrini, I., Winterhalter’17] 1/19

  5. Today’s talk Covering systems of congruences Full key recovery A regular and constant-time generalization A (virtual) template attack 2/19

  6. Covering Systems of Congruences A covering system of congruence (CSC) is a finite set of congruences S = { r i mod m i } i , s.t. every integer satisfies at least one of them. 3/19

  7. Covering Systems of Congruences A covering system of congruence (CSC) is a finite set of congruences S = { r i mod m i } i , s.t. every integer satisfies at least one of them. Example 1: binary decomposition 0 1 0 ( mod 2) 1 ( mod 2) Binary aka double-and-add algorithm k ≡ r mod 2 ⇒ [ k ] P = [2] Q + [ r ] P , where Q = [( k − r ) / 2] P Not redundant ⇒ non randomizable 3/19

  8. Covering Systems of Congruences A covering system of congruence (CSC) is a finite set of congruences S = { r i mod m i } i , s.t. every integer satisfies at least one of them. Example 2: multiple moduli 0 1 2 3 4 5 6 7 8 9 10 11 0 ( mod 2) 0 ( mod 3) 1 ( mod 4) 1 ( mod 6) − 1 ( mod 12) k ≡ r mod m ⇒ [ k ] P = [ m ] Q + [ r ] P , where Q = [( k − r ) / m ] P Redundant but not uniform 3/19

  9. Exact Coverings A CSC is an n -cover if every integer is covered at least n times. It is an exact n -cover if every integer is covered exactly n times. Example: an exact 2-cover 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 ( mod 2) 2 ( mod 4) 3 ( mod 4) 0 ( mod 6) 2 ( mod 6) 4 ( mod 6) 0 ( mod 8) 1 ( mod 8) 4 ( mod 8) 5 ( mod 8) Redundant and uniform 4/19

  10. A CSC-based Randomized Algorithm Input: S an exact n -cover, ℓ = lcm( m 1 , . . . , m |S| ), k ∈ N , P ∈ G Output: Q = [ k ] P ∈ G 1: if k = 0 then return O 2: 3: else if k = 1 then return P 4: 5: Select r ( mod m ) uniformly at random among the n classes that cover integers in ℓ Z + k 6: compute Q ← [( k − r ) / m ] P recursively 7: return [ m ] Q + [ r ] P # note: [ r ] P may be precomputed 5/19

  11. Covering systems of congruences Full key recovery A regular and constant-time generalization A (virtual) template attack 6/19

  12. Threat model The attacker can differentiate D from A . Execution trace: concatenation of subtraces given by [ m ] Q + [ r ] P . − 1 ( mod 6) − → [6] Q − P − → DADA 2 ( mod 12) − → [12] Q + [2] P − → DADDA ([2] P precomp.) 2 ( mod 12) − → [2]([6] Q + P ) − → DADAD 7/19

  13. Threat model The attacker can differentiate D from A . Execution trace: concatenation of subtraces given by [ m ] Q + [ r ] P . − 1 ( mod 6) − → [6] Q − P − → DADA 2 ( mod 12) − → [12] Q + [2] P − → DADDA ([2] P precomp.) 2 ( mod 12) − → [2]([6] Q + P ) − → DADAD k = 0xfa72c39b25ecc4164d4c5ddeb506299c0941863eeee13f6d4d73fe32bfceec1f D D A D D D D D A D D D A D A D D A D A D D D A D D A D D A D D A D A D D D A D D D A D D D D D D A D D D D D A D A D A D A D A D D A D D A D D A D D D D D A D D D A D D A D A D A D D D D D A D A D A D D A D A D D D A D A D D A D D D A D A D D D D A D D A D D D A D D A D A D A D D D D A D D D A D D A D D D D D D D D A D A D D D D A D A D A D D A D A D D A D D D D D A D D D D A D A D D D A D A D A D A D D D A D A D A D D D D A D D D A D D D D A D A D A D D A D A D A D D D D D D D A D D D D D D A D A D A D D A D D D A D A D D A D D D A D A D A D A D D D D A D D A D D A D A D D D D A D D D A D A D A D D D D D D D A D D A D D D A D A D D A D A D A D A D D A D D A D A D D D D D A Randomization provides a huge number of traces for a given k . 7/19

  14. (Weak) security assumption The mapping Tr from Z to (D|A)* is not injective. 10273 = 1 + 12(0 + 4(10 + 12(5 + 12(1 + 12 . 0)))) Tr (10273) = D A D D A D A D D A D A D D A D D D A D D A 43455 = 3 + 4(7 + 8(1 + 12(5 + 12(9 + 12 . 0)))) , Tr (43455) = D A D D A D A D D A D A D D A D D D A D D A 14649 = 9 + 12(0 + 4(5 + 12(1 + 12(2 + 12 . 0)))) , Tr (14649) = D A D D A D A D D A D A D D A D D D A D D A Empirical estimate: #integers that maps to a given trace(*) > 2 116 (*) of length equal to the average length of a trace produced by 256-bit integers 8/19

  15. The mapping Tr − 1 Example for u3c-48-24 { ( 0, 2) } D DD { ( 0, 4) } { (-1, 4) } DDA { ( 0, 8) } DDD DADA { ( 3, 6), (-1, 6), ( 1, 6) } { (-2, 8) } DDAD DDDA { (-1, 8), ( 1, 8) } { (-2, 12), ( 2, 12), ( 6, 12) } DADAD DADDA { ( 1, 12), ( 5, 12) } { (-3, 12) } DDADA DDADD { ( 4, 16), (-4, 16) } { ( 2, 16), (-6, 16) } DDDAD { ( 5, 16), (-3, 16), (-5, 16), (3, 16) } DDDDA 9/19

  16. Full key recovery algorithm (on a toy example) T1: DDADD D DDA D DD (split up for simplification) 10/19

  17. Full key recovery algorithm (on a toy example) T1: DDADD D DDA D DD (split up for simplification) DDADD D DDA D -- 0 ( mod 4) ⇒ k ∈ 4 Z 10/19

  18. Full key recovery algorithm (on a toy example) T1: DDADD D DDA D DD (split up for simplification) DDADD D DDA D -- 0 ( mod 4) ⇒ k ∈ 4 Z 0 ( mod 2) ⇒ k ∈ 8 Z DDADD D DDA - -- 10/19

  19. Full key recovery algorithm (on a toy example) T1: DDADD D DDA D DD (split up for simplification) DDADD D DDA D -- 0 ( mod 4) ⇒ k ∈ 4 Z 0 ( mod 2) ⇒ k ∈ 8 Z DDADD D DDA - -- DDADD D --- - -- − 1 ( mod 4) ⇒ k ∈ 32 Z − 8 10/19

  20. Full key recovery algorithm (on a toy example) T1: DDADD D DDA D DD (split up for simplification) DDADD D DDA D -- 0 ( mod 4) ⇒ k ∈ 4 Z 0 ( mod 2) ⇒ k ∈ 8 Z DDADD D DDA - -- DDADD D --- - -- − 1 ( mod 4) ⇒ k ∈ 32 Z − 8 0 ( mod 2) ⇒ k ∈ 64 Z − 8 DDADD - --- - -- 10/19

  21. Full key recovery algorithm (on a toy example) T1: DDADD D DDA D DD (split up for simplification) DDADD D DDA D -- 0 ( mod 4) ⇒ k ∈ 4 Z 0 ( mod 2) ⇒ k ∈ 8 Z DDADD D DDA - -- DDADD D --- - -- − 1 ( mod 4) ⇒ k ∈ 32 Z − 8 0 ( mod 2) ⇒ k ∈ 64 Z − 8 DDADD - --- - -- 4 ( mod 16) ⇒ k ∈ 1024 Z + 248 ----- - --- - -- − 4 ( mod 16) ⇒ k ∈ 1024 Z − 264 10/19

  22. Full key recovery algorithm (on a toy example) T1: DDADD D DDA D DD 4 ( mod 16) ⇒ k ∈ 1024 Z + 248 ----- - --- - -- − 4 ( mod 16) ⇒ k ∈ 1024 Z − 264 T2: DDDAD D D DDAD DD DDDAD D D DDAD -- 0 ( mod 4) ⇒ k ∈ 4 Z − 2 ( mod 8) ⇒ k ∈ 32 Z − 8 DDDAD D D ---- -- DDDAD D - ---- -- 0 ( mod 2) ⇒ k ∈ 64 Z − 8 0 ( mod 2) ⇒ k ∈ 128 Z − 8 DDDAD - - ---- -- 2 ( mod 16) ⇒ k ∈ 2048 Z + 248 ----- - - ---- -- − 6 ( mod 16) ⇒ k ∈ 2048 Z − 776 10/19

  23. Full key recovery algorithm (on a toy example) T1: DDADD D DDA D DD 4 ( mod 16) ⇒ k ∈ 1024 Z + 248 ----- - --- - -- − 4 ( mod 16) ⇒ k ∈ 1024 Z − 264 T2: DDDAD D D DDAD DD 2 ( mod 16) ⇒ k ∈ 2048 Z + 248 ----- - - ---- -- − 6 ( mod 16) ⇒ k ∈ 2048 Z − 776 10/19

  24. Full key recovery algorithm (on a toy example) T1: DDADD D DDA D DD 4 ( mod 16) ⇒ k ∈ 1024 Z + 248 ----- - --- - -- − 4 ( mod 16) ⇒ k ∈ 1024 Z − 264 T2: DDDAD D D DDAD DD 2 ( mod 16) ⇒ k ∈ 2048 Z + 248 ----- - - ---- -- − 6 ( mod 16) ⇒ k ∈ 2048 Z − 776 10/19

  25. Full key recovery algorithm (on a toy example) T1: DDADD D DDA D DD 4 ( mod 16) ⇒ k ∈ 1024 Z + 248 ----- - --- - -- − 4 ( mod 16) ⇒ k ∈ 1024 Z − 264 T2: DDDAD D D DDAD DD 2 ( mod 16) ⇒ k ∈ 2048 Z + 248 ----- - - ---- -- − 6 ( mod 16) ⇒ k ∈ 2048 Z − 776 ◮ Pruning strategy to limit exponential growth of partially decoded traces ◮ Work without preliminary splitting ◮ Work when [ r ] P is precomputed (traces only reveal m -values) ◮ Can recover the whole scalar with very few traces 10/19

  26. Covering systems of congruences Full key recovery A regular and constant-time generalization A (virtual) template attack 11/19

  27. Mixed-radix number system Write k in base ( b 1 , . . . , b n ) s.t.: ( b i need not be distincts) k = k 1 + b 1 ( k 2 + b 2 ( k 3 + · · · + b n ( k n +1 ) · · · )) 12/19

Recommend


More recommend