Skip to content

Commit

Permalink
Fixed bug in the computation of phi(n) in the case when p = q, update…
Browse files Browse the repository at this point in the history
…d gitignore
  • Loading branch information
ZeroBone committed Dec 29, 2021
1 parent 9584ea9 commit 4dc420b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,7 @@ dmypy.json
.pyre/

# Vs Code
.vscode/
.vscode/

# IntelliJ
.idea
2 changes: 1 addition & 1 deletion cracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def main():
print("q = %d" % q)
print("Factorizing complete.")

phi = (p - 1) * (q - 1)
phi = (p - 1) * (q - 1) if p != q else p * p - p

print("phi(n) = %d" % phi)

Expand Down

0 comments on commit 4dc420b

Please sign in to comment.