/* -*-c-*-
*
- * $Id: prim.c,v 1.2 2000/07/29 09:57:42 mdw Exp $
+ * $Id: prim.c,v 1.4 2004/04/08 01:36:15 mdw Exp $
*
* Finding primitive elements
*
* MA 02111-1307, USA.
*/
-/*----- Revision history --------------------------------------------------*
- *
- * $Log: prim.c,v $
- * Revision 1.2 2000/07/29 09:57:42 mdw
- * Improve primitive-element testing a lot. Now much more sensible and
- * orthogonal: you can find a generator for any given subgroup order by
- * putting in the appropriate parameters.
- *
- * Revision 1.1 1999/12/22 15:58:59 mdw
- * Search for primitive elements using prime-search equipment.
- *
- */
-
/*----- Header files ------------------------------------------------------*/
#include "mp.h"
x = mp_copy(ev->m);
else {
x = mpmont_exp(&c->mm, MP_NEW, ev->m, c->exp);
- if (MP_CMP(x, ==, MP_ONE))
+ if (MP_EQ(x, MP_ONE))
goto done;
}
if (c->n == 0)
mp *y = MP_NEW;
while (n) {
y = mpmont_exp(&c->mm, y, x, *f);
- if (MP_CMP(y, ==, MP_ONE)) {
+ if (MP_EQ(y, MP_ONE)) {
mp_drop(y);
goto done;
}