STM32F2 Standard Peripheral bibliotheek  1.0
ST Microelectronics bibliotheek documentatie voor de STM32F2 Standard Peripheral Library
 All Data Structures Files Functions Variables Enumerations Enumerator Groups
stm32f2xx_cryp.h File Reference

This file contains all the functions prototypes for the Cryptographic processor(CRYP) firmware library. More...

#include "stm32f2xx.h"

Go to the source code of this file.

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...
 

Macros

#define CRYP_AlgoDir_Encrypt   ((uint16_t)0x0000)
 
#define CRYP_AlgoDir_Decrypt   ((uint16_t)0x0004)
 
#define IS_CRYP_ALGODIR(ALGODIR)
 
#define CRYP_AlgoMode_TDES_ECB   ((uint16_t)0x0000)
 
#define CRYP_AlgoMode_TDES_CBC   ((uint16_t)0x0008)
 
#define CRYP_AlgoMode_DES_ECB   ((uint16_t)0x0010)
 
#define CRYP_AlgoMode_DES_CBC   ((uint16_t)0x0018)
 
#define CRYP_AlgoMode_AES_ECB   ((uint16_t)0x0020)
 
#define CRYP_AlgoMode_AES_CBC   ((uint16_t)0x0028)
 
#define CRYP_AlgoMode_AES_CTR   ((uint16_t)0x0030)
 
#define CRYP_AlgoMode_AES_Key   ((uint16_t)0x0038)
 
#define IS_CRYP_ALGOMODE(ALGOMODE)
 
#define CRYP_DataType_32b   ((uint16_t)0x0000)
 
#define CRYP_DataType_16b   ((uint16_t)0x0040)
 
#define CRYP_DataType_8b   ((uint16_t)0x0080)
 
#define CRYP_DataType_1b   ((uint16_t)0x00C0)
 
#define IS_CRYP_DATATYPE(DATATYPE)
 
#define CRYP_KeySize_128b   ((uint16_t)0x0000)
 
#define CRYP_KeySize_192b   ((uint16_t)0x0100)
 
#define CRYP_KeySize_256b   ((uint16_t)0x0200)
 
#define IS_CRYP_KEYSIZE(KEYSIZE)
 
#define CRYP_FLAG_BUSY   ((uint8_t)0x10)
 
#define CRYP_FLAG_IFEM   ((uint8_t)0x01)
 
#define CRYP_FLAG_IFNF   ((uint8_t)0x02)
 
#define CRYP_FLAG_INRIS   ((uint8_t)0x22)
 
#define CRYP_FLAG_OFNE   ((uint8_t)0x04)
 
#define CRYP_FLAG_OFFU   ((uint8_t)0x08)
 
#define CRYP_FLAG_OUTRIS   ((uint8_t)0x21)
 
#define IS_CRYP_GET_FLAG(FLAG)
 
#define CRYP_IT_INI   ((uint8_t)0x01)
 
#define CRYP_IT_OUTI   ((uint8_t)0x02)
 
#define IS_CRYP_CONFIG_IT(IT)   ((((IT) & (uint8_t)0xFC) == 0x00) && ((IT) != 0x00))
 
#define IS_CRYP_GET_IT(IT)   (((IT) == CRYP_IT_INI) || ((IT) == CRYP_IT_OUTI))
 
#define MODE_ENCRYPT   ((uint8_t)0x01)
 
#define MODE_DECRYPT   ((uint8_t)0x00)
 
#define CRYP_DMAReq_DataIN   ((uint8_t)0x01)
 
#define CRYP_DMAReq_DataOUT   ((uint8_t)0x02)
 
#define IS_CRYP_DMAREQ(DMAREQ)   ((((DMAREQ) & (uint8_t)0xFC) == 0x00) && ((DMAREQ) != 0x00))
 

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...
 

Detailed Description

This file contains all the functions prototypes for the Cryptographic processor(CRYP) firmware library.

Author
MCD Application Team
Version
V1.1.2
Date
05-March-2012
Attention

© COPYRIGHT 2012 STMicroelectronics

Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); You may not use this file except in compliance with the License. You may obtain a copy of the License at:

   http://www.st.com/software_license_agreement_liberty_v2

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.