|
enum | { kDifEntropySeedMaterialMaxWordLen = 12
} |
|
enum | { kDifEntropySeedMaterialMaxGlen = 4095
} |
|
enum | { kDifMaxNumReqsBetweenReseeds = 0xffffffff
} |
|
enum | {
kDifEdnCmdInstantiate = 1
,
kDifEdnCmdReseed = 2
,
kDifEdnCmdGenerate = 3
} |
|
enum | dif_edn_status {
kDifEdnStatusRegReady
,
kDifEdnStatusReady
,
kDifEdnStatusCsrngStatus
,
kDifEdnStatusCsrngAck
} |
| EDN Status flags. More...
|
|
enum | dif_edn_sm_state {
kDifEdnSmStateIdle = 193
,
kDifEdnSmStateBootLoadIns = 455
,
kDifEdnSmStateBootInsAckWait = 121
,
kDifEdnSmStateBootLoadGen = 3
,
kDifEdnSmStateBootGenAckWait = 119
,
kDifEdnSmStateBootPulse = 169
,
kDifEdnSmStateBootDone = 240
,
kDifEdnSmStateBootLoadUni = 309
,
kDifEdnSmStateBootUniAckWait = 44
,
kDifEdnSmStateAutoLoadIns = 444
,
kDifEdnSmStateAutoFirstAckWait = 419
,
kDifEdnSmStateAutoAckWait = 146
,
kDifEdnSmStateAutoDispatch = 353
,
kDifEdnSmStateAutoCaptGenCnt = 270
,
kDifEdnSmStateAutoSendGenCmd = 477
,
kDifEdnSmStateAutoCaptReseedCnt = 191
,
kDifEdnSmStateAutoSendReseedCmd = 106
,
kDifEdnSmStateSWPortMode = 149
,
kDifEdnSmStateRejectCsrngEntropy = 24
,
kDifEdnSmStateError = 382
} |
| EDN SM states as defined in the EDN state machine RTL. More...
|
|
enum | dif_edn_fifo {
kDifEdnFifoReseedCmd
,
kDifEdnFifoGenerateCmd
} |
| Enumeration of EDN FIFOs, which indicates which part of the hardware produced an error.
|
|
enum | dif_edn_error {
kDifEdnErrorAckSm
,
kDifEdnErrorMainSm
,
kDifEdnErrorCounterFault
,
kDifEdnErrorFifoWrite
,
kDifEdnErrorFifoRead
,
kDifEdnErrorFifoFullAndEmpty
} |
| Enumeration of EDN FIFO errors. More...
|
|
enum | dif_edn_entropy_src_toggle {
kDifEdnEntropySrcToggleDisable = 1
,
kDifEdnEntropySrcToggleEnable = 0
} |
| CSRNG consume seed from entropy source enable. More...
|
|
enum | dif_edn_recoverable_alert {
kDifEdnRecoverableAlertBadEnable
,
kDifEdnRecoverableAlertBadBootReqMode
,
kDifEdnRecoverableAlertBadAutoReqMode
,
kDifEdnRecoverableAlertBadFifoClear
,
kDifEdnRecoverableAlertRepeatedGenBits
} |
| Recoverable alerts emitted by the EDN. More...
|
|
|
OT_WARN_UNUSED_RESULT dif_result_t | dif_edn_configure (const dif_edn_t *edn) |
| Configures EDN with runtime information. More...
|
|
OT_WARN_UNUSED_RESULT dif_result_t | dif_edn_lock (const dif_edn_t *edn) |
| Locks out EDN functionality. More...
|
|
OT_WARN_UNUSED_RESULT dif_result_t | dif_edn_is_locked (const dif_edn_t *edn, bool *is_locked) |
| Checks whether this EDN is locked. More...
|
|
OT_WARN_UNUSED_RESULT dif_result_t | dif_edn_set_boot_mode (const dif_edn_t *edn) |
| Enables the EDN in boot-time mode. More...
|
|
OT_WARN_UNUSED_RESULT dif_result_t | dif_edn_set_auto_mode (const dif_edn_t *edn, dif_edn_auto_params_t config) |
| Enables the EDN in auto refresh mode. More...
|
|
OT_WARN_UNUSED_RESULT dif_result_t | dif_edn_get_status (const dif_edn_t *edn, dif_edn_status_t flag, bool *set) |
| Queries the EDN status flags. More...
|
|
OT_WARN_UNUSED_RESULT dif_result_t | dif_edn_get_errors (const dif_edn_t *edn, uint32_t *unhealthy_fifos, uint32_t *errors) |
| Queries the EDN error flags. More...
|
|
OT_WARN_UNUSED_RESULT dif_result_t | dif_edn_get_cmd_unhealthy_fifo_force (const dif_edn_t *edn, dif_edn_fifo_t fifo) |
| Forces the status registers to indicate fifo as being in an unhealthy state. More...
|
|
OT_WARN_UNUSED_RESULT dif_result_t | dif_edn_get_cmd_error_force (const dif_edn_t *edn, dif_edn_error_t error) |
| Forces the status registers to indicate a particular error cause. More...
|
|
OT_WARN_UNUSED_RESULT dif_result_t | dif_edn_get_main_state_machine (const dif_edn_t *edn, uint32_t *state) |
| Returns an opaque blob indicating the main state machine's current state. More...
|
|
OT_WARN_UNUSED_RESULT dif_result_t | dif_edn_instantiate (const dif_edn_t *edn, dif_edn_entropy_src_toggle_t entropy_src_enable, const dif_edn_seed_material_t *seed_material) |
| Initializes CSRNG instance with a new seed value. More...
|
|
OT_WARN_UNUSED_RESULT dif_result_t | dif_edn_reseed (const dif_edn_t *edn, const dif_edn_seed_material_t *seed_material) |
| Reseeds CSRNG instance. More...
|
|
OT_WARN_UNUSED_RESULT dif_result_t | dif_edn_update (const dif_edn_t *edn, const dif_edn_seed_material_t *seed_material) |
| Updates CSRNG state. More...
|
|
OT_WARN_UNUSED_RESULT dif_result_t | dif_edn_generate_start (const dif_edn_t *edn, size_t len) |
| Requests cryptographic entropy bits from the CSRNG. More...
|
|
OT_WARN_UNUSED_RESULT dif_result_t | dif_edn_uninstantiate (const dif_edn_t *edn) |
| Uninstantiates CSRNG. More...
|
|
OT_WARN_UNUSED_RESULT dif_result_t | dif_edn_stop (const dif_edn_t *edn) |
| Stops the current mode of operation and disables the entropy module. More...
|
|
OT_WARN_UNUSED_RESULT dif_result_t | dif_edn_get_recoverable_alerts (const dif_edn_t *edn, uint32_t *alerts) |
| Gets the recoverable alerts currently recorded in the EDN block. More...
|
|
OT_WARN_UNUSED_RESULT dif_result_t | dif_edn_clear_recoverable_alerts (const dif_edn_t *edn) |
| Clears all recoverable alerts currently recorded in the EDN block. More...
|
|
Entropy Distribution Network Device Interface Functions
This API implements the interface for the Entropy Distribution Network (EDN) hardware.
There are two main modes of operation:
- boot-time: EDN configures the associated CSRNG instance to fetch pre-FIPS entropy immediately at boot-time or after reset.
- auto refresh: EDN sends reseed and generate commands to the associated CSRNG instance. The API allows the user to set the CSRNG instantiate, reseed and generate para meters, as well as the reseed frequency.
Definition in file dif_edn.h.
Requests cryptographic entropy bits from the CSRNG.
The prediction resistance flag as specified in SP 800-90Ar1 section 10.2.1.1 is not directly supported by the hardware. It is the responsibility of the caller to reseed as needed before calling this function.
The CSRNG accepts generation requests with 128-bit granularity, with a minimum 128-bit request size. This function will increase the size of the request to align it to the nearest 128-bit boundary.
- Parameters
-
edn | An EDN handle. |
len | Number of uint32_t words to generate. |
- Returns
- The result of the operation. KDifOutOfRange if the
len
parameter results in a 128bit block level size greater than 0x800.
Definition at line 327 of file dif_edn.c.