From 71e3024f30ed8d1696461e20070a77683e4437e4 Mon Sep 17 00:00:00 2001 From: Kevin B Kenny Date: Tue, 10 May 2005 17:20:39 +0000 Subject: [PATCH] fix mp_iseven --- tommath.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tommath.h b/tommath.h index 7dda0a5..80bae69 100644 --- a/tommath.h +++ b/tommath.h @@ -203,7 +203,7 @@ int mp_init_size(mp_int *a, int size); /* ---> Basic Manipulations <--- */ #define mp_iszero(a) (((a)->used == 0) ? MP_YES : MP_NO) -#define mp_iseven(a) ((((a)->used > 0) && (((a)->dp[0] & 1u) == 0u)) ? MP_YES : MP_NO) +#define mp_iseven(a) ((((a)->used == 0) || (((a)->dp[0] & 1u) == 0u)) ? MP_YES : MP_NO) #define mp_isodd(a) ((((a)->used > 0) && (((a)->dp[0] & 1u) == 1u)) ? MP_YES : MP_NO) #define mp_isneg(a) (((a)->sign != MP_ZPOS) ? MP_YES : MP_NO)