/* -*-c-*-
*
- * $Id: limlee.c,v 1.3 2000/07/29 09:58:32 mdw Exp $
+ * $Id: limlee.c,v 1.4 2000/08/15 21:45:05 mdw Exp $
*
* Generate Lim-Lee primes
*
/*----- Revision history --------------------------------------------------*
*
* $Log: limlee.c,v $
+ * Revision 1.4 2000/08/15 21:45:05 mdw
+ * Use the new trial division equipment in pfilt. This gives a 10%
+ * performance improvement in dsa-gen.t.
+ *
* Revision 1.3 2000/07/29 09:58:32 mdw
* (limlee): Bug fix. Old versions didn't set the filter step if @ql@ was
* an exact divisor of @pl@.
/* --- Now allocate the working memory --- */
- primorial_setup();
v = xmalloc(mm * sizeof(mp *));
c = xmalloc(mm);
{
mp *p = mpmul_done(&mmul);
- mp *g = newp;
+ mp *g;
int rc;
/* --- Check for small factors --- */
p = mp_lsl(p, p, 1);
p = mp_add(p, p, MP_ONE);
- mp_gcd(&g, 0, 0, p, primorial);
- if (MP_CMP(g, !=, MP_ONE)) {
- mp_drop(g);
+ rc = pfilt_smallfactor(p);
+ if (rc == PGEN_FAIL) {
mp_drop(p);
continue;
}
- mp_drop(g);
/* --- Send an event out --- */