14.07.2013 Views

dissertacao.pdf

dissertacao.pdf

dissertacao.pdf

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Another very important procedure for RSA regarding congruences is Mod-<br />

ular Exponentiation. Given integers b, e, N, suppose we wish to calculate the<br />

integer c satisfying:<br />

c ∼ = b e<br />

(mod N) (6)<br />

A straightforward method is to simply calculate b e and then its remainder when<br />

divided by N. This algorithm’s complexity is O(e) so it is infeasible for large<br />

values of e. An alternative method, more efficient, is described below:<br />

Algorithm 1. (Exponentiation by repeated squaring and multiplica-<br />

tion). Given integers b, e, N, to compute the modular exponentiation<br />

c ∼ = b e (mod N) we proceed as follows:<br />

1. write e in its binary representation: (em−1, em−2, ..., e1, e0)2 such that<br />

e = i=m−1 i=0 ei2i .<br />

2. set c = 1.<br />

3. from i = m − 1 to i = 0:<br />

4. return c.<br />

1. c = c 2 (mod N).<br />

2. If ei = 1, then c = cb (mod N).<br />

The complexity of this algorithm is O(m) = O(log(e)). The operations<br />

in step 3 can be efficiently done implementing a technique called Montgomery<br />

Reduction[34].<br />

We now introduce one definition used in the surprisingly efficient determin-<br />

istic primality checking algorithm presented in Chapter 2.<br />

Definition 10. Given an integer a and an integer N such that (a, N) = 1, the<br />

multiplicative order of a modulo N, denoted oN(a), is the smallest positive<br />

integer k such that<br />

test.<br />

a k ∼ = 1 (mod N) (7)<br />

And a definition used in the application of the Solovay-Strassen primality<br />

Definition 11. Given an integer q and an integer n, we say that q is a<br />

quadratic residue modulo n if there exists an integer x such that:<br />

x 2 ∼ = q (mod n) (8)<br />

9

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

Saved successfully!

Ooh no, something went wrong!