Skip to content

Commit 3e15a3f

Browse files
committed
literal suffix
1 parent b3a4341 commit 3e15a3f

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

bn_conversion.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
uint##w##_t name(const mp_int* a) \
3838
{ \
3939
unsigned i = MP_MIN((unsigned)a->used, (unsigned)((w + MP_DIGIT_BIT - 1) / MP_DIGIT_BIT)); \
40-
uint##w##_t res = 0; \
41-
while (i --> 0) { \
40+
uint##w##_t res = 0u; \
41+
while (i --> 0u) { \
4242
res <<= ((w <= MP_DIGIT_BIT) ? 0 : MP_DIGIT_BIT); \
4343
res |= (uint##w##_t)a->dp[i]; \
4444
if (w <= MP_DIGIT_BIT) { break; } \

bn_mp_ilogb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ mp_err mp_ilogb(const mp_int *a, mp_digit base, mp_int *c)
104104
return err;
105105
}
106106
if (cmp == MP_EQ) {
107-
mp_set(c, 1u);
107+
mp_set(c, 1uL);
108108
return err;
109109
}
110110

bn_mp_is_square.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ mp_err mp_is_square(const mp_int *arg, mp_bool *ret)
5858
}
5959

6060

61-
if ((err = mp_init_u32(&t, 11L*13L*17L*19L*23L*29L*31L)) != MP_OKAY) {
61+
if ((err = mp_init_u32(&t, 11u*13u*17u*19u*23u*29u*31u)) != MP_OKAY) {
6262
return err;
6363
}
6464
if ((err = mp_mod(arg, &t, &t)) != MP_OKAY) {

bn_mp_prime_strong_lucas_selfridge.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,9 @@ mp_err mp_prime_strong_lucas_selfridge(const mp_int *a, mp_bool *result)
172172
combined with the previous totals for U and V, using the
173173
composition formulas for addition of indices. */
174174

175-
mp_set(&Uz, 1u); /* U=U_1 */
175+
mp_set(&Uz, 1uL); /* U=U_1 */
176176
mp_set(&Vz, (mp_digit)P); /* V=V_1 */
177-
mp_set(&U2mz, 1u); /* U_1 */
177+
mp_set(&U2mz, 1uL); /* U_1 */
178178
mp_set(&V2mz, (mp_digit)P); /* V_1 */
179179

180180
if (Q < 0) {

bn_mp_sqrtmod_prime.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ mp_err mp_sqrtmod_prime(const mp_int *n, const mp_int *prime, mp_int *ret)
5959
}
6060

6161
/* find a Z such that the Legendre symbol (Z|prime) == -1 */
62-
mp_set_u32(&Z, 2uL);
62+
mp_set_u32(&Z, 2u);
6363
/* Z = 2 */
6464
while (1) {
6565
if ((err = mp_kronecker(&Z, prime, &legendre)) != MP_OKAY) goto cleanup;
@@ -79,7 +79,7 @@ mp_err mp_sqrtmod_prime(const mp_int *n, const mp_int *prime, mp_int *ret)
7979
/* T = n ^ Q mod prime */
8080
if ((err = mp_copy(&S, &M)) != MP_OKAY) goto cleanup;
8181
/* M = S */
82-
mp_set_u32(&two, 2uL);
82+
mp_set_u32(&two, 2u);
8383

8484
while (1) {
8585
if ((err = mp_copy(&T, &t1)) != MP_OKAY) goto cleanup;

0 commit comments

Comments
 (0)