From ba15caa3be3ecfabde5bfda65d5a6b7ef2cea313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Bostr=C3=B6m?= Date: Mon, 20 Jan 2014 13:25:55 -0700 Subject: [PATCH] Add mp_isneg() This function originally came from Heimdal's bundled copy of libtommath. Signed-off-by: Ken Dreyer --- tommath.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tommath.h b/tommath.h index 055a4e0..50eff6e 100644 --- a/tommath.h +++ b/tommath.h @@ -221,6 +221,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) ? MP_YES : MP_NO) /* set to zero */ void mp_zero(mp_int *a);