MCPcopy Create free account
hub / github.com/ActiveState/code / gcd

Function gcd

recipes/Python/572196_RSA/recipe-572196.py:93–98  ·  view source on GitHub ↗
(a,b)

Source from the content-addressed store, hash-verified

91 return u, v, a
92
93def gcd(a,b):
94 # 2.8 times faster than egcd(a,b)[2]
95 a,b=(b,a) if a<b else (a,b)
96 while b:
97 a,b=b,a%b
98 return a
99
100def modInverse(e,n):
101 # d such that de = 1 (mod n)

Callers 2

passwordToKeyFunction · 0.70
brentFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected