Random Number Generator API¶
This chapter provides information on the available random number generator(RNG) API. Currently only one RNG API is supported.
TISCI Message ID | Message Name |
---|---|
0x9020 | TISCI_MSG_GET_RANDOM |
Introduction¶
K3 device Random Number Generator(RNG) module includes a Non-Deterministic Random Bit Generator (NRBG) coupled to a Deterministic Random bit Generator (DRBG). The RNG is SP 800-90A and FIPS 140-2 compliant.
System Firmware initializes the RNG module during boot and provides a TISCI interface to retrieve random numbers. Random numbers are available in blocks of 4 x 32 bit words.
API Description¶
TISCI_MSG_GET_RANDOM - Get Random Number¶
TISCI Message ID¶
TISCI_MSG_GET_RANDOM (0x9020U)
Message to get random numbers
struct tisci_rng_get_random_req
Request for random numbers
Parameter | Type | Description |
---|---|---|
hdr | struct tisci_header | Generic TISCI message header. |
rng_req_len | u32 | number of 32 bit words to be output. must be 4 or 8 |
struct tisci_rng_get_random_resp
Response to the get random number message
Parameter | Type | Description |
---|---|---|
hdr | struct tisci_header | Generic TISCI message header. |
rng_read_len | u32 | number of 32 bit words read from rng. |
rng_out | u32 | output array containing rng values. |
Note
The user must always request 4 words or 8 words of random data. Other request lengths are not allowed.
The RNG internally has a 16 word random data buffer that is automatically refilled. If data is requested too quickly, this buffer might empty and the API might return with 0 length data. In such case, the user must wait before invoking the API once again.