use MP_DIGIT_MAX instead of MP_MASK

This commit is contained in:
Francois Perrad 2019-05-07 21:30:27 +02:00
parent d6a8de54f6
commit ffdd008dda
3 changed files with 3 additions and 3 deletions

View File

@ -20,7 +20,7 @@ mp_err mp_incr(mp_int *a)
a->sign = MP_NEG;
}
return MP_OKAY;
} else if (a->dp[0] < MP_MASK) {
} else if (a->dp[0] < MP_DIGIT_MAX) {
a->dp[0]++;
return MP_OKAY;
} else {

View File

@ -24,7 +24,7 @@ mp_bool mp_reduce_is_2k(const mp_int *a)
return MP_NO;
}
iz <<= 1;
if (iz > MP_MASK) {
if (iz > MP_DIGIT_MAX) {
++iw;
iz = 1;
}

View File

@ -15,7 +15,7 @@ mp_bool mp_reduce_is_2k_l(const mp_int *a)
} else if (a->used > 1) {
/* if more than half of the digits are -1 we're sold */
for (iy = ix = 0; ix < a->used; ix++) {
if (a->dp[ix] == MP_MASK) {
if (a->dp[ix] == MP_DIGIT_MAX) {
++iy;
}
}