Skip to content

Commit

Permalink
Fix bug with negative operand.
Browse files Browse the repository at this point in the history
  • Loading branch information
dfaranha committed Oct 19, 2023
1 parent f05130c commit 4259ff2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/bn/relic_bn_div.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,11 @@ void bn_div_rem_dig(bn_t c, dig_t *d, const bn_t a, dig_t b) {
}

if (d != NULL) {
*d = r;
if (bn_sign(a) == RLC_NEG) {
*d = b - r;
} else {
*d = r;
}
}
}
RLC_CATCH_ANY {
Expand Down

0 comments on commit 4259ff2

Please sign in to comment.