PSoC 6 Peripheral Driver Library

General Description

Functions

__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Aes_Init (CRYPTO_Type *base, uint8_t const *key, cy_en_crypto_aes_key_length_t keyLength, cy_stc_crypto_aes_state_t *aesState)
 Initializes AES mode of operation and prepares an inverse key. More...
 
__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Aes_InitContext (CRYPTO_Type *base, uint8_t const *key, cy_en_crypto_aes_key_length_t keyLength, cy_stc_crypto_aes_state_t *aesState, cy_stc_crypto_aes_buffers_t *aesBuffers)
 Initializes AES mode of operation and prepares an inverse key. More...
 
__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Aes_Free (CRYPTO_Type *base, cy_stc_crypto_aes_state_t *aesState)
 Clears AES operation context. More...
 
__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Aes_Ecb (CRYPTO_Type *base, cy_en_crypto_dir_mode_t dirMode, uint8_t *dst, uint8_t const *src, cy_stc_crypto_aes_state_t *aesState)
 Performs the AES operation on a single block. More...
 
__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_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_state_t *aesState)
 Performs the AES-CBC operation defined in the dirMode parameter on a plain text defined in the src parameter. More...
 
__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Aes_Cfb (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_state_t *aesState)
 Performs the AES-CFB operation defined in the dirMode parameter on a plain text defined in the SRC parameter. More...
 
__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Aes_Ctr (CRYPTO_Type *base, uint32_t srcSize, uint32_t *srcOffset, uint8_t *ivPtr, uint8_t *streamBlock, uint8_t *dst, uint8_t const *src, cy_stc_crypto_aes_state_t *aesState)
 Performs the AES-CTR operation on a plain text defined in the src parameter. More...
 
__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Des (CRYPTO_Type *base, cy_en_crypto_dir_mode_t dirMode, uint8_t const *key, uint8_t *dst, uint8_t const *src)
 Performs the DES operation on a single block. More...
 
__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Tdes (CRYPTO_Type *base, cy_en_crypto_dir_mode_t dirMode, uint8_t const *key, uint8_t *dst, uint8_t const *src)
 Performs the TDES operation on a single block. More...
 

Function Documentation

◆ Cy_Crypto_Core_Aes_Init()

__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Aes_Init ( CRYPTO_Type *  base,
uint8_t const *  key,
cy_en_crypto_aes_key_length_t  keyLength,
cy_stc_crypto_aes_state_t aesState 
)

Initializes AES mode of operation and prepares an inverse key.

Parameters
baseThe pointer to the CRYPTO instance.
keyThe pointer to the encryption/decryption key.
keyLengthcy_en_crypto_aes_key_length_t
aesStateThe pointer to the AES state structure allocated by the user. The user must not modify anything in this structure.
Returns
cy_en_crypto_status_t

◆ Cy_Crypto_Core_Aes_InitContext()

__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Aes_InitContext ( CRYPTO_Type *  base,
uint8_t const *  key,
cy_en_crypto_aes_key_length_t  keyLength,
cy_stc_crypto_aes_state_t aesState,
cy_stc_crypto_aes_buffers_t aesBuffers 
)

Initializes AES mode of operation and prepares an inverse key.

Parameters
baseThe pointer to the CRYPTO instance.
keyThe pointer to the encryption/decryption key.
keyLengthcy_en_crypto_aes_key_length_t
aesStateThe pointer to the AES state structure allocated by the user. The user must not modify anything in this structure.
aesBuffersThe pointer to the memory buffers storage.
Returns
cy_en_crypto_status_t

◆ Cy_Crypto_Core_Aes_Free()

__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Aes_Free ( CRYPTO_Type *  base,
cy_stc_crypto_aes_state_t aesState 
)

Clears AES operation context.

Parameters
baseThe pointer to the CRYPTO instance.
aesStateThe pointer to the AES state structure allocated by the user. The user must not modify anything in this structure.
Returns
cy_en_crypto_status_t

◆ Cy_Crypto_Core_Aes_Ecb()

__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Aes_Ecb ( CRYPTO_Type *  base,
cy_en_crypto_dir_mode_t  dirMode,
uint8_t *  dst,
uint8_t const *  src,
cy_stc_crypto_aes_state_t aesState 
)

Performs the AES operation on a single block.

