HAL RNG Overview ¶
Introducing RNG ¶
- group RNG_Introduction
-
The RNG hardware abstraction layer provides a set of APIs to configure and control the RNG peripheral on STM32 microcontrollers.
The RNG is a true random number generator that provides full entropy outputs to the application as 32-bit samples. It is composed of a live entropy source (analog) and an internal conditioning component.
The RNG is a NIST SP 800-90B compliant entropy source that can be used to construct a non-deterministic random bit generator (NDRBG).
The RNG true random number generator has been pre-certified to NIST SP800-90B. It has also been tested using the German BSI statistical tests of AIS-31 (T0 to T8).
Module and files ¶
The following diagram illustrates the RNG module and its associated files.
Component diagram ¶
The following diagram illustrates the software components involved in the RNG module. It shows the interactions between the user application, HAL drivers, low-level drivers, and the hardware components.
Configuration table ¶
The following table lists the configuration defines for the HAL RNG module, specifying their locations, default values, and descriptions:
- group RNG_Configuration_Table
-
¶
Configuration inside the RNG driver ¶
Configuration defines
Description
Default value
Note
PRODUCT
from IDE
NA
Ex:STM32C5XXxx.
USE_ASSERT_DBG_PARAM
from IDE
None
Enable parameter asserts.
USE_ASSERT_DBG_STATE
from IDE
None
Enable state asserts.
USE_HAL_CHECK_PARAM
from hal_conf.h
0
Parameter runtime check.
USE_HAL_SECURE_CHECK_PARAM
from hal_conf.h
0
Parameter runtime check for sensitive APIs.
USE_HAL_RNG_MODULE
from hal_conf.h
1
Enable the HAL RNG module.
USE_HAL_RNG_CLK_ENABLE_MODEL
from hal_conf.h
HAL_CLK_ENABLE_NO
Enable the HAL_RNG_CLK.
USE_HAL_RNG_REGISTER_CALLBACKS
from hal_conf.h
0
Enable the register callback assert.
USE_HAL_RNG_GET_LAST_ERRORS
from hal_conf.h
0
Allow retrieval of the last error codes.
USE_HAL_RNG_USER_DATA
from hal_conf.h
0
Allow enabling or disabling user data.
RNG_CERT_NIST
from stm32c5xxxx.h
NA
Product-dependent values from DFP.