/* -*-c-*-
*
- * $Id: mpmont.c,v 1.15 2001/06/16 13:00:20 mdw Exp $
+ * $Id: mpmont.c,v 1.16 2002/01/13 13:40:31 mdw Exp $
*
* Montgomery reduction
*
/*----- Revision history --------------------------------------------------*
*
* $Log: mpmont.c,v $
+ * Revision 1.16 2002/01/13 13:40:31 mdw
+ * Avoid trashing arguments before we've used them.
+ *
* Revision 1.15 2001/06/16 13:00:20 mdw
* Use the generic exponentiation functions.
*
mp *mpmont_exp(mpmont *mm, mp *d, mp *a, mp *e)
{
+ e = MP_COPY(e);
d = mpmont_mul(mm, d, a, mm->r2);
d = mpmont_expr(mm, d, d, e);
d = mpmont_reduce(mm, d, d);
+ MP_DROP(e);
return (d);
}