STM32F4 Standard Peripheral bibliotheek
1.0
ST Microelectronics bibliotheek documentatie voor de STM32F4 Standard Peripheral Library
|
CRYP driver modules. More...
Modules | |
CRYP_Exported_Constants | |
CRYP_Private_Functions | |
Data Structures | |
struct | CRYP_InitTypeDef |
CRYP Init structure definition. More... | |
struct | CRYP_KeyInitTypeDef |
CRYP Key(s) structure definition. More... | |
struct | CRYP_IVInitTypeDef |
CRYP Initialization Vectors (IV) structure definition. More... | |
struct | CRYP_Context |
CRYP context swapping structure definition. More... | |
Functions | |
void | CRYP_DeInit (void) |
Deinitializes the CRYP peripheral registers to their default reset values. More... | |
void | CRYP_Init (CRYP_InitTypeDef *CRYP_InitStruct) |
Initializes the CRYP peripheral according to the specified parameters in the CRYP_InitStruct. More... | |
void | CRYP_StructInit (CRYP_InitTypeDef *CRYP_InitStruct) |
Fills each CRYP_InitStruct member with its default value. More... | |
void | CRYP_KeyInit (CRYP_KeyInitTypeDef *CRYP_KeyInitStruct) |
Initializes the CRYP Keys according to the specified parameters in the CRYP_KeyInitStruct. More... | |
void | CRYP_KeyStructInit (CRYP_KeyInitTypeDef *CRYP_KeyInitStruct) |
Fills each CRYP_KeyInitStruct member with its default value. More... | |
void | CRYP_IVInit (CRYP_IVInitTypeDef *CRYP_IVInitStruct) |
Initializes the CRYP Initialization Vectors(IV) according to the specified parameters in the CRYP_IVInitStruct. More... | |
void | CRYP_IVStructInit (CRYP_IVInitTypeDef *CRYP_IVInitStruct) |
Fills each CRYP_IVInitStruct member with its default value. More... | |
void | CRYP_Cmd (FunctionalState NewState) |
Enables or disables the CRYP peripheral. More... | |
void | CRYP_DataIn (uint32_t Data) |
Writes data in the Data Input register (DIN). More... | |
uint32_t | CRYP_DataOut (void) |
Returns the last data entered into the output FIFO. More... | |
void | CRYP_FIFOFlush (void) |
Flushes the IN and OUT FIFOs (that is read and write pointers of the FIFOs are reset) More... | |
ErrorStatus | CRYP_SaveContext (CRYP_Context *CRYP_ContextSave, CRYP_KeyInitTypeDef *CRYP_KeyInitStruct) |
Saves the CRYP peripheral Context. More... | |
void | CRYP_RestoreContext (CRYP_Context *CRYP_ContextRestore) |
Restores the CRYP peripheral Context. More... | |
void | CRYP_DMACmd (uint8_t CRYP_DMAReq, FunctionalState NewState) |
Enables or disables the CRYP DMA interface. More... | |
void | CRYP_ITConfig (uint8_t CRYP_IT, FunctionalState NewState) |
Enables or disables the specified CRYP interrupts. More... | |
ITStatus | CRYP_GetITStatus (uint8_t CRYP_IT) |
Checks whether the specified CRYP interrupt has occurred or not. More... | |
FlagStatus | CRYP_GetFlagStatus (uint8_t CRYP_FLAG) |
Checks whether the specified CRYP flag is set or not. More... | |
ErrorStatus | CRYP_AES_ECB (uint8_t Mode, uint8_t *Key, uint16_t Keysize, uint8_t *Input, uint32_t Ilength, uint8_t *Output) |
Encrypt and decrypt using AES in ECB Mode. More... | |
ErrorStatus | CRYP_AES_CBC (uint8_t Mode, uint8_t InitVectors[16], uint8_t *Key, uint16_t Keysize, uint8_t *Input, uint32_t Ilength, uint8_t *Output) |
Encrypt and decrypt using AES in CBC Mode. More... | |
ErrorStatus | CRYP_AES_CTR (uint8_t Mode, uint8_t InitVectors[16], uint8_t *Key, uint16_t Keysize, uint8_t *Input, uint32_t Ilength, uint8_t *Output) |
Encrypt and decrypt using AES in CTR Mode. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
CRYP driver modules.
ErrorStatus CRYP_AES_CBC | ( | uint8_t | Mode, |
uint8_t | InitVectors[16], | ||
uint8_t * | Key, | ||
uint16_t | Keysize, | ||
uint8_t * | Input, | ||
uint32_t | Ilength, | ||
uint8_t * | Output | ||
) |
Encrypt and decrypt using AES in CBC Mode.
Mode,: | encryption or decryption Mode. This parameter can be one of the following values:
|
InitVectors,: | Initialisation Vectors used for AES algorithm. |
Key,: | Key used for AES algorithm. |
Keysize,: | length of the Key, must be a 128, 192 or 256. |
Input,: | pointer to the Input buffer. |
Ilength,: | length of the Input buffer, must be a multiple of 16. |
Output,: | pointer to the returned buffer. |
An | ErrorStatus enumeration value:
|
ErrorStatus CRYP_AES_CTR | ( | uint8_t | Mode, |
uint8_t | InitVectors[16], | ||
uint8_t * | Key, | ||
uint16_t | Keysize, | ||
uint8_t * | Input, | ||
uint32_t | Ilength, | ||
uint8_t * | Output | ||
) |
Encrypt and decrypt using AES in CTR Mode.
Mode,: | encryption or decryption Mode. This parameter can be one of the following values:
|
InitVectors,: | Initialisation Vectors used for AES algorithm. |
Key,: | Key used for AES algorithm. |
Keysize,: | length of the Key, must be a 128, 192 or 256. |
Input,: | pointer to the Input buffer. |
Ilength,: | length of the Input buffer, must be a multiple of 16. |
Output,: | pointer to the returned buffer. |
An | ErrorStatus enumeration value:
|
ErrorStatus CRYP_AES_ECB | ( | uint8_t | Mode, |
uint8_t * | Key, | ||
uint16_t | Keysize, | ||
uint8_t * | Input, | ||
uint32_t | Ilength, | ||
uint8_t * | Output | ||
) |
Encrypt and decrypt using AES in ECB Mode.
Mode,: | encryption or decryption Mode. This parameter can be one of the following values:
|
Key,: | Key used for AES algorithm. |
Keysize,: | length of the Key, must be a 128, 192 or 256. |
Input,: | pointer to the Input buffer. |
Ilength,: | length of the Input buffer, must be a multiple of 16. |
Output,: | pointer to the returned buffer. |
An | ErrorStatus enumeration value:
|
void CRYP_Cmd | ( | FunctionalState | NewState | ) |
Enables or disables the CRYP peripheral.
NewState,: | new state of the CRYP peripheral. This parameter can be: ENABLE or DISABLE. |
None |
void CRYP_DataIn | ( | uint32_t | Data | ) |
Writes data in the Data Input register (DIN).
Data,: | data to write in Data Input register |
None |
uint32_t CRYP_DataOut | ( | void | ) |
Returns the last data entered into the output FIFO.
None |
Last | data entered into the output FIFO. |
void CRYP_DeInit | ( | void | ) |
Deinitializes the CRYP peripheral registers to their default reset values.
None |
None |
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.
Mode,: | encryption or decryption Mode. This parameter can be one of the following values:
|
Key,: | Key used for DES algorithm. |
InitVectors,: | Initialisation Vectors used for DES algorithm. |
Ilength,: | length of the Input buffer, must be a multiple of 8. |
Input,: | pointer to the Input buffer. |
Output,: | pointer to the returned buffer. |
An | ErrorStatus enumeration value:
|
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.
Mode,: | encryption or decryption Mode. This parameter can be one of the following values:
|
Key,: | Key used for DES algorithm. |
Ilength,: | length of the Input buffer, must be a multiple of 8. |
Input,: | pointer to the Input buffer. |
Output,: | pointer to the returned buffer. |
An | ErrorStatus enumeration value:
|
void CRYP_DMACmd | ( | uint8_t | CRYP_DMAReq, |
FunctionalState | NewState | ||
) |
Enables or disables the CRYP DMA interface.
CRYP_DMAReq,: | specifies the CRYP DMA transfer request to be enabled or disabled. This parameter can be any combination of the following values:
|
NewState,: | new state of the selected CRYP DMA transfer request. This parameter can be: ENABLE or DISABLE. |
None |
void CRYP_FIFOFlush | ( | void | ) |
Flushes the IN and OUT FIFOs (that is read and write pointers of the FIFOs are reset)
None |
None |
FlagStatus CRYP_GetFlagStatus | ( | uint8_t | CRYP_FLAG | ) |
Checks whether the specified CRYP flag is set or not.
CRYP_FLAG,: | specifies the CRYP flag to check. This parameter can be one of the following values:
|
The | new state of CRYP_FLAG (SET or RESET). |
ITStatus CRYP_GetITStatus | ( | uint8_t | CRYP_IT | ) |
Checks whether the specified CRYP interrupt has occurred or not.
CRYP_IT,: | specifies the CRYP (masked) interrupt source to check. This parameter can be one of the following values:
|
The | new state of CRYP_IT (SET or RESET). |
void CRYP_Init | ( | CRYP_InitTypeDef * | CRYP_InitStruct | ) |
Initializes the CRYP peripheral according to the specified parameters in the CRYP_InitStruct.
CRYP_InitStruct,: | pointer to a CRYP_InitTypeDef structure that contains the configuration information for the CRYP peripheral. |
None |
void CRYP_ITConfig | ( | uint8_t | CRYP_IT, |
FunctionalState | NewState | ||
) |
Enables or disables the specified CRYP interrupts.
CRYP_IT,: | specifies the CRYP interrupt source to be enabled or disabled. This parameter can be any combination of the following values:
|
NewState,: | new state of the specified CRYP interrupt. This parameter can be: ENABLE or DISABLE. |
None |
void CRYP_IVInit | ( | CRYP_IVInitTypeDef * | CRYP_IVInitStruct | ) |
Initializes the CRYP Initialization Vectors(IV) according to the specified parameters in the CRYP_IVInitStruct.
CRYP_IVInitStruct,: | pointer to a CRYP_IVInitTypeDef structure that contains the configuration information for the CRYP Initialization Vectors(IV). |
None |
void CRYP_IVStructInit | ( | CRYP_IVInitTypeDef * | CRYP_IVInitStruct | ) |
Fills each CRYP_IVInitStruct member with its default value.
CRYP_IVInitStruct,: | pointer to a CRYP_IVInitTypeDef Initialization Vectors(IV) structure which will be initialized. |
None |
void CRYP_KeyInit | ( | CRYP_KeyInitTypeDef * | CRYP_KeyInitStruct | ) |
Initializes the CRYP Keys according to the specified parameters in the CRYP_KeyInitStruct.
CRYP_KeyInitStruct,: | pointer to a CRYP_KeyInitTypeDef structure that contains the configuration information for the CRYP Keys. |
None |
void CRYP_KeyStructInit | ( | CRYP_KeyInitTypeDef * | CRYP_KeyInitStruct | ) |
Fills each CRYP_KeyInitStruct member with its default value.
CRYP_KeyInitStruct,: | pointer to a CRYP_KeyInitTypeDef structure which will be initialized. |
None |
void CRYP_RestoreContext | ( | CRYP_Context * | CRYP_ContextRestore | ) |
Restores the CRYP peripheral Context.
CRYP_ContextRestore,: | pointer to a CRYP_Context structure that contains the repository for saved context. |
None |
ErrorStatus CRYP_SaveContext | ( | CRYP_Context * | CRYP_ContextSave, |
CRYP_KeyInitTypeDef * | CRYP_KeyInitStruct | ||
) |
Saves the CRYP peripheral Context.
CRYP_ContextSave,: | pointer to a CRYP_Context structure that contains the repository for current context. |
CRYP_KeyInitStruct,: | pointer to a CRYP_KeyInitTypeDef structure that contains the configuration information for the CRYP Keys. |
None |
void CRYP_StructInit | ( | CRYP_InitTypeDef * | CRYP_InitStruct | ) |
Fills each CRYP_InitStruct member with its default value.
CRYP_InitStruct,: | pointer to a CRYP_InitTypeDef structure which will be initialized. |
None |
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.
Mode,: | encryption or decryption Mode. This parameter can be one of the following values:
|
Key,: | Key used for TDES algorithm. |
InitVectors,: | Initialisation Vectors used for TDES algorithm. |
Input,: | pointer to the Input buffer. |
Ilength,: | length of the Input buffer, must be a multiple of 8. |
Output,: | pointer to the returned buffer. |
An | ErrorStatus enumeration value:
|
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.
Mode,: | encryption or decryption Mode. This parameter can be one of the following values:
|
Key,: | Key used for TDES algorithm. |
Ilength,: | length of the Input buffer, must be a multiple of 8. |
Input,: | pointer to the Input buffer. |
Output,: | pointer to the returned buffer. |
An | ErrorStatus enumeration value:
|