xilasu
Vitis Drivers API Documentation
SHA3 Client APIs

Functions

s32 XAsu_Sha3Operation (XAsu_ClientParams *ClientParamPtr, XAsu_ShaOperationCmd *ShaClientParamPtr)
 This function sends a command to ASUFW to generate the digest for the provided input message using the specified SHA algorithm. More...
 
s32 XAsu_Sha3Kat (XAsu_ClientParams *ClientParamPtr)
 This function sends a command to ASUFW to run the SHA3 Known Answer Tests (KAT's). More...
 

Function Documentation

s32 XAsu_Sha3Kat ( XAsu_ClientParams ClientParamPtr)

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

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 the callback.

Create command header.

Update request buffer and send an IPI request to ASU.

References XAsu_CreateHeader(), XASU_INVALID_UNIQUE_ID, XASU_MODULE_SHA3_ID, XAsu_RegCallBackNGetUniqueId(), XASU_SHA_KAT_CMD_ID, XASU_UNIQUE_ID_MAX, XAsu_UpdateQueueBufferNSendIpi(), and XAsu_ValidateClientParameters().

s32 XAsu_Sha3Operation ( XAsu_ClientParams ClientParamPtr,
XAsu_ShaOperationCmd ShaClientParamPtr 
)

This function sends a command to ASUFW to generate the digest for the provided input message using the specified SHA algorithm.

Parameters
ClientParamPtrPointer to the XAsu_ClientParams structure which holds client input arguments.
ShaClientParamPtrPointer to the XAsu_ShaOperationCmd structure which holds parameters of sha input arguments.
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.

The maximum length of input data should be less than 0x1FFFFFFC bytes, which is the ASU DMA's maximum supported data transfer length.

If operation flag is set to START,

  • Generate Unique ID.
  • Save the Context.

If operation flag is either UPDATE or FINISH,

  • Verify the context.

If FINISH operation flag is set, update response buffer details.

Create command header.

Update request buffer and send an IPI request to ASU.

References XAsu_ClientParams::ClientCtx, XAsu_ShaOperationCmd::DataAddr, XAsu_ShaOperationCmd::DataSize, XAsu_ShaOperationCmd::HashAddr, XAsu_ShaOperationCmd::HashBufSize, XAsu_ShaOperationCmd::IsLast, XAsu_ShaOperationCmd::OperationFlags, XAsu_ShaOperationCmd::ShaMode, XAsu_CreateHeader(), XASU_FAIL_SAVE_CTX, XAsu_FreeCtx(), XASU_INVALID_ARGUMENT, XASU_INVALID_UNIQUE_ID, XASU_MODULE_SHA3_ID, XAsu_RegCallBackNGetUniqueId(), XASU_SHA_256_HASH_LEN, XASU_SHA_384_HASH_LEN, XASU_SHA_512_HASH_LEN, XASU_SHA_FINISH, XASU_SHA_MODE_SHA256, XASU_SHA_MODE_SHA384, XASU_SHA_MODE_SHA512, XASU_SHA_MODE_SHAKE256, XASU_SHA_OPERATION_CMD_ID, XASU_SHA_START, XASU_SHA_UPDATE, XASU_SHAKE_256_HASH_LEN, XASU_UNIQUE_ID_MAX, XAsu_UpdateCallBackDetails(), XAsu_UpdateNGetCtx(), XAsu_UpdateQueueBufferNSendIpi(), XAsu_ValidateClientParameters(), and XAsu_VerifyNGetUniqueIdCtx().