Functions | |
cy_en_cryptolite_status_t | Cy_Cryptolite_Aes_Init (CRYPTOLITE_Type *base, uint8_t const *key, cy_stc_cryptolite_aes_context_t *aesContext) |
This function initializes the AES operation by setting the key. More... | |
cy_en_cryptolite_status_t | Cy_Cryptolite_Aes_Free (CRYPTOLITE_Type *base, cy_stc_cryptolite_aes_context_t *aesContext) |
This function clears the AES operation context. More... | |
cy_en_cryptolite_status_t | Cy_Cryptolite_Aes_Ecb (CRYPTOLITE_Type *base, uint8_t *dst, uint8_t const *src, uint32_t srcSize, cy_stc_cryptolite_aes_context_t *aesContext) |
This function performs an AES-ECB (Electronic Code Book) encryption operation on the input data. More... | |
cy_en_cryptolite_status_t | Cy_Cryptolite_Aes_Cbc (CRYPTOLITE_Type *base, uint32_t srcSize, uint8_t *ivPtr, uint8_t *dst, uint8_t const *src, cy_stc_cryptolite_aes_context_t *aesContext) |
This function performs an AES-CBC (Cipher Block Chaining) encryption operation on the input data. More... | |
cy_en_cryptolite_status_t | Cy_Cryptolite_Aes_Cfb (CRYPTOLITE_Type *base, uint32_t srcSize, uint8_t *ivOffset, uint8_t *ivPtr, uint8_t *dst, uint8_t const *src, cy_stc_cryptolite_aes_context_t *aesContext) |
This function performs the AES-CFB (Cipher FeedBack) encrypt operation on the input data. More... | |
cy_en_cryptolite_status_t | Cy_Cryptolite_Aes_Ofb (CRYPTOLITE_Type *base, uint32_t srcSize, uint8_t *ivPtr, uint8_t *dst, uint8_t const *src, cy_stc_cryptolite_aes_context_t *aesContext) |
This function performs the AES-OFB (Output FeedBack) encrypt operation on the input data. More... | |
cy_en_cryptolite_status_t | Cy_Cryptolite_Aes_Ctr (CRYPTOLITE_Type *base, uint32_t srcSize, uint32_t *ncOffset, uint8_t *nonceCounter, uint8_t *streamBlock, uint8_t *dst, uint8_t const *src, cy_stc_cryptolite_aes_context_t *aesContext) |
This function performs the AES-CTR (Counter mode) operation on the input data. More... | |
cy_en_cryptolite_status_t Cy_Cryptolite_Aes_Init | ( | CRYPTOLITE_Type * | base, |
uint8_t const * | key, | ||
cy_stc_cryptolite_aes_context_t * | aesContext | ||
) |
This function initializes the AES operation by setting the key.
base | Base address of the Cryptolite block registers. |
key | Pointer to the encryption key. |
aesContext | The pointer to the context structure cy_stc_cryptolite_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_cryptolite_status_t Cy_Cryptolite_Aes_Free | ( | CRYPTOLITE_Type * | base, |
cy_stc_cryptolite_aes_context_t * | aesContext | ||
) |
This function clears the AES operation context.
base | Base address of the Cryptolite block registers. |
aesContext | Pointer to the context structure cy_stc_cryptolite_aes_context_t allocated by the user. The structure is used by the Cryptolite driver for the AES operation. Do not modify the values of this structure. |
cy_en_cryptolite_status_t Cy_Cryptolite_Aes_Ecb | ( | CRYPTOLITE_Type * | base, |
uint8_t * | dst, | ||
uint8_t const * | src, | ||
uint32_t | srcSize, | ||
cy_stc_cryptolite_aes_context_t * | aesContext | ||
) |
This function performs an AES-ECB (Electronic Code Book) encryption operation on the input data.
The AES key must be set before by invoking Cy_Cryptolite_Aes_Init().
base | Base address of the Cryptolite block registers. |
dst | Pointer to a destination buffer to store the output data of the AES operation. The buffer must be at least CY_CRYPTOLITE_AES_BLOCK_SIZE bytes long. |
src | Pointer to a source block holding the data to be encrypted. It must have at least CY_CRYPTOLITE_AES_BLOCK_SIZE bytes of data. |
srcSize | Size of the input data in bytes. It should be a multiple of the AES block size CY_CRYPTOLITE_AES_BLOCK_SIZE. |
aesContext | Pointer to the context structure cy_stc_cryptolite_aes_context_t allocated by the user. The structure is used by the Cryptolite driver for the AES operation. Do not modify the values of this structure. |
cy_en_cryptolite_status_t Cy_Cryptolite_Aes_Cbc | ( | CRYPTOLITE_Type * | base, |
uint32_t | srcSize, | ||
uint8_t * | ivPtr, | ||
uint8_t * | dst, | ||
uint8_t const * | src, | ||
cy_stc_cryptolite_aes_context_t * | aesContext | ||
) |
This function performs an AES-CBC (Cipher Block Chaining) encryption operation on the input data.
The key must be set before by invoking Cy_Cryptolite_Aes_Init().
base | Base address of the Cryptolite block registers. |
srcSize | Size of the input data in bytes. It should be a multiple of the AES block size CY_CRYPTOLITE_AES_BLOCK_SIZE. |
ivPtr | Pointer to the initial vector of length CY_CRYPTOLITE_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. |
aesContext | Pointer to the context structure cy_stc_cryptolite_aes_context_t allocated by the user. The structure is used by the Cryptolite driver for the AES operation. Do not modify the values of this structure. |
cy_en_cryptolite_status_t Cy_Cryptolite_Aes_Cfb | ( | CRYPTOLITE_Type * | base, |
uint32_t | srcSize, | ||
uint8_t * | ivOffset, | ||
uint8_t * | ivPtr, | ||
uint8_t * | dst, | ||
uint8_t const * | src, | ||
cy_stc_cryptolite_aes_context_t * | aesContext | ||
) |
This function performs the AES-CFB (Cipher FeedBack) encrypt operation on the input data.
The key must be set before by invoking Cy_Cryptolite_Aes_Init().
base | Base address of the Cryptolite block registers. |
srcSize | Size of the input data in bytes. |
ivPtr | Pointer to the initial vector of length CY_CRYPTOLITE_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. |
aesContext | Pointer to the context structure cy_stc_cryptolite_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_cryptolite_status_t Cy_Cryptolite_Aes_Ofb | ( | CRYPTOLITE_Type * | base, |
uint32_t | srcSize, | ||
uint8_t * | ivPtr, | ||
uint8_t * | dst, | ||
uint8_t const * | src, | ||
cy_stc_cryptolite_aes_context_t * | aesContext | ||
) |
This function performs the AES-OFB (Output FeedBack) encrypt operation on the input data.
The key must be set before by invoking Cy_Cryptolite_Aes_Init().
base | Base address of the Cryptolite block registers. |
srcSize | Size of the input data in bytes. |
ivPtr | Pointer to the initial vector of length CY_CRYPTOLITE_AES_BLOCK_SIZE bytes. |
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. |
aesContext | Pointer to the context structure cy_stc_cryptolite_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_cryptolite_status_t Cy_Cryptolite_Aes_Ctr | ( | CRYPTOLITE_Type * | base, |
uint32_t | srcSize, | ||
uint32_t * | ncOffset, | ||
uint8_t * | nonceCounter, | ||
uint8_t * | streamBlock, | ||
uint8_t * | dst, | ||
uint8_t const * | src, | ||
cy_stc_cryptolite_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_Cryptolite_Aes_Init().
base | Base address of the Cryptolite 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. |
aesContext | Pointer to the context structure cy_stc_cryptolite_aes_context_t allocated by the user. The structure is used by the Cryptolite driver for the AES operation. Do not modify the values of this structure. |