Merge pull request #347 from fperrad/20190907_refactor some refactoring
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
diff --git a/bn_mp_incr.c b/bn_mp_incr.c
index 5d0039e..7695ac7 100644
--- a/bn_mp_incr.c
+++ b/bn_mp_incr.c
@@ -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 {
diff --git a/bn_mp_reduce_is_2k.c b/bn_mp_reduce_is_2k.c
index bb70b55..a9f4f9f 100644
--- a/bn_mp_reduce_is_2k.c
+++ b/bn_mp_reduce_is_2k.c
@@ -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;
}
diff --git a/bn_mp_reduce_is_2k_l.c b/bn_mp_reduce_is_2k_l.c
index 36fc59f..4bc69be 100644
--- a/bn_mp_reduce_is_2k_l.c
+++ b/bn_mp_reduce_is_2k_l.c
@@ -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;
}
}