diff options
Diffstat (limited to 'bench')
| -rw-r--r-- | bench/libgmp.h | 14 | ||||
| -rw-r--r-- | bench/libtommath.h | 2 |
2 files changed, 13 insertions, 3 deletions
diff --git a/bench/libgmp.h b/bench/libgmp.h index 832bfe9..7dc74e2 100644 --- a/bench/libgmp.h +++ b/bench/libgmp.h @@ -40,7 +40,7 @@ zunsetup(void) #define QUASIUNIFORM 0 #define UNIFORM 1 -#define zperror(x) 0 +#define zperror(x) ((void)0) #define zinit mpz_init #define zfree mpz_clear @@ -54,7 +54,6 @@ zunsetup(void) #define zand mpz_and #define zor mpz_ior #define zxor mpz_xor -#define znot mpz_com #define zbtest mpz_tstbit #define zeven mpz_even_p /* Note, must not have side effects. */ #define zodd mpz_odd_p /* Note, must not have side effects. */ @@ -118,6 +117,17 @@ zseti(z_t r, long long int val) } static void +znot(z_t r, z_t a) +{ + size_t bits = zbits(a); + mpz_set_ui(_b, 0); + mpz_setbit(_b, bits); + zsub(_b, _b, _1); + zxor(r, a, _b); + zneg(r, r); +} + +static void zsplit(z_t high, z_t low, z_t a, size_t brk) { if (low == a) { diff --git a/bench/libtommath.h b/bench/libtommath.h index c321c78..4a81373 100644 --- a/bench/libtommath.h +++ b/bench/libtommath.h @@ -33,7 +33,7 @@ zunsetup(void) #define QUASIUNIFORM 0 #define UNIFORM 1 -#define zperror(x) 0 +#define zperror(x) ((void)0) #define zinit(a) mp_init(a) #define zfree(a) mp_clear(a) |
