projects
/
u
/
mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added lots of Rijndael tests.
[u/mdw/catacomb]
/
rabin.c
diff --git
a/rabin.c
b/rabin.c
index
a5ebdcc
..
e6cd488
100644
(file)
--- a/
rabin.c
+++ b/
rabin.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: rabin.c,v 1.
5 2000/10/08 12:11:22
mdw Exp $
+ * $Id: rabin.c,v 1.
6 2001/06/16 12:56:38
mdw Exp $
*
* Miller-Rabin primality test
*
*
* Miller-Rabin primality test
*
@@
-30,6
+30,9
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: rabin.c,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: rabin.c,v $
+ * Revision 1.6 2001/06/16 12:56:38 mdw
+ * Fixes for interface change to @mpmont_expr@ and @mpmont_mexpr@.
+ *
* Revision 1.5 2000/10/08 12:11:22 mdw
* Use @MP_EQ@ instead of @MP_CMP@.
*
* Revision 1.5 2000/10/08 12:11:22 mdw
* Use @MP_EQ@ instead of @MP_CMP@.
*
@@
-120,7
+123,8
@@
int rabin_test(rabin *r, mp *g)
* @y@ here has an extra factor of %$R$%.
*/
* @y@ here has an extra factor of %$R$%.
*/
- y = mpmont_expr(&r->mm, MP_NEW, g, r->r);
+ y = mpmont_mul(&r->mm, MP_NEW, g, r->mm.r2);
+ y = mpmont_expr(&r->mm, y, y, r->r);
if (MP_EQ(y, r->mm.r) || MP_EQ(y, r->m1)) {
rc = PGEN_PASS;
goto done;
if (MP_EQ(y, r->mm.r) || MP_EQ(y, r->m1)) {
rc = PGEN_PASS;
goto done;