~mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Handle points at infinity properly in listings.
[catacomb]
/
mp-jacobi.c
diff --git
a/mp-jacobi.c
b/mp-jacobi.c
index
aba168e
..
0e187cf
100644
(file)
--- a/
mp-jacobi.c
+++ b/
mp-jacobi.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: mp-jacobi.c,v 1.
3 2000/07/20 17:14:34
mdw Exp $
+ * $Id: mp-jacobi.c,v 1.
4 2000/12/06 20:31:33
mdw Exp $
*
* Compute Jacobi symbol
*
*
* Compute Jacobi symbol
*
@@
-30,6
+30,9
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: mp-jacobi.c,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: mp-jacobi.c,v $
+ * Revision 1.4 2000/12/06 20:31:33 mdw
+ * Add assertion to prevent crapness.
+ *
* Revision 1.3 2000/07/20 17:14:34 mdw
* Simplify by using @mp_odd@.
*
* Revision 1.3 2000/07/20 17:14:34 mdw
* Simplify by using @mp_odd@.
*
@@
-64,6
+67,8
@@
int mp_jacobi(mp *a, mp *n)
{
int s = 1;
{
int s = 1;
+ assert(((void)"n must be odd in mp_jacobi", MP_LEN(n) && (n->v[0] & 1)));
+
/* --- Take copies of the arguments --- */
a = MP_COPY(a);
/* --- Take copies of the arguments --- */
a = MP_COPY(a);