Skip to content

Commit e7f34c6

Browse files
committed
literal suffix
1 parent 431ea33 commit e7f34c6

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

bn_mp_prime_rand.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ mp_err s_mp_prime_random_ex(mp_int *a, int t, int size, int flags, private_mp_pr
4545
}
4646

4747
/* calc the maskAND value for the MSbyte*/
48-
maskAND = ((size&7) == 0) ? 0xFF : (unsigned char)(0xFF >> (8 - (size & 7)));
48+
maskAND = ((size&7) == 0) ? 0xFFu : (unsigned char)(0xFFu >> (8 - (size & 7)));
4949

5050
/* calc the maskOR_msb */
5151
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
5555
}
5656

5757
/* get the maskOR_lsb */
58-
maskOR_lsb = 1;
58+
maskOR_lsb = 1u;
5959
if ((flags & MP_PRIME_BBS) != 0) {
60-
maskOR_lsb |= 3;
60+
maskOR_lsb |= 3u;
6161
}
6262

6363
do {

bn_mp_rand.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ mp_err mp_rand(mp_int *a, int digits)
3030
}
3131

3232
/* TODO: We ensure that the highest digit is nonzero. Should this be removed? */
33-
while ((a->dp[digits - 1] & MP_MASK) == 0) {
33+
while ((a->dp[digits - 1] & MP_MASK) == 0u) {
3434
if ((err = s_mp_rand_source(a->dp + digits - 1, sizeof(mp_digit))) != MP_OKAY) {
3535
return err;
3636
}

bn_s_mp_exptmod.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ mp_err s_mp_exptmod(const mp_int *G, const mp_int *X, const mp_int *P, mp_int *Y
146146
}
147147

148148
/* grab the next msb from the exponent */
149-
y = (buf >> (mp_digit)(MP_DIGIT_BIT - 1)) & 1;
149+
y = (buf >> (mp_digit)(MP_DIGIT_BIT - 1)) & 1uL;
150150
buf <<= (mp_digit)1;
151151

152152
/* if the bit is zero and mode == 0 then we ignore it

bn_s_mp_exptmod_fast.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ mp_err s_mp_exptmod_fast(const mp_int *G, const mp_int *X, const mp_int *P, mp_i
200200
}
201201

202202
/* grab the next msb from the exponent */
203-
y = (mp_digit)(buf >> (MP_DIGIT_BIT - 1)) & 1;
203+
y = (mp_digit)(buf >> (MP_DIGIT_BIT - 1)) & 1uL;
204204
buf <<= (mp_digit)1;
205205

206206
/* if the bit is zero and mode == 0 then we ignore it

0 commit comments

Comments
 (0)