05.01.2015 Views

Course notes (chap. 1 Number Theory, chap. 2 ... - McGill University

Course notes (chap. 1 Number Theory, chap. 2 ... - McGill University

Course notes (chap. 1 Number Theory, chap. 2 ... - McGill University

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

For prime numbers p ≡ 1(mod4)anda ∈ QR p ,there(only)existsan<br />

efficient probabilistic algorithm. We present one found in the algorithmics<br />

book of Brassard-Bratley:<br />

Algorithm 1.4 ( rootLV(a, p, VAR r, VAR success) )<br />

1: z ← uniform(1 ...p− 1)<br />

2: IF a = z 2 mod p {very unlikely} THEN success ← true, r ← z<br />

3: ELSE compute c and d such that 0 ≤ c ≤ p − 1, 0 ≤ d ≤ p − 1, and<br />

c + d √ a ≡ (z + √ a) (p−1)/2 mod p<br />

4: IF d =0THEN success ← false<br />

5: ELSE (c =0), success ← true,<br />

<br />

Michele Cipolla<br />

6: compute r such that 1 ≤ r ≤ p − 1andd · r ≡ 1modp

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

Saved successfully!

Ooh no, something went wrong!