From a1d438c8ba1d95126c8ef8a907dd707929e558f3 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 13 Dec 2017 00:03:01 +0100 Subject: [PATCH] Comments --- src/libsodium/crypto_generichash/blake2b/ref/blake2b-ref.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libsodium/crypto_generichash/blake2b/ref/blake2b-ref.c b/src/libsodium/crypto_generichash/blake2b/ref/blake2b-ref.c index de5c5f0441..91435a1b16 100644 --- a/src/libsodium/crypto_generichash/blake2b/ref/blake2b-ref.c +++ b/src/libsodium/crypto_generichash/blake2b/ref/blake2b-ref.c @@ -203,7 +203,7 @@ blake2b_init_key(blake2b_state *S, const uint8_t outlen, const void *key, { uint8_t block[BLAKE2B_BLOCKBYTES]; memset(block, 0, BLAKE2B_BLOCKBYTES); - memcpy(block, key, keylen); + memcpy(block, key, keylen); /* keylen cannot be 0 */ blake2b_update(S, block, BLAKE2B_BLOCKBYTES); sodium_memzero(block, BLAKE2B_BLOCKBYTES); /* Burn the key from stack */ } @@ -249,7 +249,7 @@ blake2b_init_key_salt_personal(blake2b_state *S, const uint8_t outlen, { uint8_t block[BLAKE2B_BLOCKBYTES]; memset(block, 0, BLAKE2B_BLOCKBYTES); - memcpy(block, key, keylen); + memcpy(block, key, keylen); /* keylen cannot be 0 */ blake2b_update(S, block, BLAKE2B_BLOCKBYTES); sodium_memzero(block, BLAKE2B_BLOCKBYTES); /* Burn the key from stack */ } @@ -320,7 +320,7 @@ blake2b_final(blake2b_state *S, uint8_t *out, uint8_t outlen) STORE64_LE(buffer + 8 * 5, S->h[5]); STORE64_LE(buffer + 8 * 6, S->h[6]); STORE64_LE(buffer + 8 * 7, S->h[7]); - memcpy(out, buffer, outlen); + memcpy(out, buffer, outlen); /* outlen <= BLAKE2B_OUTBYTES (64) */ sodium_memzero(S->h, sizeof S->h); sodium_memzero(S->buf, sizeof S->buf);