literal with suffix

This commit is contained in:
Francois Perrad 2018-09-23 09:46:31 +02:00
parent 82cd2c7f37
commit 519a1de8da
5 changed files with 6 additions and 6 deletions

View File

@ -17,7 +17,7 @@
int mp_complement(const mp_int *a, mp_int *b)
{
int res = mp_neg(a, b);
return res == MP_OKAY ? mp_sub_d(b, 1, b) : res;
return res == MP_OKAY ? mp_sub_d(b, 1uL, b) : res;
}
#endif

View File

@ -22,7 +22,7 @@ int mp_tc_and(const mp_int *a, const mp_int *b, mp_int *c)
if (as || bs) {
bits = MAX(mp_count_bits(a), mp_count_bits(b));
res = mp_init_set_int(&_mx, 1);
res = mp_init_set_int(&_mx, 1uL);
if (res != MP_OKAY) {
goto end;
}

View File

@ -21,13 +21,13 @@ int mp_tc_div_2d(const mp_int *a, int b, mp_int *c)
return mp_div_2d(a, b, c, NULL);
}
res = mp_add_d(a, 1, c);
res = mp_add_d(a, 1uL, c);
if (res != MP_OKAY) {
return res;
}
res = mp_div_2d(c, b, c, NULL);
return res == MP_OKAY ? mp_sub_d(c, 1, c) : res;
return res == MP_OKAY ? mp_sub_d(c, 1uL, c) : res;
}
#endif

View File

@ -22,7 +22,7 @@ int mp_tc_or(const mp_int *a, const mp_int *b, mp_int *c)
if (as || bs) {
bits = MAX(mp_count_bits(a), mp_count_bits(b));
res = mp_init_set_int(&_mx, 1);
res = mp_init_set_int(&_mx, 1uL);
if (res != MP_OKAY) {
goto end;
}

View File

@ -22,7 +22,7 @@ int mp_tc_xor(const mp_int *a, const mp_int *b, mp_int *c)
if (as || bs) {
bits = MAX(mp_count_bits(a), mp_count_bits(b));
res = mp_init_set_int(&_mx, 1);
res = mp_init_set_int(&_mx, 1uL);
if (res != MP_OKAY) {
goto end;
}