diff --git a/ctaocrypt/src/blake2b.c b/ctaocrypt/src/blake2b.c index 7258efdeb..e43e8bdfa 100644 --- a/ctaocrypt/src/blake2b.c +++ b/ctaocrypt/src/blake2b.c @@ -324,7 +324,7 @@ int blake2b_update( blake2b_state *S, const byte *in, word64 inlen ) if( inlen > fill ) { - XMEMCPY( S->buf + left, in, fill ); /* Fill buffer */ + XMEMCPY( S->buf + left, in, (word)fill ); /* Fill buffer */ S->buflen += fill; blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES ); blake2b_compress( S, S->buf ); /* Compress */ @@ -336,7 +336,7 @@ int blake2b_update( blake2b_state *S, const byte *in, word64 inlen ) } else /* inlen <= fill */ { - XMEMCPY( S->buf + left, in, inlen ); + XMEMCPY( S->buf + left, in, (word)inlen ); S->buflen += inlen; /* Be lazy, do not compress */ in += inlen; inlen -= inlen; @@ -357,12 +357,12 @@ int blake2b_final( blake2b_state *S, byte *out, byte outlen ) blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES ); blake2b_compress( S, S->buf ); S->buflen -= BLAKE2B_BLOCKBYTES; - XMEMCPY( S->buf, S->buf + BLAKE2B_BLOCKBYTES, S->buflen ); + XMEMCPY( S->buf, S->buf + BLAKE2B_BLOCKBYTES, (word)S->buflen ); } blake2b_increment_counter( S, S->buflen ); blake2b_set_lastblock( S ); - XMEMSET( S->buf + S->buflen, 0, 2 * BLAKE2B_BLOCKBYTES - S->buflen ); + XMEMSET( S->buf + S->buflen, 0, (word)(2 * BLAKE2B_BLOCKBYTES - S->buflen) ); /* Padding */ blake2b_compress( S, S->buf );