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 2 – 2 The multiple word radix-2 <strong>Montgomery</strong> multiplication MWR2-<br />

MM CPA algorithm<br />

1: S ⇐ 0<br />

2: � Y ⇐ 2Y<br />

3: for i = 0 to k + 3 do<br />

4: C ⇐ 0<br />

5: qi ⇐ S (0)<br />

0<br />

6: for j = 1 to e2 − 1 do<br />

7: (C, S (j) ) ⇐ C + xi � Y (j) + qiM (j) + S (j)<br />

8: S (j−1) ⇐ (S (j)<br />

0 , S (j−1)<br />

w−1..1)<br />

9: end for<br />

10: S (e2−1) ⇐ (C, S (e2−1)<br />

w−1..1)<br />

11: end for<br />

of the f<strong>in</strong>al sum S to M at the end of the loop <strong>in</strong> the Algorithm 1 – 3 for the price<br />

of some extra loops <strong>in</strong> the Algorithm MWR2MM CPA. Another difference is <strong>in</strong><br />

computation of the variable qi that decides on addition of M. Its value <strong>in</strong> the MW-<br />

R2MM CPA algorithm is given directly as LSB of the zeroth word of the <strong>in</strong>ternal<br />

sum S computed <strong>in</strong> the previous loop. Contrary of the Algorithm MWR2MM CPA<br />

the Algorithm MWR2MM CSA uses a value obta<strong>in</strong>ed after addition of item xiY<br />

what <strong>in</strong>crease a latency for comput<strong>in</strong>g the qi.<br />

The most important difference between MWR2MM CSA and MWR2MM CPA is<br />

<strong>in</strong>troduced <strong>in</strong> a way by which the variable S is represented. In carry-save redundant<br />

form applied <strong>in</strong> our implementation of the Algorithm MWR2MM CSA the sum S<br />

is represented by formulation:<br />

S (j) = 1S (j) + r2S (j) , (2.2)<br />

where r is the radix (<strong>in</strong> our implementation r = 2) and 1S, 2S are two w-bit com-<br />

ponents of the sum S. Advantage of such representation is <strong>in</strong> no carry propagation<br />

<strong>in</strong>side the <strong>in</strong>ner loop of the MMM algorithm. On the other hand, for stor<strong>in</strong>g the<br />

partial sum variable S it required to use two w-bit registers <strong>in</strong>stead of one. Only at<br />

the very end of the computations, the redundant form is transformed to the normal<br />

representation apply<strong>in</strong>g the Equation 2.2. The CSA PE which executes the MW-<br />

R2MM CSA Algorithm is <strong>in</strong> this direction <strong>in</strong>dependent on hard<strong>ware</strong> platform and<br />

does not require any special features for hard<strong>ware</strong> implementation of the adders.<br />

In the implementation of the MWR2MM CPA algorithm all operands are op-<br />

24

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

Saved successfully!

Ooh no, something went wrong!