xilasu
Vitis Drivers API Documentation
AES Client APIs

Functions

s32 XAsu_AesOperation (XAsu_ClientParams *ClientParamPtr, Asu_AesParams *AesClientParamPtr)
 This function sends command to ASUFW to perform AES encryption/decryption operation on a given payload data with specified AES mode. More...
 
s32 XAsu_AesKat (XAsu_ClientParams *ClientParamsPtr)
 This function sends command to perform AES Known Answer Tests (KAT's). More...
 

Function Documentation

s32 XAsu_AesKat ( XAsu_ClientParams ClientParamsPtr)

This function sends command to perform AES 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_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 function.

Create command header.

Update request buffer and send an IPI request to ASU.

References XASU_AES_KAT_CMD_ID, XAsu_CreateHeader(), XASU_INVALID_UNIQUE_ID, XASU_MODULE_AES_ID, XAsu_RegCallBackNGetUniqueId(), XASU_UNIQUE_ID_MAX, XAsu_UpdateQueueBufferNSendIpi(), and XAsu_ValidateClientParameters().

s32 XAsu_AesOperation ( XAsu_ClientParams ClientParamPtr,
Asu_AesParams AesClientParamPtr 
)

This function sends command to ASUFW to perform AES encryption/decryption operation on a given payload data with specified AES mode.

Parameters
ClientParamsPtrPointer to the XAsu_ClientParams structure which holds the client input parameters.
AesParamsPtrPointer to Asu_AesParams structure which holds the parameters of AES 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.
Note
Verify the additional status if operation flag is set to XASU_AES_FINAL.
  • XASU_AES_TAG_READ, if encryption operation successfully done.
  • XASU_AES_TAG_MATCHED, if decryption operation successfully done.
  • Any other value shall be treated as failure.

Validate the input parameters.

Validate client additional status pointer for critical security calls.

Validate the operation flags for AES CCM mode to ensure all the flags are set.

Validate required parameters for AES initialization operation.

Validate AES operation type.

Validate AES engine mode.

Validate AES key object structure parameters.

Validate IV.

Validate required parameters for AES update operation.

Both AAD and InputData/OutputData address and lengths cannot be zero at once. The minimum length of plaintext/AAD length must be at least 1 byte, while the maximum length can be 0x1FFFFFFC bytes, which is the ASU DMA's maximum supported data transfer length.

If AAD length is non-zero, AAD address must be valid and AAD length within limit.

If AAD Length is zero, AAD address must also be zero.

If Data length is non-zero, both input and output addresses must be valid and data length within limit. AES-CMAC engine mode must not allow data updates.

If Data Length is zero, addresses must also be zero.

For the ECB, CBC, and CFB modes, the plaintext must be a sequence of one or more complete data blocks.

Validate IsLast flag.

Validate tag for AES final operation.

If operation flag is set to INIT,

  • Generate Unique ID.
  • Save the context.

If operation flag is either UPDATE or FINAL,

  • 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 Asu_AesParams::AadAddr, Asu_AesParams::AadLen, XAsu_ClientParams::AdditionalStatusPtr, XAsu_ClientParams::ClientCtx, Asu_AesParams::DataLen, Asu_AesParams::EngineMode, Asu_AesParams::InputDataAddr, Asu_AesParams::IsLast, Asu_AesParams::IvAddr, Asu_AesParams::IvLen, Asu_AesParams::KeyObjectAddr, Asu_AesParams::OperationFlags, Asu_AesParams::OperationType, Asu_AesParams::OutputDataAddr, Asu_AesParams::TagAddr, Asu_AesParams::TagLen, XASU_AES_BLOCK_SIZE_IN_BYTES, XASU_AES_CBC_MODE, XASU_AES_CCM_MODE, XASU_AES_CFB_MODE, XASU_AES_CMAC_MODE, XASU_AES_DECRYPT_OPERATION, XASU_AES_ECB_MODE, XASU_AES_ENCRYPT_OPERATION, XASU_AES_FINAL, XASU_AES_GCM_MODE, XASU_AES_GHASH_MODE, XASU_AES_INIT, XASU_AES_IS_AAD_SUPPORTED_MODE, XASU_AES_OPERATION_CMD_ID, XASU_AES_UPDATE, XAsu_AesValidateIvParams(), XAsu_AesValidateTagParams(), XAsu_CreateHeader(), XASU_FAIL_SAVE_CTX, XAsu_FreeCtx(), XASU_INVALID_ARGUMENT, XASU_INVALID_UNIQUE_ID, XASU_MODULE_AES_ID, XAsu_RegCallBackNGetUniqueId(), XASU_UNIQUE_ID_MAX, XAsu_UpdateCallBackDetails(), XAsu_UpdateNGetCtx(), XAsu_UpdateQueueBufferNSendIpi(), XAsu_ValidateClientParameters(), and XAsu_VerifyNGetUniqueIdCtx().