From aa2bd4d09b11c74b1aa4af1f4bb8eceb42560c91 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 9 Apr 2014 18:45:59 -0700 Subject: [PATCH] Add explicit uint8_t casts for Blake2's key length. via @evoskuil --- .../crypto_generichash/blake2/ref/generichash_blake2b.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libsodium/crypto_generichash/blake2/ref/generichash_blake2b.c b/src/libsodium/crypto_generichash/blake2/ref/generichash_blake2b.c index 70e07a59..6a637eca 100644 --- a/src/libsodium/crypto_generichash/blake2/ref/generichash_blake2b.c +++ b/src/libsodium/crypto_generichash/blake2/ref/generichash_blake2b.c @@ -56,8 +56,8 @@ crypto_generichash_blake2b_init(crypto_generichash_blake2b_state *state, if (blake2b_init(state, (uint8_t) outlen) != 0) { return -1; } - } else if (blake2b_init_key(state, (uint8_t) outlen, key, - (uint8_t) keylen /* Is cast from size_t to uint8_t safe here? */ ) != 0) { + } else if (blake2b_init_key(state, (uint8_t) outlen, key, + (uint8_t) keylen) != 0) { return -1; } return 0; @@ -82,8 +82,8 @@ crypto_generichash_blake2b_init_salt_personal(crypto_generichash_blake2b_state * return -1; } } else if (blake2b_init_key_salt_personal(state, - (uint8_t)outlen, key, - (uint8_t)keylen, /* Is cast from size_t to uint8_t safe here? */ + (uint8_t) outlen, key, + (uint8_t) keylen, salt, personal) != 0) { return -1; }