summaryrefslogtreecommitdiffstats
path: root/keygen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'keygen.cpp')
-rw-r--r--keygen.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/keygen.cpp b/keygen.cpp
index 023a8c9..53751f2 100644
--- a/keygen.cpp
+++ b/keygen.cpp
@@ -6,7 +6,10 @@
#include "keygen.h"
#include "miller_rabin.h"
+
+#ifndef DEBUG
#define DEBUG
+#endif
/* forward declaration of variables from keygen_args.h */
extern char *pubkey;
@@ -95,7 +98,7 @@ int main(int argc, char **argv)
unsigned long d = 1;
while (1)
{
- if ( (e*d - 1) / phi )
+ if ( ((e*d) % phi) == 1 )
break;
d++;