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

Function totient

recipes/Python/572196_RSA/recipe-572196.py:106–108  ·  view source on GitHub ↗
(p,q)

Source from the content-addressed store, hash-verified

104 return egcd(e,n)[0]%n
105
106def totient(p,q):
107 # Calculates the totient of pq
108 return (p-1)*(q-1)
109
110def passwordToPrimePair(pswd,bits=64):
111 assert 64<=bits

Callers 1

passwordToKeyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected