xilasu
Vitis Drivers API Documentation
HMAC Client APIs

Functions

s32 XAsu_HmacCompute (XAsu_ClientParams *ClientParamsPtr, XAsu_HmacParams *HmacParamsPtr)
 This function sends command to ASUFW to computes the Message Authentication Code (MAC) for the given message using the specified hash function and the provided key. More...
 
s32 XAsu_HmacKat (XAsu_ClientParams *ClientParamsPtr)
 This function sends command to ASUFW to perform HMAC Known Answer Tests (KAT's). More...
 

Function Documentation

s32 XAsu_HmacCompute ( XAsu_ClientParams ClientParamsPtr,
XAsu_HmacParams HmacParamsPtr 
)

This function sends command to ASUFW to computes the Message Authentication Code (MAC) for the given message using the specified hash function and the provided key.

Parameters
ClientParamsPtrPointer to the XAsu_ClientParams structure which holds the client input parameters.
HmacParamsPtrPointer to XAsu_HmacParams structure which holds the parameters of HMAC input arguments.
Returns
  • XST_SUCCESS, if IPI request to ASU is sent successfully.
  • XASU_INVALID_ARGUMENT, if any argument is invalid.
  • XASU_INVALID_UNIQUE_ID, if received Queue ID is invalid.
  • XST_FAILURE, if sending IPI request to ASU fails.

Validate input parameters.

If operation flag is set to START,

  • Generate a 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.

Get the command ID based on SHA type.

Create command header.

Update request buffer and send an IPI request to ASU.

References XAsu_ClientParams::ClientCtx, XAsu_HmacParams::HmacAddr, XAsu_HmacParams::HmacLen, XAsu_HmacParams::OperationFlags, XAsu_HmacParams::ShaType, XAsu_CreateHeader(), XASU_FAIL_SAVE_CTX, XAsu_FreeCtx(), XASU_HMAC_COMPUTE_SHA2_CMD_ID, XASU_HMAC_COMPUTE_SHA3_CMD_ID, XASU_HMAC_INIT, XASU_INVALID_UNIQUE_ID, XASU_MODULE_HMAC_ID, XAsu_RegCallBackNGetUniqueId(), XASU_SHA2_TYPE, XASU_SHA_FINISH, XASU_UNIQUE_ID_MAX, XAsu_UpdateCallBackDetails(), XAsu_UpdateNGetCtx(), XAsu_UpdateQueueBufferNSendIpi(), XAsu_ValidateClientParameters(), and XAsu_VerifyNGetUniqueIdCtx().

s32 XAsu_HmacKat ( XAsu_ClientParams ClientParamsPtr)

This function sends command to ASUFW to perform HMAC Known Answer Tests (KAT's).

Parameters
ClientParamsPtrPointer to the XAsu_ClientParams structure which holds the client input parameters.
Returns
  • XST_SUCCESS, if IPI request to ASU is sent successfully.
  • XASU_INVALID_ARGUMENT, if any argument is invalid.
  • XASU_INVALID_UNIQUE_ID, if received Queue ID is invalid.
  • XST_FAILURE, if sending IPI request to ASU fails.

Validate input parameters.

Generate a unique ID and register the callback function.

Create command header.

Update request buffer and send an IPI request to ASU.

References XAsu_CreateHeader(), XASU_HMAC_KAT_CMD_ID, XASU_INVALID_UNIQUE_ID, XASU_MODULE_HMAC_ID, XAsu_RegCallBackNGetUniqueId(), XASU_UNIQUE_ID_MAX, XAsu_UpdateQueueBufferNSendIpi(), and XAsu_ValidateClientParameters().