X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/42684bdb717221e41ad97cfefed2242e0553f835..79a340293970d5f9b9c000f82769179f9ba551bd:/mpmont-mexp.c diff --git a/mpmont-mexp.c b/mpmont-mexp.c index 4180fbc..1d1266f 100644 --- a/mpmont-mexp.c +++ b/mpmont-mexp.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: mpmont-mexp.c,v 1.1 1999/11/19 13:19:29 mdw Exp $ + * $Id: mpmont-mexp.c,v 1.2 1999/11/21 11:35:10 mdw Exp $ * * Multiplle simultaneous exponentiations * @@ -30,6 +30,10 @@ /*----- Revision history --------------------------------------------------* * * $Log: mpmont-mexp.c,v $ + * Revision 1.2 1999/11/21 11:35:10 mdw + * Performance improvement: use @mp_sqr@ and @mpmont_reduce@ instead of + * @mpmont_mul@ for squaring in exponentiation. + * * Revision 1.1 1999/11/19 13:19:29 mdw * Simultaneous exponentiation support. * @@ -157,7 +161,8 @@ mp *mpmont_mexpr(mpmont *mm, mpmont_factor *f, size_t n) /* --- Accumulate the result --- */ if (spare) { - dd = mpmont_mul(mm, spare, a, a); + dd = mp_sqr(spare, a); + dd = mpmont_reduce(mm, dd, dd); spare = a; a = dd; }