Merge pull request #347 from fperrad/20190907_refactor

some refactoring
This commit is contained in:
Steffen Jaeckel 2019-09-10 09:36:31 +02:00 committed by GitHub
commit 6e160216b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;
}
}