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

◆ nrf_cc3xx_platform_hmac_drbg_get_with_add()

int nrf_cc3xx_platform_hmac_drbg_get_with_add ( nrf_cc3xx_platform_hmac_drbg_context_t *const context,
uint8_t * buffer,
size_t len,
size_t * olen,
const uint8_t * additional,
size_t add_len )

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

Function to get PRNG using hmac_drbg and an additional string of data.

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

This function will calculate PRNG using HW accelerated HMAC(with SHA256) with a 16-byte key and reseed with TRNG using ARM CryptoCell cc3xx HW according to a reseed interval.

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]olenLength reported output in bytes.
[in]additionalAdditional input to use with HMAC_DRBG_Generate_algorithm.
[in]add_lenLength of HMAC_DRBG additional input in bytes.
Returns
NRF_CC3XX_PLATFORM_SUCCESS on success, otherwise a non-zero failure according to the API mbedtls_hmac_drbg_get_with_add.