This section describes the programming interface of the CAAM RNG driver.
|
typedef uint32_t | caam_rng_generic256_t [256/sizeof(uint32_t)] |
| 256-bit value used as optional additional entropy input
|
|
|
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, void *data, size_t dataSize, caam_rng_random_type_t dataType, caam_rng_generic256_t additionalEntropy) |
| Get random data. More...
|
|
uint32_t caam_rng_config_t::autoReseedInterval |
If set to zero, CAAM RNG will use hardware default interval of 10.000.000 generate requests.
Enumerator |
---|
kCAAM_RngStateHandle0 |
CAAM RNG state handle 0.
|
kCAAM_RngStateHandle1 |
CAAM RNG state handle 1.
|
Enumerator |
---|
kCAAM_RngDataAny |
CAAM RNG any random data bytes.
|
kCAAM_RngDataOddParity |
CAAM RNG odd parity random data bytes.
|
kCAAM_RngDataNonZero |
CAAM RNG non zero random data bytes.
|
This function initializes the configure structure to default value. the default value are:
* config->autoReseedInterval = 0;
* config->personalString = NULL;
*
- Parameters
-
config | User configuration structure. |
- Returns
- status of the request
This function instantiates CAAM RNG state handle. The function is blocking and returns after CAAM has processed the request.
- Parameters
-
base | CAAM peripheral base address |
handle | CAAM jobRing used for this request |
stateHandle | RNG state handle to instantiate |
config | Pointer to configuration structure. |
- Returns
- Status of the request
This function uninstantiates CAAM RNG state handle. The function is blocking and returns after CAAM has processed the request.
- Parameters
-
base | CAAM peripheral base address |
handle | jobRing used for this request. |
stateHandle | RNG state handle to uninstantiate |
- Returns
- Status of the request
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.
- Parameters
-
base | CAAM peripheral base address |
handle | jobRing used for this request |
additionalEntropy | NULL or Pointer to optional 256-bit additional entropy. |
- Returns
- Status of the request
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.
- Parameters
-
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. |
- Returns
- Status of the request
This function gets random data from CAAM RNG.
The function is blocking and returns after CAAM has generated the requested data or an error occured.
- Parameters
-
| 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. |
- Returns
- Status of the request