/* -*-c-*-
*
- * $Id: mpmont.c,v 1.11 2000/10/08 12:04:27 mdw Exp $
+ * $Id: mpmont.c,v 1.14 2001/02/22 09:04:26 mdw Exp $
*
* Montgomery reduction
*
/*----- Revision history --------------------------------------------------*
*
* $Log: mpmont.c,v $
+ * Revision 1.14 2001/02/22 09:04:26 mdw
+ * Cosmetic fix.
+ *
+ * Revision 1.13 2001/02/03 12:00:29 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.12 2000/10/08 15:48:35 mdw
+ * Rename Karatsuba constants now that we have @gfx_kmul@ too.
+ *
* Revision 1.11 2000/10/08 12:04:27 mdw
* (mpmont_reduce, mpmont_mul): Cope with negative numbers.
*
/* --- Check for serious Karatsuba reduction --- */
- if (n > KARATSUBA_CUTOFF * 3) {
+ if (n > MPK_THRESH * 3) {
mp al;
mpw *vl;
mp *u;
mp *mpmont_mul(mpmont *mm, mp *d, mp *a, mp *b)
{
- if (mm->n > KARATSUBA_CUTOFF * 3) {
+ if (mm->n > MPK_THRESH * 3) {
d = mp_mul(d, a, b);
d = mpmont_reduce(mm, d, d);
} else {
*/
MP_RSTEP(&sc);
- while (!MP_RBIT(&sc)) {
+ while (!MP_RBIT(&sc))
MP_RSTEP(&sc);
- }
/* --- Now for the main work --- */
mp_drop(tab[i]);
xfree(tab);
exit:
- if (d != MP_NEW)
- mp_drop(d);
- if (spare)
- mp_drop(spare);
+ mp_drop(d);
+ mp_drop(spare);
return (x);
}