![]() |
MCUXpresso SDK API Reference Manual
Rev 2.16.100
NXP Semiconductors
|
This section describes the programming interface of the CAAM RNG driver.
Data Structures | |
| struct | _caam_rng_user_config |
| CAAM RNG configuration. More... | |
Typedefs | |
| typedef enum _caam_rng_state_handle | caam_rng_state_handle_t |
| CAAM RNG state handle. | |
| typedef enum _caam_rng_random_type | caam_rng_random_type_t |
| Type of random data to generate. | |
| typedef uint32_t | caam_rng_generic256_t [256/sizeof(uint32_t)] |
| 256-bit value used as optional additional entropy input | |
|
typedef struct _caam_rng_user_config | caam_rng_config_t |
| CAAM RNG configuration. | |
Enumerations | |
| enum | _caam_rng_state_handle { kCAAM_RngStateHandle0 = 0u, kCAAM_RngStateHandle1 = 1u } |
| CAAM RNG state handle. More... | |
| enum | _caam_rng_random_type { kCAAM_RngDataAny = 0u, kCAAM_RngDataOddParity = 1u, kCAAM_RngDataNonZero = 2u } |
| Type of random data to generate. More... | |
Functions | |
| status_t | CAAM_RNG_GetDefaultConfig (caam_rng_config_t *config) |
| Initializes user configuration structure to default. More... | |
| status_t | CAAM_RNG_Init (CAAM_Type *base, caam_handle_t *handle, caam_rng_state_handle_t stateHandle, const caam_rng_config_t *config) |
| Instantiate the CAAM RNG state handle. More... | |
| status_t | CAAM_RNG_Deinit (CAAM_Type *base, caam_handle_t *handle, caam_rng_state_handle_t stateHandle) |
| Uninstantiate the CAAM RNG state handle. More... | |
| status_t | CAAM_RNG_GenerateSecureKey (CAAM_Type *base, caam_handle_t *handle, caam_rng_generic256_t additionalEntropy) |
| Generate Secure Key. More... | |
| status_t | CAAM_RNG_Reseed (CAAM_Type *base, caam_handle_t *handle, caam_rng_state_handle_t stateHandle, caam_rng_generic256_t additionalEntropy) |
| Reseed the CAAM RNG state handle. More... | |
| status_t | CAAM_RNG_GetRandomData (CAAM_Type *base, caam_handle_t *handle, caam_rng_state_handle_t stateHandle, uint8_t *data, size_t dataSize, caam_rng_random_type_t dataType, caam_rng_generic256_t additionalEntropy) |
| Get random data. More... | |
| struct _caam_rng_user_config |
Data Fields | |
| uint32_t | autoReseedInterval |
| Automatic reseed internal. More... | |
| caam_rng_generic256_t * | personalString |
| NULL or pointer to optional personalization string. | |
| uint32_t _caam_rng_user_config::autoReseedInterval |
If set to zero, CAAM RNG will use hardware default interval of 10.000.000 generate requests.
| status_t CAAM_RNG_GetDefaultConfig | ( | caam_rng_config_t * | config | ) |
This function initializes the configure structure to default value. the default value are:
| config | User configuration structure. |
| status_t CAAM_RNG_Init | ( | CAAM_Type * | base, |
| caam_handle_t * | handle, | ||
| caam_rng_state_handle_t | stateHandle, | ||
| const caam_rng_config_t * | config | ||
| ) |
This function instantiates CAAM RNG state handle. The function is blocking and returns after CAAM has processed the request.
| base | CAAM peripheral base address |
| handle | CAAM jobRing used for this request |
| stateHandle | RNG state handle to instantiate |
| config | Pointer to configuration structure. |
| status_t CAAM_RNG_Deinit | ( | CAAM_Type * | base, |
| caam_handle_t * | handle, | ||
| caam_rng_state_handle_t | stateHandle | ||
| ) |
This function uninstantiates CAAM RNG state handle. The function is blocking and returns after CAAM has processed the request.
| base | CAAM peripheral base address |
| handle | jobRing used for this request. |
| stateHandle | RNG state handle to uninstantiate |
| status_t CAAM_RNG_GenerateSecureKey | ( | CAAM_Type * | base, |
| caam_handle_t * | handle, | ||
| caam_rng_generic256_t | additionalEntropy | ||
| ) |
This function generates random data writes it to Secure Key registers. The function is blocking and returns after CAAM has processed the request. RNG state handle 0 is always used.
| base | CAAM peripheral base address |
| handle | jobRing used for this request |
| additionalEntropy | NULL or Pointer to optional 256-bit additional entropy. |
| status_t CAAM_RNG_Reseed | ( | CAAM_Type * | base, |
| caam_handle_t * | handle, | ||
| caam_rng_state_handle_t | stateHandle, | ||
| caam_rng_generic256_t | additionalEntropy | ||
| ) |
This function reseeds the CAAM RNG state handle. For a state handle in nondeterministic mode, the DRNG is seeded with 384 bits of entropy from the TRNG and an optional 256-bit additional input from the descriptor via the Class 1 Context Register.
The function is blocking and returns after CAAM has processed the request.
| base | CAAM peripheral base address |
| handle | jobRing used for this request |
| stateHandle | RNG state handle to reseed |
| additionalEntropy | NULL or Pointer to optional 256-bit additional entropy. |
| status_t CAAM_RNG_GetRandomData | ( | CAAM_Type * | base, |
| caam_handle_t * | handle, | ||
| caam_rng_state_handle_t | stateHandle, | ||
| uint8_t * | data, | ||
| size_t | dataSize, | ||
| caam_rng_random_type_t | dataType, | ||
| caam_rng_generic256_t | additionalEntropy | ||
| ) |
This function gets random data from CAAM RNG.
The function is blocking and returns after CAAM has generated the requested data or an error occurred.
| base | CAAM peripheral base address | |
| handle | jobRing used for this request | |
| stateHandle | RNG state handle used to generate random data | |
| [out] | data | Pointer address used to store random data |
| dataSize | Size of the buffer pointed by the data parameter | |
| dataType | Type of random data to be generated | |
| additionalEntropy | NULL or Pointer to optional 256-bit additional entropy. |