2021-11-05 18:15:01 +00:00
|
|
|
= Euclidean Algorithm =
|
2021-11-05 18:30:01 +00:00
|
|
|
|
|
|
|
The Euclidean Algorithm is an algorithm for finding the inverse of a number
|
|
|
|
when working within a modulo.
|
2021-11-05 18:45:01 +00:00
|
|
|
|
|
|
|
Steps, represented as psuedo code (for A^-1 = (mod m))
|
|
|
|
|
|
|
|
{{{
|
|
|
|
lhs = m
|
|
|
|
rhs = A
|
2021-11-05 19:00:01 +00:00
|
|
|
modulo = 0
|
2021-11-05 18:45:01 +00:00
|
|
|
|
2021-11-05 19:00:01 +00:00
|
|
|
while modulo != 1
|
|
|
|
//lhs = rhs * (int(lhs/rhs)) + remainder
|
2021-11-05 18:45:01 +00:00
|
|
|
|
|
|
|
}}}
|