Euclid’s Algorithm for computing the gcd of two numbers, r0 and r1
r0 = q1 r1 + r2
r1 = q2 r2 + r3
r2 = q3 r3 + r4
……
rm-2 = qm-1 rm-1 + rm
rm-1 = qm rm
gcd(r0, r1) = gcd(r1, r2) = … = gcd (rm-1, rm) = rm
To determine if b < n has a multiplicative inverse modulo n, start with r0 = n and r1 = b
Previous slide
Next slide
Back to first slide
View graphic version