62 #define DESBUSY_TIMEOUT ((uint32_t) 0x00010000) 100 uint32_t Ilength, uint8_t *Output)
104 __IO uint32_t counter = 0;
105 uint32_t busystatus = 0;
107 uint32_t keyaddr = (uint32_t)Key;
108 uint32_t inputaddr = (uint32_t)Input;
109 uint32_t outputaddr = (uint32_t)Output;
130 DES_CRYP_KeyInitStructure.
CRYP_Key1Left = __REV(*(uint32_t*)(keyaddr));
132 DES_CRYP_KeyInitStructure.
CRYP_Key1Right= __REV(*(uint32_t*)(keyaddr));
147 for(i=0; ((i<Ilength) && (status !=
ERROR)); i+=8)
164 if (busystatus !=
RESET)
201 uint8_t *Input, uint32_t Ilength, uint8_t *Output)
206 __IO uint32_t counter = 0;
207 uint32_t busystatus = 0;
209 uint32_t keyaddr = (uint32_t)Key;
210 uint32_t inputaddr = (uint32_t)Input;
211 uint32_t outputaddr = (uint32_t)Output;
212 uint32_t ivaddr = (uint32_t)InitVectors;
233 DES_CRYP_KeyInitStructure.
CRYP_Key1Left = __REV(*(uint32_t*)(keyaddr));
235 DES_CRYP_KeyInitStructure.
CRYP_Key1Right= __REV(*(uint32_t*)(keyaddr));
239 DES_CRYP_IVInitStructure.
CRYP_IV0Left = __REV(*(uint32_t*)(ivaddr));
241 DES_CRYP_IVInitStructure.
CRYP_IV0Right= __REV(*(uint32_t*)(ivaddr));
256 for(i=0; ((i<Ilength) && (status !=
ERROR)); i+=8)
272 if (busystatus !=
RESET)
ErrorStatus CRYP_DES_CBC(uint8_t Mode, uint8_t Key[8], uint8_t InitVectors[8], uint8_t *Input, uint32_t Ilength, uint8_t *Output)
Encrypt and decrypt using DES in CBC Mode.
#define CRYP_AlgoMode_DES_ECB
#define CRYP_AlgoDir_Decrypt
void CRYP_Init(CRYP_InitTypeDef *CRYP_InitStruct)
Initializes the CRYP peripheral according to the specified parameters in the CRYP_InitStruct.
#define CRYP_AlgoMode_DES_CBC
void CRYP_FIFOFlush(void)
Flushes the IN and OUT FIFOs (that is read and write pointers of the FIFOs are reset) ...
static volatile uint8_t * status
ErrorStatus CRYP_DES_ECB(uint8_t Mode, uint8_t Key[8], uint8_t *Input, uint32_t Ilength, uint8_t *Output)
Encrypt and decrypt using DES in ECB Mode.
uint32_t CRYP_DataOut(void)
Returns the last data entered into the output FIFO.
#define CRYP_AlgoDir_Encrypt
FlagStatus CRYP_GetFlagStatus(uint8_t CRYP_FLAG)
Checks whether the specified CRYP flag is set or not.
void CRYP_DataIn(uint32_t Data)
Writes data in the Data Input register (DIN).
FunctionalState CRYP_GetCmdStatus(void)
Returns whether CRYP peripheral is enabled or disabled.
CRYP Key(s) structure definition.
This file contains all the functions prototypes for the Cryptographic processor(CRYP) firmware librar...
void CRYP_Cmd(FunctionalState NewState)
Enables or disables the CRYP peripheral.
void CRYP_KeyInit(CRYP_KeyInitTypeDef *CRYP_KeyInitStruct)
Initializes the CRYP Keys according to the specified parameters in the CRYP_KeyInitStruct.
CRYP Initialization Vectors (IV) structure definition.
void CRYP_KeyStructInit(CRYP_KeyInitTypeDef *CRYP_KeyInitStruct)
Fills each CRYP_KeyInitStruct member with its default value.
void CRYP_IVInit(CRYP_IVInitTypeDef *CRYP_IVInitStruct)
Initializes the CRYP Initialization Vectors(IV) according to the specified parameters in the CRYP_IVI...
CRYP Init structure definition.