Skip to content

Commit

Permalink
corrected types in s_mp_div_small.c
Browse files Browse the repository at this point in the history
  • Loading branch information
czurnieden committed Oct 19, 2019
1 parent 929ef57 commit 93d6283
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions bn_s_mp_div_small.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
mp_err s_mp_div_small(const mp_int *a, const mp_int *b, mp_int *c, mp_int *d)
{
mp_int ta, tb, tq, q;
int n, n2;
int n;
mp_sign sign;
mp_err err;

/* init our temps */
Expand All @@ -32,15 +33,15 @@ mp_err s_mp_div_small(const mp_int *a, const mp_int *b, mp_int *c, mp_int *d)
}

/* now q == quotient and ta == remainder */
n = a->sign;
n2 = (a->sign == b->sign) ? MP_ZPOS : MP_NEG;

sign = (a->sign == b->sign) ? MP_ZPOS : MP_NEG;
if (c != NULL) {
mp_exch(c, &q);
c->sign = MP_IS_ZERO(c) ? MP_ZPOS : n2;
c->sign = MP_IS_ZERO(c) ? MP_ZPOS : sign;
}
if (d != NULL) {
mp_exch(d, &ta);
d->sign = MP_IS_ZERO(d) ? MP_ZPOS : n;
d->sign = MP_IS_ZERO(d) ? MP_ZPOS : a->sign;
}
LBL_ERR:
mp_clear_multi(&ta, &tb, &tq, &q, NULL);
Expand Down

0 comments on commit 93d6283

Please sign in to comment.