~mdw
/
catacomb
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0e70bd4
)
math/mpmont.c: Make REDC coefficient as long as the modulus.
author
Mark Wooding
<mdw@distorted.org.uk>
Mon, 12 Sep 2016 21:32:37 +0000
(22:32 +0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Sun, 2 Oct 2016 12:31:59 +0000
(13:31 +0100)
We'll have trouble later if it's too short.
math/mpmont.c
patch
|
blob
|
blame
|
history
diff --git
a/math/mpmont.c
b/math/mpmont.c
index
b95e1cf
..
a86623b
100644
(file)
--- a/
math/mpmont.c
+++ b/
math/mpmont.c
@@
-209,6
+209,7
@@
int mpmont_create(mpmont *mm, mp *m)
mp_build(&r, r2->v + n, r2->vl);
mm->mi = mp_modinv(MP_NEW, m, &r);
mm->mi = mp_sub(mm->mi, &r, mm->mi);
+ MP_ENSURE(mm->mi, n);
/* --- Discover the values %$R \bmod m$% and %$R^2 \bmod m$% --- */