/* -*-c-*-
*
- * $Id: mpmont.c,v 1.17 2004/04/01 12:50:09 mdw Exp $
+ * $Id: mpmont.c,v 1.18 2004/04/03 03:32:05 mdw Exp $
*
* Montgomery reduction
*
/*----- Revision history --------------------------------------------------*
*
* $Log: mpmont.c,v $
+ * Revision 1.18 2004/04/03 03:32:05 mdw
+ * General robustification.
+ *
* Revision 1.17 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.
mp *r2 = mp_new(2 * n + 1, 0);
mp r;
- /* --- Validate the arguments --- */
-
- assert(((void)"Montgomery modulus must be positive",
- (m->f & MP_NEG) == 0));
- assert(((void)"Montgomery modulus must be odd", m->v[0] & 1));
-
/* --- Take a copy of the modulus --- */
- mp_shrink(m);
+ assert(MP_ISPOS(m) && MP_ISODD(m));
mm->m = MP_COPY(m);
/* --- Determine %$R^2$% --- */