1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-20 10:37:24 -07:00

Add explicit casts

This commit is contained in:
Frank Denis 2017-03-21 23:25:40 +01:00
parent 4568b74cc8
commit e6970ad4e6
3 changed files with 15 additions and 15 deletions

View File

@ -225,10 +225,10 @@ poly1305_finish(poly1305_state_internal_t *st, unsigned char mac[16])
f = (unsigned long long) h3 + st->pad[3] + (f >> 32);
h3 = (unsigned long) f;
STORE32_LE(mac + 0, h0);
STORE32_LE(mac + 4, h1);
STORE32_LE(mac + 8, h2);
STORE32_LE(mac + 12, h3);
STORE32_LE(mac + 0, (uint32_t) h0);
STORE32_LE(mac + 4, (uint32_t) h1);
STORE32_LE(mac + 8, (uint32_t) h2);
STORE32_LE(mac + 12, (uint32_t) h3);
/* zero out the state */
sodium_memzero((void *) st, sizeof *st);

View File

@ -334,7 +334,7 @@ escrypt_kdf_nosse(escrypt_local_t *local, const uint8_t *passwd,
/* Allocate memory. */
B_size = (size_t) 128 * r * p;
V_size = (size_t) 128 * r * N;
V_size = (size_t) 128 * r * (size_t) N;
need = B_size + V_size;
if (need < V_size) {
errno = ENOMEM;

View File

@ -160,16 +160,16 @@ fe_mul121666(fe h, const fe f)
h9 += carry8;
h8 -= carry8 * ((int64_t)1 << 26);
h[0] = h0;
h[1] = h1;
h[2] = h2;
h[3] = h3;
h[4] = h4;
h[5] = h5;
h[6] = h6;
h[7] = h7;
h[8] = h8;
h[9] = h9;
h[0] = (int32_t) h0;
h[1] = (int32_t) h1;
h[2] = (int32_t) h2;
h[3] = (int32_t) h3;
h[4] = (int32_t) h4;
h[5] = (int32_t) h5;
h[6] = (int32_t) h6;
h[7] = (int32_t) h7;
h[8] = (int32_t) h8;
h[9] = (int32_t) h9;
}
static int