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

This file contains all the functions prototypes for the HASH firmware library. More...

#include "stm32f4xx.h"

Go to the source code of this file.

Data Structures

struct  HASH_InitTypeDef
 HASH Init structure definition. More...
 
struct  HASH_MsgDigest
 HASH message digest result structure definition. More...
 
struct  HASH_Context
 HASH context swapping structure definition. More...
 

Macros

#define HASH_AlgoSelection_SHA1   ((uint16_t)0x0000)
 
#define HASH_AlgoSelection_MD5   ((uint16_t)0x0080)
 
#define IS_HASH_ALGOSELECTION(ALGOSELECTION)
 
#define HASH_AlgoMode_HASH   ((uint16_t)0x0000)
 
#define HASH_AlgoMode_HMAC   ((uint16_t)0x0040)
 
#define IS_HASH_ALGOMODE(ALGOMODE)
 
#define HASH_DataType_32b   ((uint16_t)0x0000)
 
#define HASH_DataType_16b   ((uint16_t)0x0010)
 
#define HASH_DataType_8b   ((uint16_t)0x0020)
 
#define HASH_DataType_1b   ((uint16_t)0x0030)
 
#define IS_HASH_DATATYPE(DATATYPE)
 
#define HASH_HMACKeyType_ShortKey   ((uint32_t)0x00000000)
 
#define HASH_HMACKeyType_LongKey   ((uint32_t)0x00010000)
 
#define IS_HASH_HMAC_KEYTYPE(KEYTYPE)
 
#define IS_HASH_VALIDBITSNUMBER(VALIDBITS)   ((VALIDBITS) <= 0x1F)
 
#define HASH_IT_DINI   ((uint8_t)0x01)
 
#define HASH_IT_DCI   ((uint8_t)0x02)
 
#define IS_HASH_IT(IT)   ((((IT) & (uint8_t)0xFC) == 0x00) && ((IT) != 0x00))
 
#define IS_HASH_GET_IT(IT)   (((IT) == HASH_IT_DINI) || ((IT) == HASH_IT_DCI))
 
#define HASH_FLAG_DINIS   ((uint16_t)0x0001)
 
#define HASH_FLAG_DCIS   ((uint16_t)0x0002)
 
#define HASH_FLAG_DMAS   ((uint16_t)0x0004)
 
#define HASH_FLAG_BUSY   ((uint16_t)0x0008)
 
#define HASH_FLAG_DINNE   ((uint16_t)0x1000)
 
#define IS_HASH_GET_FLAG(FLAG)
 
#define IS_HASH_CLEAR_FLAG(FLAG)
 

Functions

void HASH_DeInit (void)
 Deinitializes the HASH peripheral registers to their default reset values. More...
 
void HASH_Init (HASH_InitTypeDef *HASH_InitStruct)
 Initializes the HASH peripheral according to the specified parameters in the HASH_InitStruct structure. More...
 
void HASH_StructInit (HASH_InitTypeDef *HASH_InitStruct)
 Fills each HASH_InitStruct member with its default value. More...
 
void HASH_Reset (void)
 Resets the HASH processor core, so that the HASH will be ready to compute the message digest of a new message. More...
 
void HASH_DataIn (uint32_t Data)
 Writes data in the Data Input FIFO. More...
 
uint8_t HASH_GetInFIFOWordsNbr (void)
 Returns the number of words already pushed into the IN FIFO. More...
 
void HASH_SetLastWordValidBitsNbr (uint16_t ValidNumber)
 Configure the Number of valid bits in last word of the message. More...
 
void HASH_StartDigest (void)
 Starts the message padding and calculation of the final message. More...
 
void HASH_GetDigest (HASH_MsgDigest *HASH_MessageDigest)
 Provides the message digest result. More...
 
void HASH_SaveContext (HASH_Context *HASH_ContextSave)
 Save the Hash peripheral Context. More...
 
void HASH_RestoreContext (HASH_Context *HASH_ContextRestore)
 Restore the Hash peripheral Context. More...
 
void HASH_DMACmd (FunctionalState NewState)
 Enables or disables the HASH DMA interface. More...
 
void HASH_ITConfig (uint8_t HASH_IT, FunctionalState NewState)
 Enables or disables the specified HASH interrupts. More...
 
FlagStatus HASH_GetFlagStatus (uint16_t HASH_FLAG)
 Checks whether the specified HASH flag is set or not. More...
 
void HASH_ClearFlag (uint16_t HASH_FLAG)
 Clears the HASH flags. More...
 
ITStatus HASH_GetITStatus (uint8_t HASH_IT)
 Checks whether the specified HASH interrupt has occurred or not. More...
 
void HASH_ClearITPendingBit (uint8_t HASH_IT)
 Clears the HASH interrupt pending bit(s). More...
 
ErrorStatus HASH_SHA1 (uint8_t *Input, uint32_t Ilen, uint8_t Output[20])
 Compute the HASH SHA1 digest. More...
 
ErrorStatus HMAC_SHA1 (uint8_t *Key, uint32_t Keylen, uint8_t *Input, uint32_t Ilen, uint8_t Output[20])
 Compute the HMAC SHA1 digest. More...
 
ErrorStatus HASH_MD5 (uint8_t *Input, uint32_t Ilen, uint8_t Output[16])
 Compute the HASH MD5 digest. More...
 
ErrorStatus HMAC_MD5 (uint8_t *Key, uint32_t Keylen, uint8_t *Input, uint32_t Ilen, uint8_t Output[16])
 Compute the HMAC MD5 digest. More...
 

Detailed Description

This file contains all the functions prototypes for the HASH firmware library.

Author
MCD Application Team
Version
V1.0.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.