The Euclidean Algorithm determines the greatest common divisor (gcd)
of two positive numbers (e.g. r0 , r1 , where r0 > r1).
The algorithm consists in the repeated application of the following
integer division:
Since the Euklidische algorithm finds greatest common divisors
it can be used to check if a positive number
b < n has a multiplicative inverse modulo n,
by setting r0 = n and r1 = b.
One does, however, not receive the value of the inverse (it this
exists at all).
This is performed by the Extended Euclidean Algorithm.