/* -*-c-*-
*
- * $Id: dsa-gen.c,v 1.6 2000/07/29 10:00:14 mdw Exp $
+ * $Id: dsa-gen.c,v 1.7 2000/08/15 21:45:05 mdw Exp $
*
* Generate DSA shared parameters
*
/*----- Revision history --------------------------------------------------*
*
* $Log: dsa-gen.c,v $
+ * Revision 1.7 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.6 2000/07/29 10:00:14 mdw
* Rename `dsa_seed' to `dsa_gen' for consistency with other parameter-
* generation interfaces.
/* --- Do the trial division --- */
- {
- mp *g = MP_NEW;
- mp_gcd(&g, 0, 0, m, primorial);
- if (MP_CMP(g, ==, MP_ONE) || MP_CMP(g, ==, m))
- rc = PGEN_TRY;
- else
- rc = PGEN_FAIL;
- mp_drop(g);
- }
+ rc = pfilt_smallfactor(m);
/* --- Return the result --- */
if (!rc) {
mp_drop(dp.q); mp_drop(dp.p); mp_drop(dp.g);
}
- assert(mparena_count(MPARENA_GLOBAL) == 1); /* Primorial! */
+ assert(mparena_count(MPARENA_GLOBAL) == 0);
return (ok);
}