literal suffix
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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
diff --git a/bn_mp_prime_rand.c b/bn_mp_prime_rand.c
index dbf3975..1cfe514 100644
--- a/bn_mp_prime_rand.c
+++ b/bn_mp_prime_rand.c
@@ -45,7 +45,7 @@ mp_err s_mp_prime_random_ex(mp_int *a, int t, int size, int flags, private_mp_pr
}
/* calc the maskAND value for the MSbyte*/
- maskAND = ((size&7) == 0) ? 0xFF : (unsigned char)(0xFF >> (8 - (size & 7)));
+ maskAND = ((size&7) == 0) ? 0xFFu : (unsigned char)(0xFFu >> (8 - (size & 7)));
/* calc the maskOR_msb */
maskOR_msb = 0;
@@ -55,9 +55,9 @@ mp_err s_mp_prime_random_ex(mp_int *a, int t, int size, int flags, private_mp_pr
}
/* get the maskOR_lsb */
- maskOR_lsb = 1;
+ maskOR_lsb = 1u;
if ((flags & MP_PRIME_BBS) != 0) {
- maskOR_lsb |= 3;
+ maskOR_lsb |= 3u;
}
do {
diff --git a/bn_mp_rand.c b/bn_mp_rand.c
index 1818dd0..7e9052c 100644
--- a/bn_mp_rand.c
+++ b/bn_mp_rand.c
@@ -30,7 +30,7 @@ mp_err mp_rand(mp_int *a, int digits)
}
/* TODO: We ensure that the highest digit is nonzero. Should this be removed? */
- while ((a->dp[digits - 1] & MP_MASK) == 0) {
+ while ((a->dp[digits - 1] & MP_MASK) == 0u) {
if ((err = s_mp_rand_source(a->dp + digits - 1, sizeof(mp_digit))) != MP_OKAY) {
return err;
}
diff --git a/bn_s_mp_exptmod.c b/bn_s_mp_exptmod.c
index b1cc0e9..5d5510f 100644
--- a/bn_s_mp_exptmod.c
+++ b/bn_s_mp_exptmod.c
@@ -146,7 +146,7 @@ mp_err s_mp_exptmod(const mp_int *G, const mp_int *X, const mp_int *P, mp_int *Y
}
/* grab the next msb from the exponent */
- y = (buf >> (mp_digit)(MP_DIGIT_BIT - 1)) & 1;
+ y = (buf >> (mp_digit)(MP_DIGIT_BIT - 1)) & 1uL;
buf <<= (mp_digit)1;
/* if the bit is zero and mode == 0 then we ignore it
diff --git a/bn_s_mp_exptmod_fast.c b/bn_s_mp_exptmod_fast.c
index 6b4483c..3045e97 100644
--- a/bn_s_mp_exptmod_fast.c
+++ b/bn_s_mp_exptmod_fast.c
@@ -200,7 +200,7 @@ mp_err s_mp_exptmod_fast(const mp_int *G, const mp_int *X, const mp_int *P, mp_i
}
/* grab the next msb from the exponent */
- y = (mp_digit)(buf >> (MP_DIGIT_BIT - 1)) & 1;
+ y = (mp_digit)(buf >> (MP_DIGIT_BIT - 1)) & 1uL;
buf <<= (mp_digit)1;
/* if the bit is zero and mode == 0 then we ignore it