04.11.2012 Views

1 Montgomery Modular Multiplication in Hard- ware

1 Montgomery Modular Multiplication in Hard- ware

1 Montgomery Modular Multiplication in Hard- ware

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

FEI KEMT<br />

Algorithm 1 – 1 <strong>Montgomery</strong> exponentiation algorithm [86], the def<strong>in</strong>ition of M ′<br />

requires that gcd(M, R) = 1, b denotes base or radix.<br />

Require: M = (mk−1 . . . m0)b, R = b k , M ′ = −M −1 mod b, E = (et . . . e0)2 with<br />

et = 1, and an <strong>in</strong>teger X, 1 ≤ X < M. The values R 2 mod M and R mod M<br />

may be also provided as precomputed <strong>in</strong>puts.<br />

Ensure: A = X E mod M.<br />

1: X ⇐ MMM(X, R 2 mod M)<br />

2: A ⇐ R mod M<br />

3: for i = t down to 0 do<br />

4: A ⇐ MMM(A, A)<br />

5: if ei = 1 then<br />

6: A ⇐ MMM(A, X)<br />

7: end if<br />

8: end for<br />

9: A ⇐ MMM(A, 1)<br />

10: return A<br />

Therefore the first operation <strong>in</strong> the Algorithm 1 – 1 (Step 1) maps the <strong>in</strong>put value<br />

X to its M-residue X.<br />

Now we show how to re-map the value X to its ord<strong>in</strong>ary form of <strong>in</strong>teger X what<br />

is done <strong>in</strong> the last operation of the exponentiation (Algorithm 1 – 1, Step 9). It can<br />

be seen that the <strong>Montgomery</strong> product of two M-residues X, Y is itself the M-residue<br />

S:<br />

S = MMM(A, B) (1.12)<br />

= XY R −1 mod M<br />

= XRY RR −1 mod M<br />

= XY R mod M<br />

= SR mod M<br />

10

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!