projects
/
u
/
mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mp-modsqrt: Always return the smaller possible square root.
[u/mdw/catacomb]
/
mpmont-mexp.c
diff --git
a/mpmont-mexp.c
b/mpmont-mexp.c
index
884d660
..
ce46fef
100644
(file)
--- a/
mpmont-mexp.c
+++ b/
mpmont-mexp.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id
: mpmont-mexp.c,v 1.9 2004/04/08 01:36:15 mdw Exp
$
+ * $Id$
*
* Multiple simultaneous exponentiations
*
*
* Multiple simultaneous exponentiations
*
@@
-63,7
+63,7
@@
static mp *mexpr(mpmont *mm, mp *d, mp_expfactor *f, size_t n)
mp *t;
if (f[i].exp->f & MP_BURN)
spare = MP_NEWSEC;
mp *t;
if (f[i].exp->f & MP_BURN)
spare = MP_NEWSEC;
- if (
f[i].exp->f & MP_NEG
) {
+ if (
MP_NEGP(f[i].exp)
) {
t = mpmont_reduce(mm, f[i].base, f[i].base);
t = mp_modinv(t, t, mm->m);
f[i].base = mpmont_mul(mm, t, t, mm->r2);
t = mpmont_reduce(mm, f[i].base, f[i].base);
t = mp_modinv(t, t, mm->m);
f[i].base = mpmont_mul(mm, t, t, mm->r2);