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 />

C a<br />

X w-1 Y w-1 X w-2 X 0<br />

C b<br />

+<br />

FA FA<br />

FA<br />

M w-1<br />

+<br />

FA<br />

S w-1<br />

Y w-2<br />

+<br />

M w-2<br />

+<br />

FA<br />

Figure 4 – 3 Scalable addition and subtraction unit for operands with word width w<br />

S w-2<br />

The subtraction x − y can be accomplished by the addition of x with the bitwise<br />

complement of y and 1. The addition of 1 is simply achieved by sett<strong>in</strong>g the first carry<br />

bit to one (c<strong>in</strong> = 1) (Step 1). S<strong>in</strong>ce the result can be negative, a f<strong>in</strong>al verification<br />

is required. If necessary, the modulus has to be added. The follow<strong>in</strong>g algorithm<br />

describes the modular subtraction:<br />

In step 1, both memory cells z and T obta<strong>in</strong> the same value, which can be done<br />

<strong>in</strong> hard<strong>ware</strong> <strong>in</strong> parallel at the same time without any additional overhead. After the<br />

computation of the difference, one can check for the correctness of the result.<br />

Hence, subtraction can be performed more efficiently than addition and requires<br />

<strong>in</strong> the worst case<br />

clock cycles.<br />

. . .<br />

Y 0<br />

+<br />

M 0<br />

+<br />

FA<br />

S 0<br />

sub<br />

C a<br />

sub<br />

Tsub = 2(e + 1) (4.3)<br />

63<br />

C b

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

Saved successfully!

Ooh no, something went wrong!