nrfxlib API 3.3.99
Loading...
Searching...
No Matches

◆ nrf_cc3xx_platform_hmac_drbg_get()

int nrf_cc3xx_platform_hmac_drbg_get ( nrf_cc3xx_platform_hmac_drbg_context_t *const context,
uint8_t * buffer,
size_t len,
size_t * olen )

#include <crypto/nrf_cc310_platform/include/nrf_cc3xx_platform_hmac_drbg.h>

Function to get PRNG data using hmac_drbg.

Note
If the context is NULL the function uses an internal context.

This function calculates random numbers using PRNG seeded by TRNG as defined in NIST SP 800-90A: Recommendation for Random Number Generation Using Deterministic Random Bit Generators. The random numbers are generated using Arm CryptoCell cc3xx hardware acceleration.

Note
Before calling this API the context to must be initialized by calling nrf_cc3xx_platform_hmac_drbg_init.
This API is only usable if nrf_cc3xx_platform initialization APIs was run prior to calling it.
Parameters
[in,out]contextPointer to structure holding the hmac_drbg context.
[out]bufferPointer to buffer to hold PRNG data.
[in]lenLength of PRNG to get in bytes.
[out]olenActual number of bytes put into the buffer.
Returns
0 on success, otherwise a non-zero failure according to the API mbedtls_hmac_drbg_random.
NRF_CC3XX_PLATFORM_SUCCESS on success, otherwise a non-zero failure according to the API mbedtls_hmac_drbg_random_with_add.