Commit 6e160216b05acd1e14f8c16690577387ba034dfe

Steffen Jaeckel 2019-09-10T09:36:31

Merge pull request #347 from fperrad/20190907_refactor some refactoring

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;
          }
       }