Commit bd39da2397ff12de264feab94b94a6cd9a48bb44

Steffen Jaeckel 2015-11-12T01:33:25

use correct value to compare to in mp_isneg() macro

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/tommath.h b/tommath.h
index 5dcfdb6..16cd023 100644
--- a/tommath.h
+++ b/tommath.h
@@ -248,7 +248,7 @@ int mp_init_size(mp_int *a, int size);
 #define mp_iszero(a) (((a)->used == 0) ? MP_YES : MP_NO)
 #define mp_iseven(a) ((((a)->used > 0) && (((a)->dp[0] & 1) == 0)) ? MP_YES : MP_NO)
 #define mp_isodd(a)  ((((a)->used > 0) && (((a)->dp[0] & 1) == 1)) ? MP_YES : MP_NO)
-#define mp_isneg(a)  (((a)->sign != 0) ? MP_YES : MP_NO)
+#define mp_isneg(a)  (((a)->sign != MP_ZPOS) ? MP_YES : MP_NO)
 
 /* set to zero */
 void mp_zero(mp_int *a);