projects
/
u
/
mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Performance improvement: use @mp_sqr@ and @mpmont_reduce@ instead of
[u/mdw/catacomb]
/
mpmont-mexp.c
diff --git
a/mpmont-mexp.c
b/mpmont-mexp.c
index
4180fbc
..
1d1266f
100644
(file)
--- a/
mpmont-mexp.c
+++ b/
mpmont-mexp.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-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
*
*
* Multiplle simultaneous exponentiations
*
@@
-30,6
+30,10
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: mpmont-mexp.c,v $
/*----- 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.
*
* 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) {
/* --- 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;
}
spare = a;
a = dd;
}