/* -*-c-*-
*
- * $Id: pgen.c,v 1.9 2004/04/01 12:50:09 mdw Exp $
+ * $Id$
*
* Prime generation glue
*
* MA 02111-1307, USA.
*/
-/*----- Revision history --------------------------------------------------*
- *
- * $Log: pgen.c,v $
- * Revision 1.9 2004/04/01 12:50:09 mdw
- * Add cyclic group abstraction, with test code. Separate off exponentation
- * functions for better static linking. Fix a buttload of bugs on the way.
- * Generally ensure that negative exponents do inversion correctly. Add
- * table of standard prime-field subgroups. (Binary field subgroups are
- * currently unimplemented but easy to add if anyone ever finds a good one.)
- *
- * Revision 1.8 2002/01/13 13:42:53 mdw
- * More efficient Rabin-Miller test: with random witnesses, skip redundant
- * Montgomerization. (Being bijective, it can't affect the distribution.)
- *
- * Revision 1.7 2001/02/03 16:05:32 mdw
- * Now @mp_drop@ checks its argument is non-NULL before attempting to free
- * it. Note that the macro version @MP_DROP@ doesn't do this.
- *
- * Revision 1.6 2000/10/08 12:11:22 mdw
- * Use @MP_EQ@ instead of @MP_CMP@.
- *
- * Revision 1.5 2000/06/17 11:52:36 mdw
- * Signal a pgen abort if the jump and base share a common factor.
- *
- * Revision 1.4 1999/12/22 16:01:11 mdw
- * Same file, completely different code. Main interface for new prime-
- * search system.
- *
- */
-
/*----- Header files ------------------------------------------------------*/
#include <assert.h>
rabin r;
mp *x = MP_NEW;
- if (MP_ISNEG(p)) return (0);
+ if (MP_NEGP(p)) return (0);
switch (pfilt_smallfactor(p)) {
case PGEN_DONE: return (1);
case PGEN_FAIL: return (0);