From 39a9d40f842a8a9c9314d33901c23aa78c64e03b Mon Sep 17 00:00:00 2001 From: Jarno Lamsa Date: Thu, 3 Oct 2019 13:36:06 +0300 Subject: [PATCH] Update documentation for the RNG-function --- include/mbedtls/platform_util.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/mbedtls/platform_util.h b/include/mbedtls/platform_util.h index 67a7877eb..35e39768c 100644 --- a/include/mbedtls/platform_util.h +++ b/include/mbedtls/platform_util.h @@ -219,7 +219,7 @@ void *mbedtls_platform_memcpy( void *dst, const void *src, size_t num ); int mbedtls_platform_memcmp( const void *buf1, const void *buf2, size_t num ); /** - * \brief A global RNG-function + * \brief RNG-function for getting a random in given range. * * This function is meant to provide a global RNG to be used * throughout Mbed TLS for hardening the library. It is used @@ -228,6 +228,12 @@ int mbedtls_platform_memcmp( const void *buf1, const void *buf2, size_t num ); * cryptographically secure RNG, but provide an RNG for utility * functions. * + * \note Currently the function is dependent of hardware providing an + * rng with MBEDTLS_ENTROPY_HARDWARE_ALT. By default, 0 is + * returned. + * + * \note If the given range is [0, 0), 0 is returned. + * * \param num Max-value for the generated random number, exclusive. * The generated number will be on range [0, num). *