Functions | |
cy_en_crypto_status_t | Cy_Crypto_Aes_Init (CRYPTO_Type *base, uint8_t const *key, cy_en_crypto_aes_key_length_t keyLength, cy_stc_crypto_aes_context_t *aesContext) |
This function initializes the AES operation by setting the key and key length. More... | |
cy_en_crypto_status_t | Cy_Crypto_Aes_Free (CRYPTO_Type *base, cy_stc_crypto_aes_context_t *aesContext) |
This function clears the AES operation context. More... | |
cy_en_crypto_status_t | Cy_Crypto_Aes_Ecb (CRYPTO_Type *base, cy_en_crypto_dir_mode_t dirMode, uint8_t *dst, uint8_t const *src, cy_stc_crypto_aes_context_t *aesContext) |
This function performs an AES-ECB (Electronic Code Book) encryption/decryption operation on the input data. More... | |
cy_en_crypto_status_t | Cy_Crypto_Aes_Cbc (CRYPTO_Type *base, cy_en_crypto_dir_mode_t dirMode, uint32_t srcSize, uint8_t *ivPtr, uint8_t *dst, uint8_t const *src, cy_stc_crypto_aes_context_t *aesContext) |
This function performs an AES-CBC (Cipher Block Chaining) encryption/decryption operation on the input data. More... | |
cy_en_crypto_status_t | Cy_Crypto_Aes_Cfb (CRYPTO_Type *base, cy_en_crypto_dir_mode_t dirMode, uint32_t srcSize, uint8_t *ivOffset, uint8_t *ivPtr, uint8_t *dst, uint8_t const *src, cy_stc_crypto_aes_context_t *aesContext) |
This function performs the AES-CFB (Cipher FeedBack) encrypt/decrypt operation on the input data. More... | |
cy_en_crypto_status_t | Cy_Crypto_Aes_Ctr (CRYPTO_Type *base, uint32_t srcSize, uint32_t *ncOffset, uint8_t *nonceCounter, uint8_t *streamBlock, uint8_t *dst, uint8_t const *src, cy_stc_crypto_aes_context_t *aesContext) |
This function performs the AES-CTR (Counter mode) operation on the input data. More... | |
cy_en_crypto_status_t Cy_Crypto_Aes_Init | ( | CRYPTO_Type * | base, |
uint8_t const * | key, | ||
cy_en_crypto_aes_key_length_t | keyLength, | ||
cy_stc_crypto_aes_context_t * | aesContext | ||
) |
This function initializes the AES operation by setting the key and key length.
base | Base address of the Crypto block registers. |
key | Pointer to the encryption/decryption key. |
keyLength | AES key length cy_en_crypto_aes_key_length_t |
aesContext | The pointer to the context structure cy_stc_crypto_aes_context_t allocated by the user. This structure is used by the Crypto driver for the AES operation. Do not modify the values of this structure. |
cy_en_crypto_status_t Cy_Crypto_Aes_Free | ( | CRYPTO_Type * | base, |
cy_stc_crypto_aes_context_t * | aesContext | ||
) |
This function clears the AES operation context.
base | Base address of the Crypto block registers. |
aesContext | Pointer to the context structure cy_stc_crypto_aes_context_t allocated by the user. The structure is used by the Crypto driver for the AES operation. Do not modify the values of this structure. |
cy_en_crypto_status_t Cy_Crypto_Aes_Ecb | ( | CRYPTO_Type * | base, |
cy_en_crypto_dir_mode_t | dirMode, | ||
uint8_t * | dst, | ||
uint8_t const * | src, | ||
cy_stc_crypto_aes_context_t * | aesContext | ||
) |
This function performs an AES-ECB (Electronic Code Book) encryption/decryption operation on the input data.
It performs the AES operation on a single block of size CY_CRYPTO_AES_BLOCK_SIZE.
The AES key must be set before by invoking Cy_Crypto_Aes_Init().
base | Base address of the Crypto block registers. |
dirMode | Can be CY_CRYPTO_ENCRYPT or CY_CRYPTO_DECRYPT (cy_en_crypto_dir_mode_t). |
dst | Pointer to a destination buffer to store the output data of the AES operation. The buffer must be at least CY_CRYPTO_AES_BLOCK_SIZE bytes long. |
src | Pointer to a source block holding the data to be encrypted/decrypted. It must have at least CY_CRYPTO_AES_BLOCK_SIZE bytes of data. |
aesContext | Pointer to the context structure cy_stc_crypto_aes_context_t allocated by the user. The structure is used by the Crypto driver for the AES operation. Do not modify the values of this structure. |
cy_en_crypto_status_t Cy_Crypto_Aes_Cbc | ( | CRYPTO_Type * | base, |
cy_en_crypto_dir_mode_t | dirMode, | ||
uint32_t | srcSize, | ||
uint8_t * | ivPtr, | ||
uint8_t * | dst, | ||
uint8_t const * | src, | ||
cy_stc_crypto_aes_context_t * | aesContext | ||
) |
This function performs an AES-CBC (Cipher Block Chaining) encryption/decryption operation on the input data.
The key must be set before by invoking Cy_Crypto_Aes_Init().
base | Base address of the Crypto block registers. |
dirMode | Can be CY_CRYPTO_ENCRYPT or CY_CRYPTO_DECRYPT (cy_en_crypto_dir_mode_t) |
srcSize | Size of the input data in bytes. It should be a multiple of the AES block size CY_CRYPTO_AES_BLOCK_SIZE. |
ivPtr | Pointer to the initial vector of length CY_CRYPTO_AES_BLOCK_SIZE bytes. On return of this function, the content of the ivPtr is updated. For AES-CBC operation on the next block, the user must provide the updated ivPtr without any modification. |
dst | Pointer to a destination buffer to store the output data of the AES operation. This buffer must be at least as big as the source buffer. |
src | Pointer to the source buffer holding the data to be encrypted/decrypted. |
aesContext | Pointer to the context structure cy_stc_crypto_aes_context_t allocated by the user. The structure is used by the Crypto driver for the AES operation. Do not modify the values of this structure. |
cy_en_crypto_status_t Cy_Crypto_Aes_Cfb | ( | CRYPTO_Type * | base, |
cy_en_crypto_dir_mode_t | dirMode, | ||
uint32_t | srcSize, | ||
uint8_t * | ivOffset, | ||
uint8_t * | ivPtr, | ||
uint8_t * | dst, | ||
uint8_t const * | src, | ||
cy_stc_crypto_aes_context_t * | aesContext | ||
) |
This function performs the AES-CFB (Cipher FeedBack) encrypt/decrypt operation on the input data.
The key must be set before by invoking Cy_Crypto_Aes_Init().
base | Base address of the Crypto block registers. |
dirMode | Can be CY_CRYPTO_ENCRYPT or CY_CRYPTO_DECRYPT (cy_en_crypto_dir_mode_t) |
srcSize | Size of the input data in bytes. |
ivPtr | Pointer to the initial vector of length CY_CRYPTO_AES_BLOCK_SIZE bytes. On return of this function, the content of the * ivPtr is updated. For AES-CFB operation on the next bytes of data, the user must provide the updated ivPtr without any modification. |
ivOffset | Pointer holding the offset value in ivPtr. The pointer value should be 0 at the start of a stream. On return of this function, ivOffset value is updated. For AES-CFB operation on the next bytes in the stream, the user must provide the updated ivOffset without any modification. |
dst | Pointer to a destination buffer to store the output data of the AES operation. This buffer must be at least as big as the source buffer. |
src | Pointer to the source buffer holding the data to be encrypted/decrypted. |
aesContext | Pointer to the context structure cy_stc_crypto_aes_context_t allocated by the user. The structure is used by the Crypto driver for the AES operation. Do not modify the values of this structure. |
cy_en_crypto_status_t Cy_Crypto_Aes_Ctr | ( | CRYPTO_Type * | base, |
uint32_t | srcSize, | ||
uint32_t * | ncOffset, | ||
uint8_t * | nonceCounter, | ||
uint8_t * | streamBlock, | ||
uint8_t * | dst, | ||
uint8_t const * | src, | ||
cy_stc_crypto_aes_context_t * | aesContext | ||
) |
This function performs the AES-CTR (Counter mode) operation on the input data.
The key must be set before by invoking Cy_Crypto_Aes_Init().
base | Base address of the Crypto block registers. |
srcSize | Size of the input data in bytes. |
ncOffset | Pointer holding the offset within the streamBlock buffer for resuming within the current cipher stream. The pointer value should be 0 at the start of a stream. If this function is called multiple times with partial data, the user must not modify the ncOffset value. |
nonceCounter | Pointer holding the 128-bit nonce and counter. For a new message, the user should fill the first 12 bytes in this buffer with the per-message nonce, and the last 4 bytes with the initial counter value (initial counter value can be zero). The last 4 bytes are used internally and updated by the driver. For successive calls of this function with the partial data of a same message, the user must preserve the updated values and pass the same without any modification. |
streamBlock | The saved stream-block for resuming. This is overwritten by the function. The user must provide the allocated buffer and it must be at least 16 bytes long. If this function is called multiple times with partial data, the user must not modify the contents. |
dst | Pointer to a destination buffer to store the output data of the AES operation. |
src | Pointer to the source buffer holding the data to be encrypted/decrypted. |
aesContext | Pointer to the context structure cy_stc_crypto_aes_context_t allocated by the user. The structure is used by the Crypto driver for the AES operation. Do not modify the values of this structure. |