SLIDE 60 Contributions Application to SPA Protected Modular Exponentiations
Right-to-left Regular Exponentiation with A · B, A · C
Right-to-left regular 2t-ary exponentiation with CombinedMontMul Require: N < 2wn−2 the modulus, an integer 0 ≤ G < N, an exponent e = (ek−1, . . . , e0)2t with ei ∈ {1, . . . , 2t}, R = 2w(n+1) the Montgomery constant. Ensure: G e mod N
1: X ← MontMul(G, R2 mod N), X ← SmallRed(X) // X = G · R mod N 2: for i = 1 to 2t do 3:
Yi ← R mod N
4: for i = 0 to k − 1 do 5:
Yei , X ← CombinedMontMul(X, Yei , X)
6:
for j = 1 to t − 1 do
7:
X ← MontSqu(X), X ← SmallRed(X)
8: // Final reconstruction 9: Z ← Y2t 10: Y2t−1 ← MontMul(Y2t−1, Y2t ) 11: Y2t−1 ← SmallRed(Y2t−1) 12: for i = 2t − 1 downto 2 do 13:
Z, Yi−1 ← CombinedMontMul(Yi, Z, Yi−1)
14: Z ← MontMul(Z, Y1), Z ← SmallRed(Z) 15: Z ← MontMul(Z, 1), Z ← SmallRed(Z) 16: return Z
- C. Nègre, T. Plantard and J.-M. Robert
30 / 37