xilasu
Vitis Drivers API Documentation
TRNG Client APIs

Macros

#define XASU_TRNG_RANDOM_NUM_IN_BYTES   32U
 Security strength in Bytes. More...
 

Functions

s32 XAsu_TrngGetRandomNum (XAsu_ClientParams *ClientParamPtr, const u8 *BufPtr, u32 Length)
 This function sends a command to ASUFW to generate the random number using TRNG. More...
 
s32 XAsu_TrngKat (XAsu_ClientParams *ClientParamPtr)
 This function sends a command to ASUFW to run the TRNG Known Answer Tests (KAT's). More...
 

Macro Definition Documentation

#define XASU_TRNG_RANDOM_NUM_IN_BYTES   32U

Security strength in Bytes.

Referenced by XAsu_TrngGetRandomNum().

Function Documentation

s32 XAsu_TrngGetRandomNum ( XAsu_ClientParams ClientParamPtr,
const u8 *  BufPtr,
u32  Length 
)

This function sends a command to ASUFW to generate the random number using TRNG.

Parameters
ClientParamPtrPointer to the XAsu_ClientParams structure which holds client input arguments.
BufPtrPointer to the buffer to store the random number.
LengthLength of the buffer in bytes.
Returns
  • XST_SUCCESS, if IPI request to ASU is sent successfully.
  • XASU_INVALID_ARGUMENT, if any argument is invalid.
  • XST_FAILURE, if sending IPI request to ASU fails.

Validate input parameters.

Generate unique ID and register the callback.

Create command header.

Update request buffer and send an IPI request to ASU.

References XAsu_CreateHeader(), XASU_INVALID_ARGUMENT, XASU_INVALID_UNIQUE_ID, XASU_MODULE_TRNG_ID, XAsu_RegCallBackNGetUniqueId(), XASU_TRNG_GET_RANDOM_BYTES_CMD_ID, XASU_TRNG_RANDOM_NUM_IN_BYTES, XASU_UNIQUE_ID_MAX, XAsu_UpdateQueueBufferNSendIpi(), and XAsu_ValidateClientParameters().

s32 XAsu_TrngKat ( XAsu_ClientParams ClientParamPtr)

This function sends a command to ASUFW to run the TRNG Known Answer Tests (KAT's).

Parameters
ClientParamPtrPointer to the XAsu_ClientParams structure which holds client input arguments.
Returns
  • XST_SUCCESS, if IPI request to ASU is sent successfully.
  • XASU_INVALID_ARGUMENT, if any argument is invalid.
  • XASU_QUEUE_FULL, if Queue buffer is full.
  • XST_FAILURE, if sending IPI request to ASU fails.

Validate input parameters.

Generate unique ID and register callback.

Create command header.

Update request buffer and send an IPI request to ASU.

References XAsu_CreateHeader(), XASU_INVALID_UNIQUE_ID, XASU_MODULE_TRNG_ID, XAsu_RegCallBackNGetUniqueId(), XASU_TRNG_KAT_CMD_ID, XASU_UNIQUE_ID_MAX, XAsu_UpdateQueueBufferNSendIpi(), and XAsu_ValidateClientParameters().