Move size checks outside of mbedtls_platform_random_in_range
Update the documentation to mention that calling it with zero
as an argument will result in an undefined behavior.
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
diff --git a/include/mbedtls/platform_util.h b/include/mbedtls/platform_util.h
index e0bd08c..4999500 100644
--- a/include/mbedtls/platform_util.h
+++ b/include/mbedtls/platform_util.h
@@ -276,9 +276,9 @@
* cryptographically secure RNG, but provide an RNG for utility
* functions.
*
- * \note If the given range is [0, 0), 0 is returned.
- *
* \param num Max-value for the generated random number, exclusive.
+ * Must be greater than zero, otherwise an undefined behavior
+ * will occur on "num % 0".
* The generated number will be on range [0, num).
*
* \return The generated random number.