projects
/
u
/
mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix off-by one bug in mprand_range. Probably security critical: the old
[u/mdw/catacomb]
/
mpmont-mexp.c
diff --git
a/mpmont-mexp.c
b/mpmont-mexp.c
index
0e5da91
..
c0ede4d
100644
(file)
--- a/
mpmont-mexp.c
+++ b/
mpmont-mexp.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: mpmont-mexp.c,v 1.
4 2000/06/17 11:45:09
mdw Exp $
+ * $Id: mpmont-mexp.c,v 1.
5 2000/10/08 12:11:22
mdw Exp $
*
* Multiple simultaneous exponentiations
*
*
* Multiple simultaneous exponentiations
*
@@
-30,6
+30,9
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: mpmont-mexp.c,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: mpmont-mexp.c,v $
+ * Revision 1.5 2000/10/08 12:11:22 mdw
+ * Use @MP_EQ@ instead of @MP_CMP@.
+ *
* Revision 1.4 2000/06/17 11:45:09 mdw
* Major memory management overhaul. Added arena support. Use the secure
* arena for secret integers. Replace and improve the MP management macros
* Revision 1.4 2000/06/17 11:45:09 mdw
* Major memory management overhaul. Added arena support. Use the secure
* arena for secret integers. Replace and improve the MP management macros
@@
-249,7
+252,7
@@
static int verify(size_t n, dstr *v)
rr = *(mp **)v[j].buf;
mpmont_create(&mm, m);
r = mpmont_mexp(&mm, MP_NEW, f, n);
rr = *(mp **)v[j].buf;
mpmont_create(&mm, m);
r = mpmont_mexp(&mm, MP_NEW, f, n);
- if (
MP_CMP(r, !=
, rr)) {
+ if (
!MP_EQ(r
, rr)) {
fputs("\n*** mexp failed\n", stderr);
fputs("m = ", stderr); mp_writefile(m, stderr, 10);
for (i = 0; i < n; i++) {
fputs("\n*** mexp failed\n", stderr);
fputs("m = ", stderr); mp_writefile(m, stderr, 10);
for (i = 0; i < n; i++) {