CARME-M4 BSP  V1.5

High Level AES functions. More...

+ Collaboration diagram for High Level AES functions:

Functions

ErrorStatus CRYP_AES_ECB (uint8_t Mode, uint8_t *Key, uint16_t Keysize, uint8_t *Input, uint32_t Ilength, uint8_t *Output)
 Encrypt and decrypt using AES in ECB Mode. More...
 
ErrorStatus CRYP_AES_CBC (uint8_t Mode, uint8_t InitVectors[16], uint8_t *Key, uint16_t Keysize, uint8_t *Input, uint32_t Ilength, uint8_t *Output)
 Encrypt and decrypt using AES in CBC Mode. More...
 
ErrorStatus CRYP_AES_CTR (uint8_t Mode, uint8_t InitVectors[16], uint8_t *Key, uint16_t Keysize, uint8_t *Input, uint32_t Ilength, uint8_t *Output)
 Encrypt and decrypt using AES in CTR Mode. More...
 
ErrorStatus CRYP_AES_GCM (uint8_t Mode, uint8_t InitVectors[16], uint8_t *Key, uint16_t Keysize, uint8_t *Input, uint32_t ILength, uint8_t *Header, uint32_t HLength, uint8_t *Output, uint8_t *AuthTAG)
 Encrypt and decrypt using AES in GCM Mode. The GCM and CCM modes are available only on STM32F437x Devices. More...
 
ErrorStatus CRYP_AES_CCM (uint8_t Mode, uint8_t *Nonce, uint32_t NonceSize, uint8_t *Key, uint16_t Keysize, uint8_t *Input, uint32_t ILength, uint8_t *Header, uint32_t HLength, uint8_t *HBuffer, uint8_t *Output, uint8_t *AuthTAG, uint32_t TAGSize)
 Encrypt and decrypt using AES in CCM Mode. The GCM and CCM modes are available only on STM32F437x Devices. More...
 

Detailed Description

High Level AES functions.

 ===============================================================================
                       ##### High Level AES functions #####
 ===============================================================================

Function Documentation

ErrorStatus CRYP_AES_CBC ( uint8_t  Mode,
uint8_t  InitVectors[16],
uint8_t *  Key,
uint16_t  Keysize,
uint8_t *  Input,
uint32_t  Ilength,
uint8_t *  Output 
)

Encrypt and decrypt using AES in CBC Mode.

Parameters
Modeencryption or decryption Mode. This parameter can be one of the following values:
  • MODE_ENCRYPT: Encryption
  • MODE_DECRYPT: Decryption
InitVectorsInitialisation Vectors used for AES algorithm.
KeyKey used for AES algorithm.
Keysizelength of the Key, must be a 128, 192 or 256.
Inputpointer to the Input buffer.
Ilengthlength of the Input buffer, must be a multiple of 16.
Outputpointer to the returned buffer.
Return values
AnErrorStatus enumeration value:
  • SUCCESS: Operation done
  • ERROR: Operation failed

Definition at line 294 of file stm32f4xx_cryp_aes.c.

+ Here is the call graph for this function:

ErrorStatus CRYP_AES_CCM ( uint8_t  Mode,
uint8_t *  Nonce,
uint32_t  NonceSize,
uint8_t *  Key,
uint16_t  Keysize,
uint8_t *  Input,
uint32_t  ILength,
uint8_t *  Header,
uint32_t  HLength,
uint8_t *  HBuffer,
uint8_t *  Output,
uint8_t *  AuthTAG,
uint32_t  TAGSize 
)

Encrypt and decrypt using AES in CCM Mode. The GCM and CCM modes are available only on STM32F437x Devices.

Parameters
Modeencryption or decryption Mode. This parameter can be one of the following values:
  • MODE_ENCRYPT: Encryption
  • MODE_DECRYPT: Decryption
