/* -*-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.
*
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);