Parameters
baseThe pointer to the CRYPTO instance.
dirModeCan be CY_CRYPTO_ENCRYPT or CY_CRYPTO_DECRYPT (cy_en_crypto_dir_mode_t).
dstThe pointer to the destination cipher block.
srcThe pointer to the source block.
aesStateThe pointer to the AES state structure allocated by the user. The user must not modify anything in this structure.
Returns
cy_en_crypto_status_t

◆ Cy_Crypto_Core_Aes_Cbc()

__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_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_state_t aesState 
)

Performs the AES-CBC operation defined in the dirMode parameter on a plain text defined in the src parameter.

Parameters
baseThe pointer to the CRYPTO instance.
dirModeCan be CY_CRYPTO_ENCRYPT or CY_CRYPTO_DECRYPT (cy_en_crypto_dir_mode_t)
srcSizeThe size of the source plain text.
ivPtrThe pointer to the initial vector.
dstThe pointer to the destination cipher text.
srcThe pointer to the source plain text.
aesStateThe pointer to the AES state structure allocated by the user. The user must not modify anything in this structure.
Returns
cy_en_crypto_status_t

◆ Cy_Crypto_Core_Aes_Cfb()

__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Aes_Cfb ( 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_state_t aesState 
)

Performs the AES-CFB operation defined in the dirMode parameter on a plain text defined in the SRC parameter.

Parameters
baseThe pointer to the CRYPTO instance.
dirModeCan be CY_CRYPTO_ENCRYPT or CY_CRYPTO_DECRYPT (cy_en_crypto_dir_mode_t)
srcSizeThe size of the source plain text.
ivPtrThe pointer to the initial vector.
dstThe pointer to the destination cipher text.
srcThe pointer to the source plain text.
aesStateThe pointer to the AES state structure allocated by the user. The user must not modify anything in this structure.
Returns
cy_en_crypto_status_t

◆ Cy_Crypto_Core_Aes_Ctr()

__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Aes_Ctr ( CRYPTO_Type *  base,
uint32_t  srcSize,
uint32_t *  srcOffset,
uint8_t *  ivPtr,
uint8_t *  streamBlock,
uint8_t *  dst,
uint8_t const *  src,
cy_stc_crypto_aes_state_t aesState 
)

Performs the AES-CTR operation on a plain text defined in the src parameter.

Parameters
baseThe pointer to the CRYPTO instance.
srcSizeThe size of the source plain text.
srcOffsetThe size of an offset within the current block stream for resuming within the current cipher stream.
ivPtrThe 128-bit initial vector that contains a 64-bit nonce and 64-bit counter.
streamBlockThe saved stream-block for resuming. Is over-written by the function.
dstThe pointer to the destination cipher text.
srcThe pointer to the source plain text. Must be 4-Byte aligned.
aesStateThe pointer to the AES state structure allocated by the user. The user must not modify anything in this structure.
Returns
cy_en_crypto_status_t

◆ Cy_Crypto_Core_Des()

__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Des ( CRYPTO_Type *  base,
cy_en_crypto_dir_mode_t  dirMode,
uint8_t const *  key,
uint8_t *  dst,
uint8_t const *  src 
)

Performs the DES operation on a single block.

All addresses must be 4-byte aligned. Ciphertext (dst) may overlap with plaintext (src). This function is independent from the previous Crypto state.

Parameters
baseThe pointer to the CRYPTO instance.
dirModeCan be CY_CRYPTO_ENCRYPT or CY_CRYPTO_DECRYPT (cy_en_crypto_dir_mode_t)
keyThe pointer to the encryption/decryption key.
dstThe pointer to the destination cipher block.
srcThe pointer to the source block.
Returns
cy_en_crypto_status_t

◆ Cy_Crypto_Core_Tdes()

__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Tdes ( CRYPTO_Type *  base,
cy_en_crypto_dir_mode_t  dirMode,
uint8_t const *  key,
uint8_t *  dst,
uint8_t const *  src 
)

Performs the TDES operation on a single block.

All addresses must be 4-byte aligned. Ciphertext (dst) may overlap with plaintext (src). This function is independent from the previous Crypto state.

Parameters
baseThe pointer to the CRYPTO instance.
dirModeCan be CY_CRYPTO_ENCRYPT or CY_CRYPTO_DECRYPT (cy_en_crypto_dir_mode_t)
keyThe pointer to the encryption/decryption keys.
dstThe pointer to the destination cipher block.
srcThe pointer to the source data block.
Returns
cy_en_crypto_status_t