Bug fix to the GCD check. With any luck, this is the last of these to
authormdw <mdw>
Mon, 3 Jul 2000 18:09:27 +0000 (18:09 +0000)
committermdw <mdw>
Mon, 3 Jul 2000 18:09:27 +0000 (18:09 +0000)
need nailing to the wall.

pgen-safe.c

index b680ae4..03ba35a 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: pgen-safe.c,v 1.3 2000/06/17 11:52:36 mdw Exp $
+ * $Id: pgen-safe.c,v 1.4 2000/07/03 18:09:27 mdw Exp $
  *
  * Safe prime generation
  *
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: pgen-safe.c,v $
+ * Revision 1.4  2000/07/03 18:09:27  mdw
+ * Bug fix to the GCD check.  With any luck, this is the last of these to
+ * need nailing to the wall.
+ *
  * Revision 1.3  2000/06/17 11:52:36  mdw
  * Signal a pgen abort if the jump and base share a common factor.
  *
@@ -133,7 +137,7 @@ int pgen_safejump(int rq, pgen_event *ev, void *p)
       if ((p->v[0] & 3) != 3)
        p = mp_add(p, p, j->jq.m);
       q = mp_lsr(MP_NEW, p, 1);
-      mp_gcd(&g, 0, 0, q, j->jq.m);
+      mp_gcd(&g, 0, 0, p, j->jq.m);
       if (MP_CMP(g, >, MP_ONE)) {
        ev->m = p;
        mp_drop(q);