Noncethe nounce used for AES algorithm. It shall be unique for each processing.
KeyKey used for AES algorithm.
Keysizelength of the Key, must be a 128, 192 or 256.
Inputpointer to the Input buffer.
Ilengthlength of the Input buffer in bytes, must be a multiple of 16.
Headerpointer to the header buffer.
Hlengthlength of the header buffer in bytes.
HBufferpointer to temporary buffer used to append the header HBuffer size must be equal to Hlength + 21
Outputpointer to the returned buffer.
AuthTAGpointer to the authentication TAG buffer.
TAGSizethe size of the TAG (called also MAC).
Return values
AnErrorStatus enumeration value:
  • SUCCESS: Operation done
  • ERROR: Operation failed

Definition at line 1135 of file stm32f4xx_cryp_aes.c.

+ Here is the call graph for this function:

ErrorStatus CRYP_AES_CTR ( uint8_t  Mode,
uint8_t  InitVectors[16],
uint8_t *  Key,
uint16_t  Keysize,
uint8_t *  Input,
uint32_t  Ilength,
uint8_t *  Output 
)

Encrypt and decrypt using AES in CTR Mode.

Parameters
Modeencryption or decryption Mode. This parameter can be one of the following values:
  • MODE_ENCRYPT: Encryption
  • MODE_DECRYPT: Decryption
InitVectorsInitialisation Vectors used for AES algorithm.
KeyKey used for AES algorithm.
Keysizelength of the Key, must be a 128, 192 or 256.
Inputpointer to the Input buffer.
Ilengthlength of the Input buffer, must be a multiple of 16.
Outputpointer to the returned buffer.
Return values
AnErrorStatus enumeration value:
  • SUCCESS: Operation done
  • ERROR: Operation failed

Definition at line 496 of file stm32f4xx_cryp_aes.c.

+ Here is the call graph for this function:

ErrorStatus CRYP_AES_ECB ( uint8_t  Mode,
uint8_t *  Key,
uint16_t  Keysize,
uint8_t *  Input,
uint32_t  Ilength,
uint8_t *  Output 
)

Encrypt and decrypt using AES in ECB Mode.

Parameters
Modeencryption or decryption Mode. This parameter can be one of the following values:
  • MODE_ENCRYPT: Encryption
  • MODE_DECRYPT: Decryption
KeyKey used for AES algorithm.
Keysizelength of the Key, must be a 128, 192 or 256.
Inputpointer to the Input buffer.
Ilengthlength of the Input buffer, must be a multiple of 16.
Outputpointer to the returned buffer.
Return values
AnErrorStatus enumeration value:
  • SUCCESS: Operation done
  • ERROR: Operation failed

Definition at line 106 of file stm32f4xx_cryp_aes.c.

+ Here is the call graph for this function:

ErrorStatus CRYP_AES_GCM ( uint8_t  Mode,
uint8_t  InitVectors[16],
uint8_t *  Key,
uint16_t  Keysize,
uint8_t *  Input,
uint32_t  ILength,
uint8_t *  Header,
uint32_t  HLength,
uint8_t *  Output,
uint8_t *  AuthTAG 
)

Encrypt and decrypt using AES in GCM Mode. The GCM and CCM modes are available only on STM32F437x Devices.

Parameters
Modeencryption or decryption Mode. This parameter can be one of the following values:
  • MODE_ENCRYPT: Encryption
  • MODE_DECRYPT: Decryption
InitVectorsInitialisation Vectors used for AES algorithm.
KeyKey used for AES algorithm.
Keysizelength of the Key, must be a 128, 192 or 256.
Inputpointer to the Input buffer.
Ilengthlength of the Input buffer in bytes, must be a multiple of 16.
Headerpointer to the header buffer.
Hlengthlength of the header buffer in bytes, must be a multiple of 16.
Outputpointer to the returned buffer.
AuthTAGpointer to the authentication TAG buffer.
Return values
AnErrorStatus enumeration value:
  • SUCCESS: Operation done
  • ERROR: Operation failed

Definition at line 670 of file stm32f4xx_cryp_aes.c.

+ Here is the call graph for this function: