From 4dc420bb1ed9f36341af4e6145e004b94a33fa71 Mon Sep 17 00:00:00 2001 From: ZeroBone Date: Wed, 29 Dec 2021 19:06:05 +0100 Subject: [PATCH] Fixed bug in the computation of phi(n) in the case when p = q, updated gitignore --- .gitignore | 5 ++++- cracker.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 3afe388..be81ff5 100644 --- a/.gitignore +++ b/.gitignore @@ -129,4 +129,7 @@ dmypy.json .pyre/ # Vs Code -.vscode/ \ No newline at end of file +.vscode/ + +# IntelliJ +.idea \ No newline at end of file diff --git a/cracker.py b/cracker.py index 0c1cf4e..bccdb83 100644 --- a/cracker.py +++ b/cracker.py @@ -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)