mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 09:21:13 +08:00
fix(mypy): Fix annotations for 13 cipher algorithms (#4278)
* Initial fix for mypy errors in some cipher algorithms * fix(mypy): Update type hints * fix(mypy): Update type hints for enigma_machine2.py * Update as per the suggestion Co-authored-by: Christian Clauss <cclauss@me.com> Co-authored-by: Christian Clauss <cclauss@me.com>
This commit is contained in:
@ -4,9 +4,9 @@ def gcd(a: int, b: int) -> int:
|
||||
return b
|
||||
|
||||
|
||||
def findModInverse(a: int, m: int) -> int:
|
||||
def find_mod_inverse(a: int, m: int) -> int:
|
||||
if gcd(a, m) != 1:
|
||||
return None
|
||||
raise ValueError(f"mod inverse of {a!r} and {m!r} does not exist")
|
||||
u1, u2, u3 = 1, 0, a
|
||||
v1, v2, v3 = 0, 1, m
|
||||
while v3 != 0:
|
||||
|
Reference in New Issue
Block a user