From b2b063ff3538f1a8f8a027009712e67b5a5fc4a9 Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Thu, 20 Jul 2017 16:45:24 +0100 Subject: [PATCH] Add comment in entropy.c --- library/entropy.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/entropy.c b/library/entropy.c index 67ec9010c..baca87cf7 100644 --- a/library/entropy.c +++ b/library/entropy.c @@ -366,6 +366,11 @@ int mbedtls_entropy_func( void *data, unsigned char *output, size_t len ) memset( buf, 0, MBEDTLS_ENTROPY_BLOCK_SIZE ); #if defined(MBEDTLS_ENTROPY_SHA512_ACCUMULATOR) + /* + * Note that at this stage it is assumed that the accumulator was started + * in a previous call to entropy_update(). If this is not guaranteed, the + * code below will fail. + */ if( ( ret = mbedtls_sha512_finish_ext( &ctx->accumulator, buf ) ) != 0 ) goto exit;