From 31eb7eaebff27ca727ac67b0bb1ff1c0da1736a8 Mon Sep 17 00:00:00 2001 From: "Diego F. Aranha" Date: Thu, 4 Jul 2024 10:25:14 +0200 Subject: [PATCH] Fix for 32-bit version. --- src/arch/relic_arch_x64.c | 2 +- src/arch/relic_arch_x86.c | 2 +- src/bn/relic_bn_smb.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/arch/relic_arch_x64.c b/src/arch/relic_arch_x64.c index 9a49ea209..baebd138a 100644 --- a/src/arch/relic_arch_x64.c +++ b/src/arch/relic_arch_x64.c @@ -109,5 +109,5 @@ uint_t arch_lzcnt(dig_t x) { } uint_t arch_tzcnt(dig_t x) { - return core_get()->tzcnt_ptr((ull_t)x) - (8 * sizeof(ull_t) - WSIZE); + return core_get()->tzcnt_ptr(x); } diff --git a/src/arch/relic_arch_x86.c b/src/arch/relic_arch_x86.c index 77fba62fb..a97388a70 100644 --- a/src/arch/relic_arch_x86.c +++ b/src/arch/relic_arch_x86.c @@ -68,5 +68,5 @@ uint_t arch_lzcnt(dig_t x) { } uint_t arch_tzcnt(dig_t x) { - return core_get()->tzcnt_ptr((uint32_t)x) - (8 * sizeof(uint32_t) - WSIZE); + return core_get()->tzcnt_ptr(x); } diff --git a/src/bn/relic_bn_smb.c b/src/bn/relic_bn_smb.c index f74cfee6f..54441cd20 100644 --- a/src/bn/relic_bn_smb.c +++ b/src/bn/relic_bn_smb.c @@ -80,7 +80,7 @@ int bn_smb_jac(const bn_t a, const bn_t b) { dis_t ai, bi, ci, di; dig_t n, d, t; bn_t r, t0, t1, t2, t3; - size_t z, i, s = (RLC_DIG >> 1) - 2; + uint_t z, i, s = (RLC_DIG >> 1) - 2; bn_null(t0); bn_null(t1); @@ -159,7 +159,7 @@ int bn_smb_jac(const bn_t a, const bn_t b) { t ^= d ^ (d >> 1); i -= 1; } else { - size_t z = RLC_MIN(i, arch_tzcnt(n)); + z = RLC_MIN(i, arch_tzcnt(n)); t ^= (d ^ (d >> 1)) & (z << 1); ci = ci << z; di = di << z;