62 #define TDESBUSY_TIMEOUT ((uint32_t) 0x00010000) 101 uint32_t Ilength, uint8_t *Output)
105 __IO uint32_t counter = 0;
106 uint32_t busystatus = 0;
108 uint32_t keyaddr = (uint32_t)Key;
109 uint32_t inputaddr = (uint32_t)Input;
110 uint32_t outputaddr = (uint32_t)Output;
131 TDES_CRYP_KeyInitStructure.
CRYP_Key1Left = __REV(*(uint32_t*)(keyaddr));
133 TDES_CRYP_KeyInitStructure.
CRYP_Key1Right= __REV(*(uint32_t*)(keyaddr));
135 TDES_CRYP_KeyInitStructure.
CRYP_Key2Left = __REV(*(uint32_t*)(keyaddr));
137 TDES_CRYP_KeyInitStructure.
CRYP_Key2Right= __REV(*(uint32_t*)(keyaddr));
139 TDES_CRYP_KeyInitStructure.
CRYP_Key3Left = __REV(*(uint32_t*)(keyaddr));
141 TDES_CRYP_KeyInitStructure.
CRYP_Key3Right= __REV(*(uint32_t*)(keyaddr));
156 for(i=0; ((i<Ilength) && (status !=
ERROR)); i+=8)
172 if (busystatus !=
RESET)
209 uint8_t *Input, uint32_t Ilength, uint8_t *Output)
214 __IO uint32_t counter = 0;
215 uint32_t busystatus = 0;
217 uint32_t keyaddr = (uint32_t)Key;
218 uint32_t inputaddr = (uint32_t)Input;
219 uint32_t outputaddr = (uint32_t)Output;
220 uint32_t ivaddr = (uint32_t)InitVectors;
241 TDES_CRYP_KeyInitStructure.
CRYP_Key1Left = __REV(*(uint32_t*)(keyaddr));
243 TDES_CRYP_KeyInitStructure.
CRYP_Key1Right= __REV(*(uint32_t*)(keyaddr));
245 TDES_CRYP_KeyInitStructure.
CRYP_Key2Left = __REV(*(uint32_t*)(keyaddr));
247 TDES_CRYP_KeyInitStructure.
CRYP_Key2Right= __REV(*(uint32_t*)(keyaddr));
249 TDES_CRYP_KeyInitStructure.
CRYP_Key3Left = __REV(*(uint32_t*)(keyaddr));
251 TDES_CRYP_KeyInitStructure.
CRYP_Key3Right= __REV(*(uint32_t*)(keyaddr));
255 TDES_CRYP_IVInitStructure.
CRYP_IV0Left = __REV(*(uint32_t*)(ivaddr));
257 TDES_CRYP_IVInitStructure.
CRYP_IV0Right= __REV(*(uint32_t*)(ivaddr));
273 for(i=0; ((i<Ilength) && (status !=
ERROR)); i+=8)
289 if (busystatus !=
RESET)
#define CRYP_AlgoMode_TDES_ECB
#define CRYP_AlgoDir_Decrypt
ErrorStatus CRYP_TDES_CBC(uint8_t Mode, uint8_t Key[24], uint8_t InitVectors[8], uint8_t *Input, uint32_t Ilength, uint8_t *Output)
Encrypt and decrypt using TDES in CBC Mode.
void CRYP_Init(CRYP_InitTypeDef *CRYP_InitStruct)
Initializes the CRYP peripheral according to the specified parameters in the CRYP_InitStruct.
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
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.
#define CRYP_AlgoMode_TDES_CBC
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...
ErrorStatus CRYP_TDES_ECB(uint8_t Mode, uint8_t Key[24], uint8_t *Input, uint32_t Ilength, uint8_t *Output)
Encrypt and decrypt using TDES in ECB Mode.
CRYP Init structure definition.