Skip to content

Commit

Permalink
Remove UB.
Browse files Browse the repository at this point in the history
  • Loading branch information
dfaranha committed Jul 4, 2024
1 parent 9d82cb8 commit aec2bd4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/bn/relic_bn_smb.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,15 @@ int bn_smb_jac(const bn_t a, const bn_t b) {
n = (n - d) >> 1;
ai = ai - ci;
bi = bi - di;
ci = ci << 1;
di = di << 1;
ci += ci;
di += di;
t ^= d ^ (d >> 1);
i -= 1;
} else {
z = RLC_MIN(i, arch_tzcnt(n));
t ^= (d ^ (d >> 1)) & (z << 1);
ci = ci << z;
di = di << z;
ci = (dig_t)ci << z;
di = (dig_t)di << z;
n >>= z;
i -= z;
}
Expand Down

0 comments on commit aec2bd4

Please sign in to comment.