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.

Algorithm 1.2 ( Euclide gcd(a,b) ) <br />

1: g ⟵ a, g′ ⟵ b, x ⟵ 1, y ⟵ 0, x′ ⟵ 0, y′ ⟵ 1,<br />

2:WHILE g′>0 DO <br />

3: k ⟵ g div g′ <br />

4: g′′ ⟵ g-kg′; x′′ ⟵ x-kx′; y′′ ⟵ y-ky′ <br />

5: g ⟵ g′; x ⟵ x′; y ⟵ y′ <br />

6: g′ ⟵ g′′; x′ ⟵ x′′; y′ ⟵ y′′; <br />

7: ENDWHILE <br />

8: RETURN g,x,y <br />

(Maple igcd, igcdex, 1/x mod n, x^(-1) mod n)

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

Saved successfully!

Ooh no, something went wrong!