AES driver modules.
More...
|
#define | IS_AES_CHMOD(MODE) |
|
#define | IS_AES_MODE(MODE) |
|
#define | IS_AES_DATATYPE(DATA) |
|
|
enum | AESChMod_TypeDef { AES_CHMOD_ECB,
AES_CHMOD_CBC,
AES_CHMOD_CTR
} |
| AES chaining mode definition. More...
|
|
enum | AESMode_TypeDef { AES_MODE_Encryption,
AES_MODE_Decryption,
AES_MODE_Derivation,
AES_MODE_Derivation_Decryption
} |
| AES working mode definition. More...
|
|
enum | AESData_TypeDef { AES_DATATYPE_32Bits,
AES_DATATYPE_16Bits,
AES_DATATYPE_8Bits,
AES_DATATYPE_1Bit
} |
| AES datatype definition.
|
|
AES driver modules.
◆ IS_AES_CHMOD
#define IS_AES_CHMOD |
( |
|
MODE | ) |
|
Value:(((MODE) == AES_CHMOD_ECB) || ((MODE) == AES_CHMOD_CBC) || \
((MODE) == AES_CHMOD_CTR))
◆ IS_AES_DATATYPE
#define IS_AES_DATATYPE |
( |
|
DATA | ) |
|
Value:(((DATA) == AES_DATATYPE_32Bits) || ((DATA) == AES_DATATYPE_16Bits) || \
((DATA) == AES_DATATYPE_8Bits) || ((DATA) == AES_DATATYPE_1Bit))
◆ IS_AES_MODE
#define IS_AES_MODE |
( |
|
MODE | ) |
|
Value:(((MODE) == AES_MODE_Encryption) || ((MODE) == AES_MODE_Decryption) || \
((MODE) == AES_MODE_Derivation) || ((MODE) == AES_MODE_Derivation_Decryption))
◆ AESChMod_TypeDef
AES chaining mode definition.
◆ AESMode_TypeDef
AES working mode definition.
◆ AES_ClearFlag()
void AES_ClearFlag |
( |
uint8_t |
AES_FLAG | ) |
|
Clears the AES's pending flags.
- Parameters
-
AES_FLAG | specifies the flag to clear. This parameter can be one of the following values:
- AES_FLAG_WRERR: Write error flag
- AES_FLAG_RDERR: Read error flag
- AES_FLAG_CCF: Calculation completly flag
|
- Returns
- None
◆ AES_ClearITPendingBit()
void AES_ClearITPendingBit |
( |
uint32_t |
AES_IT | ) |
|
Clears the AES's interrupt pending bits.
- Parameters
-
AES_IT | specifies the interrupt pending bit to clear. This parameter can be any combination of the following values:
- AES_IT_ERR: Error interrupt
- AES_IT_CCF: Calculation completly interrupt
|
- Returns
- None
◆ AES_Cmd()
void AES_Cmd |
( |
FunctionalState |
NewState | ) |
|
Enables or disables the AES.
- Parameters
-
NewState | new state of the AES. This parameter can be: ENABLE or DISABLE. |
- Returns
- None
◆ AES_DataInput()
void AES_DataInput |
( |
uint32_t * |
inputaddr | ) |
|
Writes the origin data into AES DINR register.
- Parameters
-
inputaddr | Pointer to input data buffer. |
- Note
- Set the 128bits input data by writing the AES Input Data Register(DINR) 4 times.
- Returns
- None
◆ AES_DataOutput()
void AES_DataOutput |
( |
uint32_t * |
outputaddr | ) |
|
Gets the output data from AES DOUTR register.
- Parameters
-
outputaddr | Pointer to output data buffer. |
- Note
- Get the 128bits output data by reading the AES Output Data Register(DOUTR) 4 times.
- Returns
- None
◆ AES_DeInit()
Deinitializes the AES peripheral registers to their default reset values.
- Parameters
-
- Returns
- None
◆ AES_DMA_Cmd()
void AES_DMA_Cmd |
( |
uint16_t |
AES_DMA, |
|
|
FunctionalState |
NewState |
|
) |
| |
Enables or disables the specified AES DMA request.
- Parameters
-
AES_DMA | specifies the DMA input request or DAM output request. This parameter can be: AES_DMA_IN or AES_DMA_OUT. |
NewState | new state of the specified AES DMAC request. This parameter can be: ENABLE or DISABLE. |
- Returns
- None
◆ AES_GetFlagStatus()
FlagStatus AES_GetFlagStatus |
( |
uint8_t |
AES_FLAG | ) |
|
Checks whether the specified AES flag is set or not.
- Parameters
-
AES_FLAG | specifies the flag to check. This parameter can be one of the following values:
- AES_FLAG_WRERR: Write error flag
- AES_FLAG_RDERR: Read error flag
- AES_FLAG_CCF: Calculation completly flag
|
- Returns
- The new state of AES_FLAG (SET or RESET).
◆ AES_GetITStatus()
ITStatus AES_GetITStatus |
( |
uint32_t |
AES_IT | ) |
|
Checks whether the specified AES interrupt has occurred or not.
- Parameters
-
AES_IT | specifies the interrupt source to check. This parameter can be one of the following values:
- AES_IT_ERR: Error interrupt
- AES_IT_CCF: Calculation completly interrupt
|
- Returns
- The new state of AES_IT (SET or RESET).
◆ AES_Init()
Initializes the AES peripheral according to the specified parameters in the AES_InitStruct.
- Parameters
-
AES_InitStruct | pointer to a AES_InitTypeDef structure that contains the configuration information for the specified AES peripheral. |
- Returns
- None
◆ AES_IT_Config()
void AES_IT_Config |
( |
uint32_t |
AES_IT, |
|
|
FunctionalState |
NewState |
|
) |
| |
Enables or disables the specified AES interrupts.
- Parameters
-
AES_IT | specifies the AES interrupt sources to be enabled or disabled. This parameter can be any combination of the following values:
- AES_IT_ERR: Error interrupt mask
- AES_IT_CCF: Calulation completly interrupt mask
|
NewState | new state of the specified AES interrupts. This parameter can be: ENABLE or DISABLE. |
- Returns
- None
◆ AES_SetInitVector()
void AES_SetInitVector |
( |
uint8_t * |
InitVector | ) |
|
Writes the InitVector/InitCounter in IV registers.
- Parameters
-
InitVector | : Pointer to InitVector/InitCounter buffer |
- Note
- Init Vector must be written as little endian. If Init Vector pointer points at address n, n[15:0] contains Vector[96:127], (n+4)[15:0] contains Vector[64:95], (n+8)[15:0] contains Vector[32:63] and (n+12)[15:0] contains Vector[0:31]
- Returns
- None
◆ AES_SetKey()
void AES_SetKey |
( |
uint8_t * |
Key | ) |
|
Writes the Key in Key registers.
- Parameters
-
Key | Pointer to Key buffer. |
- Note
- Key must be written as little endian. If Key pointer points at address n, n[15:0] contains key[96:127], (n+4)[15:0] contains key[64:95], (n+8)[15:0] contains key[32:63] and (n+12)[15:0] contains key[0:31]
- Returns
- None