165 #include "stm32f4xx_rcc.h" 178 #define FLAG_MASK ((uint8_t)0x20) 179 #define MAX_TIMEOUT ((uint16_t)0xFFFF) 367 { uint32_t tempcr = 0;
378 tempcr |= (uint32_t)CRYP_Phase;
500 __IO uint32_t timeout = 0;
501 uint32_t ckeckmask = 0, bitstatus;
522 bitstatus =
CRYP->SR & ckeckmask;
690 CRYP->DMACR |= CRYP_DMAReq;
695 CRYP->DMACR &= (uint8_t)~CRYP_DMAReq;
808 CRYP->IMSCR |= CRYP_IT;
813 CRYP->IMSCR &= (uint8_t)~CRYP_IT;
834 if ((
CRYP->MISR & CRYP_IT) != (uint8_t)
RESET)
886 uint32_t tempreg = 0;
894 tempreg =
CRYP->RISR;
903 if ((tempreg & CRYP_FLAG ) != (uint8_t)
RESET)
#define CRYP_KeySize_128b
void CRYP_IVStructInit(CRYP_IVInitTypeDef *CRYP_IVInitStruct)
Fills each CRYP_IVInitStruct member with its default value.
#define CRYP_AlgoMode_TDES_ECB
void CRYP_StructInit(CRYP_InitTypeDef *CRYP_InitStruct)
Fills each CRYP_InitStruct member with its default value.
#define IS_CRYP_CONFIG_IT(IT)
void CRYP_Cmd(FunctionalState NewState)
Enables or disables the CRYP peripheral.
#define CRYP_AlgoMode_DES_ECB
void CRYP_RestoreContext(CRYP_Context *CRYP_ContextRestore)
Restores the CRYP peripheral Context.
#define IS_CRYP_KEYSIZE(KEYSIZE)
uint32_t CR_CurrentConfig
#define IS_CRYP_GET_IT(IT)
uint32_t CRYP_DataOut(void)
Returns the last data entered into the output FIFO.
void assert_param(int val)
#define CRYP_DataType_32b
#define IS_FUNCTIONAL_STATE(STATE)
#define CRYP_AlgoMode_DES_CBC
CRYP context swapping structure definition.
static volatile uint8_t * status
void CRYP_DataIn(uint32_t Data)
Writes data in the Data Input register (DIN).
void CRYP_IVInit(CRYP_IVInitTypeDef *CRYP_IVInitStruct)
Initializes the CRYP Initialization Vectors(IV) according to the specified parameters in the CRYP_IVI...
FlagStatus CRYP_GetFlagStatus(uint8_t CRYP_FLAG)
Checks whether the specified CRYP flag is set or not.
void CRYP_FIFOFlush(void)
Flushes the IN and OUT FIFOs (that is read and write pointers of the FIFOs are reset) ...
#define CRYP_AlgoDir_Encrypt
#define IS_CRYP_GET_FLAG(FLAG)
void CRYP_ITConfig(uint8_t CRYP_IT, FunctionalState NewState)
Enables or disables the specified CRYP interrupts.
void CRYP_DMACmd(uint8_t CRYP_DMAReq, FunctionalState NewState)
Enables or disables the CRYP DMA interface.
ITStatus CRYP_GetITStatus(uint8_t CRYP_IT)
Checks whether the specified CRYP interrupt has occurred or not.
#define IS_CRYP_ALGODIR(ALGODIR)
#define IS_CRYP_DATATYPE(DATATYPE)
#define CRYP_CR_ALGOMODE_TDES_CBC
void CRYP_KeyStructInit(CRYP_KeyInitTypeDef *CRYP_KeyInitStruct)
Fills each CRYP_KeyInitStruct member with its default value.
void CRYP_DeInit(void)
Deinitializes the CRYP peripheral registers to their default reset values.
FunctionalState CRYP_GetCmdStatus(void)
Returns whether CRYP peripheral is enabled or disabled.
#define CRYP_CR_ALGOMODE_TDES_ECB
#define IS_CRYP_ALGOMODE(ALGOMODE)
CRYP Key(s) structure definition.
This file contains all the functions prototypes for the Cryptographic processor(CRYP) firmware librar...
#define CRYP_CR_GCM_CCMPH
#define IS_CRYP_DMAREQ(DMAREQ)
uint32_t CRYP_CSGCMCCMR[8]
#define IS_CRYP_PHASE(PHASE)
CRYP Initialization Vectors (IV) structure definition.
ErrorStatus CRYP_SaveContext(CRYP_Context *CRYP_ContextSave, CRYP_KeyInitTypeDef *CRYP_KeyInitStruct)
Saves the CRYP peripheral Context.
void RCC_AHB2PeriphResetCmd(uint32_t RCC_AHB2Periph, FunctionalState NewState)
Forces or releases AHB2 peripheral reset.
#define CRYP_AlgoMode_TDES_CBC
void CRYP_Init(CRYP_InitTypeDef *CRYP_InitStruct)
Initializes the CRYP peripheral according to the specified parameters in the CRYP_InitStruct.
void CRYP_KeyInit(CRYP_KeyInitTypeDef *CRYP_KeyInitStruct)
Initializes the CRYP Keys according to the specified parameters in the CRYP_KeyInitStruct.
void CRYP_PhaseConfig(uint32_t CRYP_Phase)
Configures the AES-CCM and AES-GCM phases.
#define RCC_AHB2Periph_CRYP
CRYP Init structure definition.