mp_iseven/mp_isodd should be inline

This commit is contained in:
Daniel Mendler 2019-10-23 20:06:33 +02:00
parent f21ea6ce18
commit eb70378bfb
No known key found for this signature in database
GPG Key ID: D88ADB2A2693CA43
3 changed files with 2 additions and 22 deletions

View File

@ -1,10 +0,0 @@
#include "tommath_private.h"
#ifdef MP_ISEVEN_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
/* SPDX-License-Identifier: Unlicense */
mp_bool mp_iseven(const mp_int *a)
{
return MP_IS_EVEN(a) ? MP_YES : MP_NO;
}
#endif

View File

@ -1,10 +0,0 @@
#include "tommath_private.h"
#ifdef MP_ISODD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
/* SPDX-License-Identifier: Unlicense */
mp_bool mp_isodd(const mp_int *a)
{
return MP_IS_ODD(a) ? MP_YES : MP_NO;
}
#endif

View File

@ -209,9 +209,9 @@ mp_err mp_init_size(mp_int *a, int size) MP_WUR;
/* ---> Basic Manipulations <--- */
#define mp_iszero(a) (((a)->used == 0) ? MP_YES : MP_NO)
mp_bool mp_iseven(const mp_int *a) MP_WUR;
mp_bool mp_isodd(const mp_int *a) MP_WUR;
#define mp_isneg(a) (((a)->sign != MP_ZPOS) ? 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)
/* set to zero */
void mp_zero(mp_int *a);