projects
/
u
/
mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change dummy names in grand objects so that they say what sort of thing
[u/mdw/catacomb]
/
mp-modsqrt.c
diff --git
a/mp-modsqrt.c
b/mp-modsqrt.c
index
1c66c78
..
6c21dc4
100644
(file)
--- a/
mp-modsqrt.c
+++ b/
mp-modsqrt.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: mp-modsqrt.c,v 1.
2 2000/10/08 12:02:21
mdw Exp $
+ * $Id: mp-modsqrt.c,v 1.
3 2001/02/03 12:00:29
mdw Exp $
*
* Compute square roots modulo a prime
*
*
* Compute square roots modulo a prime
*
@@
-30,6
+30,10
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: mp-modsqrt.c,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: mp-modsqrt.c,v $
+ * Revision 1.3 2001/02/03 12:00:29 mdw
+ * Now @mp_drop@ checks its argument is non-NULL before attempting to free
+ * it. Note that the macro version @MP_DROP@ doesn't do this.
+ *
* Revision 1.2 2000/10/08 12:02:21 mdw
* Use @MP_EQ@ instead of @MP_CMP@.
*
* Revision 1.2 2000/10/08 12:02:21 mdw
* Use @MP_EQ@ instead of @MP_CMP@.
*
@@
-78,8
+82,7
@@
mp *mp_modsqrt(mp *d, mp *a, mp *p)
/* --- Cope if %$a \not\in Q_p$% --- */
if (mp_jacobi(a, p) != 1) {
/* --- Cope if %$a \not\in Q_p$% --- */
if (mp_jacobi(a, p) != 1) {
- if (d)
- mp_drop(d);
+ mp_drop(d);
return (0);
}
return (0);
}
@@
-146,8
+149,7
@@
mp *mp_modsqrt(mp *d, mp *a, mp *p)
d = mpmont_reduce(&mm, d, r);
mp_drop(ainv);
mp_drop(r); mp_drop(c);
d = mpmont_reduce(&mm, d, r);
mp_drop(ainv);
mp_drop(r); mp_drop(c);
- if (dd)
- mp_drop(dd);
+ mp_drop(dd);
mp_drop(mone);
mpmont_destroy(&mm);
mp_drop(mone);
mpmont_destroy(&mm);
@@
-194,8
+196,7
@@
static int verify(dstr *v)
mp_drop(a);
mp_drop(p);
mp_drop(a);
mp_drop(p);
- if (r)
- mp_drop(r);
+ mp_drop(r);
mp_drop(rr);
assert(mparena_count(MPARENA_GLOBAL) == 0);
return (ok);
mp_drop(rr);
assert(mparena_count(MPARENA_GLOBAL) == 0);
return (ok);