Skip to content

Commit

Permalink
Fix for 32-bit version.
Browse files Browse the repository at this point in the history
  • Loading branch information
dfaranha committed Jul 4, 2024
1 parent a65e5ef commit 31eb7ea
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/arch/relic_arch_x64.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
2 changes: 1 addition & 1 deletion src/arch/relic_arch_x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
4 changes: 2 additions & 2 deletions src/bn/relic_bn_smb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 31eb7ea

Please sign in to comment.