~mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
math/mp.h: Muffle `unused value' warnings from `MP_COPY'.
[catacomb]
/
math
/
mp-modsqrt.c
diff --git
a/math/mp-modsqrt.c
b/math/mp-modsqrt.c
index
c5aed1f
..
f7a7414
100644
(file)
--- a/
math/mp-modsqrt.c
+++ b/
math/mp-modsqrt.c
@@
-63,12
+63,18
@@
mp *mp_modsqrt(mp *d, mp *a, mp *p)
mp *r, *A, *aa;
mp *t;
grand *gr;
mp *r, *A, *aa;
mp *t;
grand *gr;
+ int j;
/* --- Cope if %$a \not\in Q_p$% --- */
/* --- Cope if %$a \not\in Q_p$% --- */
- if (mp_jacobi(a, p) != 1) {
+ j = mp_jacobi(a, p);
+ if (j == -1) {
mp_drop(d);
return (0);
mp_drop(d);
return (0);
+ } else if (j == 0) {
+ if (d != a) mp_drop(d);
+ d = MP_COPY(a);
+ return (d);
}
/* --- Choose some quadratic non-residue --- */
}
/* --- Choose some quadratic non-residue --- */