Commit babf35c64a45035220adf4412eb3148425f42efe

Francois Perrad 2015-11-12T21:54:52

explicit condition

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/bn_mp_sqrtmod_prime.c b/bn_mp_sqrtmod_prime.c
index 7906f09..2499626 100644
--- a/bn_mp_sqrtmod_prime.c
+++ b/bn_mp_sqrtmod_prime.c
@@ -56,7 +56,7 @@ int mp_sqrtmod_prime(mp_int *n, mp_int *prime, mp_int *ret)
   /* Q = prime - 1 */
   mp_zero(&S);
   /* S = 0 */
-  while (mp_iseven(&Q)) {
+  while (mp_iseven(&Q) != MP_NO) {
     if ((res = mp_div_2(&Q, &Q)) != MP_OKAY)                    goto cleanup;
     /* Q = Q / 2 */
     if ((res = mp_add_d(&S, 1, &S)) != MP_OKAY)                 goto cleanup;