From fcf228e2e7a2a57c9ae5eabbfde5a88ca62e0c71 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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libsodium/crypto_generichash/blake2/ref/generichash_blake2b.c b/src/libsodium/crypto_generichash/blake2/ref/generichash_blake2b.c index da4a170c..6a637eca 100644 --- a/src/libsodium/crypto_generichash/blake2/ref/generichash_blake2b.c +++ b/src/libsodium/crypto_generichash/blake2/ref/generichash_blake2b.c @@ -56,7 +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, keylen) != 0) { + } else if (blake2b_init_key(state, (uint8_t) outlen, key, + (uint8_t) keylen) != 0) { return -1; } return 0; @@ -81,7 +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, keylen, + (uint8_t) outlen, key, + (uint8_t) keylen, salt, personal) != 0) { return -1; }