10.12.2012 Views

Prime Numbers

Prime Numbers

Prime Numbers

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

2.3 Squares and roots 101<br />

}<br />

x = a (p+3)/8 mod p;<br />

c = x 2 mod p; // Then c ≡±a (mod p).<br />

if(c = a mod p) x = x2 (p−1)/4 mod p;<br />

return x;<br />

2. [Case p ≡ 1(mod8)]<br />

Find a random integer d ∈ [2,p− 1] with <br />

d<br />

p = −1;<br />

// Compute Jacobi symbols via Algorithm 2.3.5.<br />

Represent p − 1=2st, with t odd;<br />

A = at mod p;<br />

D = dt mod p;<br />

m =0; // m will be 2µ of text discussion.<br />

for(0 ≤ i

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

Saved successfully!

Ooh no, something went wrong!