11 #ifndef __MG32F157_AES_H 12 #define __MG32F157_AES_H 41 #define IS_AES_CHMOD(MODE) (((MODE) == AES_CHMOD_ECB) || ((MODE) == AES_CHMOD_CBC) || \ 42 ((MODE) == AES_CHMOD_CTR)) 52 AES_MODE_Derivation_Decryption
55 #define IS_AES_MODE(MODE) (((MODE) == AES_MODE_Encryption) || ((MODE) == AES_MODE_Decryption) || \ 56 ((MODE) == AES_MODE_Derivation) || ((MODE) == AES_MODE_Derivation_Decryption)) 70 #define IS_AES_DATATYPE(DATA) (((DATA) == AES_DATATYPE_32Bits) || ((DATA) == AES_DATATYPE_16Bits) || \ 71 ((DATA) == AES_DATATYPE_8Bits) || ((DATA) == AES_DATATYPE_1Bit)) 97 #define AES_DMA_IN ((uint16_t)0x0800) 98 #define AES_DMA_OUT ((uint16_t)0x1000) 100 #define IS_AES_DMA(AES_DMA) (((AES_DMA) == AES_DMA_IN) || ((AES_DMA) == AES_DMA_OUT)) 108 #define AES_IT_ERR ((uint32_t)0x04000006) 109 #define AES_IT_CCF ((uint32_t)0x02000001) 111 #define IS_AES_IT(AES_IT) (((uint16_t)(AES_IT >> 16) & 0x0600) != 0x0000) 113 #define IS_AES_GET_IT(AES_IT) (((AES_IT) == AES_IT_ERR) || ((AES_IT) == AES_IT_CCF)) 121 #define AES_FLAG_WRERR ((uint8_t)0x04) 122 #define AES_FLAG_RDERR ((uint8_t)0x02) 123 #define AES_FLAG_CCF ((uint8_t)0x01) 125 #define IS_AES_GET_FLAG(AES_FLAG) (((AES_FLAG) == AES_FLAG_WRERR) || ((AES_FLAG) == AES_FLAG_RDERR) || ((AES_FLAG) == AES_FLAG_CCF)) 126 #define IS_AES_CLEAR_FLAG(AES_FLAG) (((AES_FLAG) == AES_FLAG_WRERR) || ((AES_FLAG) == AES_FLAG_RDERR) || ((AES_FLAG) == AES_FLAG_CCF)) 139 void AES_Cmd(FunctionalState NewState);
140 void AES_IT_Config(uint32_t AES_IT, FunctionalState NewState);
146 void AES_DMA_Cmd(uint16_t AES_DMA, FunctionalState NewState);
void AES_Init(AES_InitTypeDef *AES_InitStruct)
Initializes the AES peripheral according to the specified parameters in the AES_InitStruct.
Definition: mg32f157_aes.c:129
void AES_SetInitVector(uint8_t *InitVector)
Writes the InitVector/InitCounter in IV registers.
Definition: mg32f157_aes.c:382
AESMode_TypeDef
AES working mode definition.
Definition: mg32f157_aes.h:47
ITStatus AES_GetITStatus(uint32_t AES_IT)
Checks whether the specified AES interrupt has occurred or not.
Definition: mg32f157_aes.c:294
void AES_SetKey(uint8_t *Key)
Writes the Key in Key registers.
Definition: mg32f157_aes.c:360
void AES_ClearITPendingBit(uint32_t AES_IT)
Clears the AES's interrupt pending bits.
Definition: mg32f157_aes.c:330
AESData_TypeDef AES_DATATYPE
Definition: mg32f157_aes.h:84
FlagStatus AES_GetFlagStatus(uint8_t AES_FLAG)
Checks whether the specified AES flag is set or not.
Definition: mg32f157_aes.c:236
void AES_ClearFlag(uint8_t AES_FLAG)
Clears the AES's pending flags.
Definition: mg32f157_aes.c:268
void AES_DataInput(uint32_t *inputaddr)
Writes the origin data into AES DINR register.
Definition: mg32f157_aes.c:400
AESData_TypeDef
AES datatype definition.
Definition: mg32f157_aes.h:62
void AES_Cmd(FunctionalState NewState)
Enables or disables the AES.
Definition: mg32f157_aes.c:70
AESMode_TypeDef AES_MODE
Definition: mg32f157_aes.h:81
void AES_DeInit(void)
Deinitializes the AES peripheral registers to their default reset values.
Definition: mg32f157_aes.c:89
void AES_DMA_Cmd(uint16_t AES_DMA, FunctionalState NewState)
Enables or disables the specified AES DMA request.
Definition: mg32f157_aes.c:433
void AES_DataOutput(uint32_t *outputaddr)
Gets the output data from AES DOUTR register.
Definition: mg32f157_aes.c:416
void AES_IT_Config(uint32_t AES_IT, FunctionalState NewState)
Enables or disables the specified AES interrupts.
Definition: mg32f157_aes.c:200
AES Init structure definition.
Definition: mg32f157_aes.h:76
AESChMod_TypeDef
AES chaining mode definition.
Definition: mg32f157_aes.h:34
AESChMod_TypeDef AES_CHMOD
Definition: mg32f157_aes.h:78