update to CubeMX 6.14.0, FW_H7 1.12.1
This commit is contained in:
@ -272,10 +272,10 @@
|
||||
*/
|
||||
static void HASH_DMAXferCplt(DMA_HandleTypeDef *hdma);
|
||||
static void HASH_DMAError(DMA_HandleTypeDef *hdma);
|
||||
static void HASH_GetDigest(uint8_t *pMsgDigest, uint8_t Size);
|
||||
static void HASH_GetDigest(const uint8_t *pMsgDigest, uint8_t Size);
|
||||
static HAL_StatusTypeDef HASH_WaitOnFlagUntilTimeout(HASH_HandleTypeDef *hhash, uint32_t Flag, FlagStatus Status,
|
||||
uint32_t Timeout);
|
||||
static HAL_StatusTypeDef HASH_WriteData(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
|
||||
static HAL_StatusTypeDef HASH_WriteData(HASH_HandleTypeDef *hhash, const uint8_t *const pInBuffer, uint32_t Size);
|
||||
static HAL_StatusTypeDef HASH_IT(HASH_HandleTypeDef *hhash);
|
||||
static uint32_t HASH_Write_Block_Data(HASH_HandleTypeDef *hhash);
|
||||
static HAL_StatusTypeDef HMAC_Processing(HASH_HandleTypeDef *hhash, uint32_t Timeout);
|
||||
@ -764,7 +764,8 @@ HAL_StatusTypeDef HAL_HASH_UnRegisterCallback(HASH_HandleTypeDef *hhash, HAL_HAS
|
||||
* @param Timeout Timeout value
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_HASH_MD5_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer,
|
||||
HAL_StatusTypeDef HAL_HASH_MD5_Start(HASH_HandleTypeDef *hhash, const uint8_t *const pInBuffer, uint32_t Size,
|
||||
uint8_t *pOutBuffer,
|
||||
uint32_t Timeout)
|
||||
{
|
||||
return HASH_Start(hhash, pInBuffer, Size, pOutBuffer, Timeout, HASH_ALGOSELECTION_MD5);
|
||||
@ -790,7 +791,7 @@ HAL_StatusTypeDef HAL_HASH_MD5_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuff
|
||||
* @param Size length of the input buffer in bytes, must be a multiple of 4.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_HASH_MD5_Accmlt(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
|
||||
HAL_StatusTypeDef HAL_HASH_MD5_Accmlt(HASH_HandleTypeDef *hhash, const uint8_t *const pInBuffer, uint32_t Size)
|
||||
{
|
||||
return HASH_Accumulate(hhash, pInBuffer, Size, HASH_ALGOSELECTION_MD5);
|
||||
}
|
||||
@ -805,7 +806,7 @@ HAL_StatusTypeDef HAL_HASH_MD5_Accmlt(HASH_HandleTypeDef *hhash, uint8_t *pInBuf
|
||||
* @param Timeout Timeout value
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_HASH_MD5_Accmlt_End(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size,
|
||||
HAL_StatusTypeDef HAL_HASH_MD5_Accmlt_End(HASH_HandleTypeDef *hhash, const uint8_t *const pInBuffer, uint32_t Size,
|
||||
uint8_t *pOutBuffer, uint32_t Timeout)
|
||||
{
|
||||
return HASH_Start(hhash, pInBuffer, Size, pOutBuffer, Timeout, HASH_ALGOSELECTION_MD5);
|
||||
@ -822,7 +823,8 @@ HAL_StatusTypeDef HAL_HASH_MD5_Accmlt_End(HASH_HandleTypeDef *hhash, uint8_t *pI
|
||||
* @param Timeout Timeout value
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_HASH_SHA1_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer,
|
||||
HAL_StatusTypeDef HAL_HASH_SHA1_Start(HASH_HandleTypeDef *hhash, const uint8_t *const pInBuffer, uint32_t Size,
|
||||
uint8_t *pOutBuffer,
|
||||
uint32_t Timeout)
|
||||
{
|
||||
return HASH_Start(hhash, pInBuffer, Size, pOutBuffer, Timeout, HASH_ALGOSELECTION_SHA1);
|
||||
@ -848,7 +850,7 @@ HAL_StatusTypeDef HAL_HASH_SHA1_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuf
|
||||
* @param Size length of the input buffer in bytes, must be a multiple of 4.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_HASH_SHA1_Accmlt(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
|
||||
HAL_StatusTypeDef HAL_HASH_SHA1_Accmlt(HASH_HandleTypeDef *hhash, const uint8_t *const pInBuffer, uint32_t Size)
|
||||
{
|
||||
return HASH_Accumulate(hhash, pInBuffer, Size, HASH_ALGOSELECTION_SHA1);
|
||||
}
|
||||
@ -863,7 +865,7 @@ HAL_StatusTypeDef HAL_HASH_SHA1_Accmlt(HASH_HandleTypeDef *hhash, uint8_t *pInBu
|
||||
* @param Timeout Timeout value
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_HASH_SHA1_Accmlt_End(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size,
|
||||
HAL_StatusTypeDef HAL_HASH_SHA1_Accmlt_End(HASH_HandleTypeDef *hhash, const uint8_t *const pInBuffer, uint32_t Size,
|
||||
uint8_t *pOutBuffer, uint32_t Timeout)
|
||||
{
|
||||
return HASH_Start(hhash, pInBuffer, Size, pOutBuffer, Timeout, HASH_ALGOSELECTION_SHA1);
|
||||
@ -911,7 +913,7 @@ HAL_StatusTypeDef HAL_HASH_SHA1_Accmlt_End(HASH_HandleTypeDef *hhash, uint8_t *p
|
||||
* @param pOutBuffer pointer to the computed digest. Digest size is 16 bytes.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_HASH_MD5_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size,
|
||||
HAL_StatusTypeDef HAL_HASH_MD5_Start_IT(HASH_HandleTypeDef *hhash, const uint8_t *const pInBuffer, uint32_t Size,
|
||||
uint8_t *pOutBuffer)
|
||||
{
|
||||
return HASH_Start_IT(hhash, pInBuffer, Size, pOutBuffer, HASH_ALGOSELECTION_MD5);
|
||||
@ -935,7 +937,7 @@ HAL_StatusTypeDef HAL_HASH_MD5_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInB
|
||||
* @param Size length of the input buffer in bytes, must be a multiple of 4.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_HASH_MD5_Accmlt_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
|
||||
HAL_StatusTypeDef HAL_HASH_MD5_Accmlt_IT(HASH_HandleTypeDef *hhash, const uint8_t *const pInBuffer, uint32_t Size)
|
||||
{
|
||||
return HASH_Accumulate_IT(hhash, pInBuffer, Size, HASH_ALGOSELECTION_MD5);
|
||||
}
|
||||
@ -949,7 +951,7 @@ HAL_StatusTypeDef HAL_HASH_MD5_Accmlt_IT(HASH_HandleTypeDef *hhash, uint8_t *pIn
|
||||
* @param pOutBuffer pointer to the computed digest. Digest size is 16 bytes.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_HASH_MD5_Accmlt_End_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size,
|
||||
HAL_StatusTypeDef HAL_HASH_MD5_Accmlt_End_IT(HASH_HandleTypeDef *hhash, const uint8_t *const pInBuffer, uint32_t Size,
|
||||
uint8_t *pOutBuffer)
|
||||
{
|
||||
return HASH_Start_IT(hhash, pInBuffer, Size, pOutBuffer, HASH_ALGOSELECTION_MD5);
|
||||
@ -965,7 +967,7 @@ HAL_StatusTypeDef HAL_HASH_MD5_Accmlt_End_IT(HASH_HandleTypeDef *hhash, uint8_t
|
||||
* @param pOutBuffer pointer to the computed digest. Digest size is 20 bytes.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_HASH_SHA1_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size,
|
||||
HAL_StatusTypeDef HAL_HASH_SHA1_Start_IT(HASH_HandleTypeDef *hhash, const uint8_t *const pInBuffer, uint32_t Size,
|
||||
uint8_t *pOutBuffer)
|
||||
{
|
||||
return HASH_Start_IT(hhash, pInBuffer, Size, pOutBuffer, HASH_ALGOSELECTION_SHA1);
|
||||
@ -990,7 +992,7 @@ HAL_StatusTypeDef HAL_HASH_SHA1_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pIn
|
||||
* @param Size length of the input buffer in bytes, must be a multiple of 4.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_HASH_SHA1_Accmlt_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
|
||||
HAL_StatusTypeDef HAL_HASH_SHA1_Accmlt_IT(HASH_HandleTypeDef *hhash, const uint8_t *const pInBuffer, uint32_t Size)
|
||||
{
|
||||
return HASH_Accumulate_IT(hhash, pInBuffer, Size, HASH_ALGOSELECTION_SHA1);
|
||||
}
|
||||
@ -1004,7 +1006,7 @@ HAL_StatusTypeDef HAL_HASH_SHA1_Accmlt_IT(HASH_HandleTypeDef *hhash, uint8_t *pI
|
||||
* @param pOutBuffer pointer to the computed digest. Digest size is 20 bytes.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_HASH_SHA1_Accmlt_End_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size,
|
||||
HAL_StatusTypeDef HAL_HASH_SHA1_Accmlt_End_IT(HASH_HandleTypeDef *hhash, const uint8_t *const pInBuffer, uint32_t Size,
|
||||
uint8_t *pOutBuffer)
|
||||
{
|
||||
return HASH_Start_IT(hhash, pInBuffer, Size, pOutBuffer, HASH_ALGOSELECTION_SHA1);
|
||||
@ -1077,7 +1079,7 @@ void HAL_HASH_IRQHandler(HASH_HandleTypeDef *hhash)
|
||||
* @param Size length of the input buffer in bytes.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_HASH_MD5_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
|
||||
HAL_StatusTypeDef HAL_HASH_MD5_Start_DMA(HASH_HandleTypeDef *hhash, const uint8_t *const pInBuffer, uint32_t Size)
|
||||
{
|
||||
return HASH_Start_DMA(hhash, pInBuffer, Size, HASH_ALGOSELECTION_MD5);
|
||||
}
|
||||
@ -1107,7 +1109,7 @@ HAL_StatusTypeDef HAL_HASH_MD5_Finish(HASH_HandleTypeDef *hhash, uint8_t *pOutBu
|
||||
* @param Size length of the input buffer in bytes.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_HASH_SHA1_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
|
||||
HAL_StatusTypeDef HAL_HASH_SHA1_Start_DMA(HASH_HandleTypeDef *hhash, const uint8_t *const pInBuffer, uint32_t Size)
|
||||
{
|
||||
return HASH_Start_DMA(hhash, pInBuffer, Size, HASH_ALGOSELECTION_SHA1);
|
||||
}
|
||||
@ -1164,7 +1166,8 @@ HAL_StatusTypeDef HAL_HASH_SHA1_Finish(HASH_HandleTypeDef *hhash, uint8_t *pOutB
|
||||
* @param Timeout Timeout value.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_HMAC_MD5_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer,
|
||||
HAL_StatusTypeDef HAL_HMAC_MD5_Start(HASH_HandleTypeDef *hhash, const uint8_t *const pInBuffer, uint32_t Size,
|
||||
uint8_t *pOutBuffer,
|
||||
uint32_t Timeout)
|
||||
{
|
||||
return HMAC_Start(hhash, pInBuffer, Size, pOutBuffer, Timeout, HASH_ALGOSELECTION_MD5);
|
||||
@ -1183,7 +1186,8 @@ HAL_StatusTypeDef HAL_HMAC_MD5_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuff
|
||||
* @param Timeout Timeout value.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_HMAC_SHA1_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer,
|
||||
HAL_StatusTypeDef HAL_HMAC_SHA1_Start(HASH_HandleTypeDef *hhash, const uint8_t *const pInBuffer, uint32_t Size,
|
||||
uint8_t *pOutBuffer,
|
||||
uint32_t Timeout)
|
||||
{
|
||||
return HMAC_Start(hhash, pInBuffer, Size, pOutBuffer, Timeout, HASH_ALGOSELECTION_SHA1);
|
||||
@ -1225,7 +1229,7 @@ HAL_StatusTypeDef HAL_HMAC_SHA1_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuf
|
||||
* @param pOutBuffer pointer to the computed digest. Digest size is 16 bytes.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_HMAC_MD5_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size,
|
||||
HAL_StatusTypeDef HAL_HMAC_MD5_Start_IT(HASH_HandleTypeDef *hhash, const uint8_t *const pInBuffer, uint32_t Size,
|
||||
uint8_t *pOutBuffer)
|
||||
{
|
||||
return HMAC_Start_IT(hhash, pInBuffer, Size, pOutBuffer, HASH_ALGOSELECTION_MD5);
|
||||
@ -1243,7 +1247,7 @@ HAL_StatusTypeDef HAL_HMAC_MD5_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInB
|
||||
* @param pOutBuffer pointer to the computed digest. Digest size is 20 bytes.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_HMAC_SHA1_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size,
|
||||
HAL_StatusTypeDef HAL_HMAC_SHA1_Start_IT(HASH_HandleTypeDef *hhash, const uint8_t *const pInBuffer, uint32_t Size,
|
||||
uint8_t *pOutBuffer)
|
||||
{
|
||||
return HMAC_Start_IT(hhash, pInBuffer, Size, pOutBuffer, HASH_ALGOSELECTION_SHA1);
|
||||
@ -1254,7 +1258,6 @@ HAL_StatusTypeDef HAL_HMAC_SHA1_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pIn
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/** @defgroup HASH_Exported_Functions_Group7 HMAC processing functions in DMA mode
|
||||
* @brief HMAC processing functions using DMA modes.
|
||||
*
|
||||
@ -1297,7 +1300,7 @@ HAL_StatusTypeDef HAL_HMAC_SHA1_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pIn
|
||||
* @param Size length of the input buffer in bytes.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_HMAC_MD5_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
|
||||
HAL_StatusTypeDef HAL_HMAC_MD5_Start_DMA(HASH_HandleTypeDef *hhash, const uint8_t *const pInBuffer, uint32_t Size)
|
||||
{
|
||||
return HMAC_Start_DMA(hhash, pInBuffer, Size, HASH_ALGOSELECTION_MD5);
|
||||
}
|
||||
@ -1322,7 +1325,7 @@ HAL_StatusTypeDef HAL_HMAC_MD5_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pIn
|
||||
* @param Size length of the input buffer in bytes.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_HMAC_SHA1_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
|
||||
HAL_StatusTypeDef HAL_HMAC_SHA1_Start_DMA(HASH_HandleTypeDef *hhash, const uint8_t *const pInBuffer, uint32_t Size)
|
||||
{
|
||||
return HMAC_Start_DMA(hhash, pInBuffer, Size, HASH_ALGOSELECTION_SHA1);
|
||||
}
|
||||
@ -1369,7 +1372,7 @@ HAL_StatusTypeDef HAL_HMAC_SHA1_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pI
|
||||
* @param hhash HASH handle.
|
||||
* @retval HAL HASH state
|
||||
*/
|
||||
HAL_HASH_StateTypeDef HAL_HASH_GetState(HASH_HandleTypeDef *hhash)
|
||||
HAL_HASH_StateTypeDef HAL_HASH_GetState(const HASH_HandleTypeDef *hhash)
|
||||
{
|
||||
return hhash->State;
|
||||
}
|
||||
@ -1382,7 +1385,7 @@ HAL_HASH_StateTypeDef HAL_HASH_GetState(HASH_HandleTypeDef *hhash)
|
||||
* @param hhash HASH handle.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_HASH_GetStatus(HASH_HandleTypeDef *hhash)
|
||||
HAL_StatusTypeDef HAL_HASH_GetStatus(const HASH_HandleTypeDef *hhash)
|
||||
{
|
||||
return hhash->Status;
|
||||
}
|
||||
@ -1400,7 +1403,7 @@ HAL_StatusTypeDef HAL_HASH_GetStatus(HASH_HandleTypeDef *hhash)
|
||||
* must be at least (HASH_NUMBER_OF_CSR_REGISTERS + 3) * 4 uint8 long.
|
||||
* @retval None
|
||||
*/
|
||||
void HAL_HASH_ContextSaving(HASH_HandleTypeDef *hhash, uint8_t *pMemBuffer)
|
||||
void HAL_HASH_ContextSaving(const HASH_HandleTypeDef *hhash, const uint8_t *pMemBuffer)
|
||||
{
|
||||
uint32_t mem_ptr = (uint32_t)pMemBuffer;
|
||||
uint32_t csr_ptr = (uint32_t)HASH->CSR;
|
||||
@ -1441,7 +1444,7 @@ void HAL_HASH_ContextSaving(HASH_HandleTypeDef *hhash, uint8_t *pMemBuffer)
|
||||
* beforehand).
|
||||
* @retval None
|
||||
*/
|
||||
void HAL_HASH_ContextRestoring(HASH_HandleTypeDef *hhash, uint8_t *pMemBuffer)
|
||||
void HAL_HASH_ContextRestoring(HASH_HandleTypeDef *hhash, const uint8_t *pMemBuffer)
|
||||
{
|
||||
uint32_t mem_ptr = (uint32_t)pMemBuffer;
|
||||
uint32_t csr_ptr = (uint32_t)HASH->CSR;
|
||||
@ -1620,7 +1623,7 @@ HAL_StatusTypeDef HAL_HASH_DMAFeed_ProcessSuspend(HASH_HandleTypeDef *hhash)
|
||||
* @param hhash pointer to a HASH_HandleTypeDef structure.
|
||||
* @retval HASH Error Code
|
||||
*/
|
||||
uint32_t HAL_HASH_GetError(HASH_HandleTypeDef *hhash)
|
||||
uint32_t HAL_HASH_GetError(const HASH_HandleTypeDef *hhash)
|
||||
{
|
||||
/* Return HASH Error Code */
|
||||
return hhash->ErrorCode;
|
||||
@ -1821,7 +1824,7 @@ static void HASH_DMAError(DMA_HandleTypeDef *hdma)
|
||||
* suspension time is stored in the handle for resumption later on.
|
||||
* @retval HAL status
|
||||
*/
|
||||
static HAL_StatusTypeDef HASH_WriteData(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size)
|
||||
static HAL_StatusTypeDef HASH_WriteData(HASH_HandleTypeDef *hhash, const uint8_t *const pInBuffer, uint32_t Size)
|
||||
{
|
||||
uint32_t buffercounter;
|
||||
__IO uint32_t inputaddr = (uint32_t) pInBuffer;
|
||||
@ -1917,8 +1920,8 @@ static HAL_StatusTypeDef HASH_WriteData(HASH_HandleTypeDef *hhash, uint8_t *pInB
|
||||
if ((Size % 4U) == 3U)
|
||||
{
|
||||
tmp = *(uint8_t *)inputaddr;
|
||||
tmp |= (uint32_t)*(uint8_t *)(inputaddr + 1U) << 8U;
|
||||
tmp |= (uint32_t)*(uint8_t *)(inputaddr + 2U) << 16U;
|
||||
tmp |= (uint32_t) * (uint8_t *)(inputaddr + 1U) << 8U;
|
||||
tmp |= (uint32_t) * (uint8_t *)(inputaddr + 2U) << 16U;
|
||||
HASH->DIN = tmp;
|
||||
}
|
||||
|
||||
@ -1927,7 +1930,6 @@ static HAL_StatusTypeDef HASH_WriteData(HASH_HandleTypeDef *hhash, uint8_t *pInB
|
||||
{
|
||||
HASH->DIN = *(uint32_t *)inputaddr;
|
||||
}
|
||||
/*hhash->HashInCount += 4U;*/
|
||||
}
|
||||
|
||||
|
||||
@ -1940,7 +1942,7 @@ static HAL_StatusTypeDef HASH_WriteData(HASH_HandleTypeDef *hhash, uint8_t *pInB
|
||||
* @param Size message digest size in bytes.
|
||||
* @retval None
|
||||
*/
|
||||
static void HASH_GetDigest(uint8_t *pMsgDigest, uint8_t Size)
|
||||
static void HASH_GetDigest(const uint8_t *pMsgDigest, uint8_t Size)
|
||||
{
|
||||
uint32_t msgdigest = (uint32_t)pMsgDigest;
|
||||
|
||||
@ -2005,7 +2007,6 @@ static void HASH_GetDigest(uint8_t *pMsgDigest, uint8_t Size)
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief Handle HASH processing Timeout.
|
||||
* @param hhash HASH handle.
|
||||
@ -2491,10 +2492,11 @@ static HAL_StatusTypeDef HMAC_Processing(HASH_HandleTypeDef *hhash, uint32_t Tim
|
||||
* @param Algorithm HASH algorithm.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HASH_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer,
|
||||
HAL_StatusTypeDef HASH_Start(HASH_HandleTypeDef *hhash, const uint8_t *const pInBuffer, uint32_t Size,
|
||||
uint8_t *pOutBuffer,
|
||||
uint32_t Timeout, uint32_t Algorithm)
|
||||
{
|
||||
uint8_t *pInBuffer_tmp; /* input data address, input parameter of HASH_WriteData() */
|
||||
const uint8_t *pInBuffer_tmp; /* input data address, input parameter of HASH_WriteData() */
|
||||
uint32_t Size_tmp; /* input data size (in bytes), input parameter of HASH_WriteData() */
|
||||
HAL_HASH_StateTypeDef State_tmp = hhash->State;
|
||||
|
||||
@ -2526,7 +2528,7 @@ HAL_StatusTypeDef HASH_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint
|
||||
|
||||
/* pInBuffer_tmp and Size_tmp are initialized to be used afterwards as
|
||||
input parameters of HASH_WriteData() */
|
||||
pInBuffer_tmp = pInBuffer; /* pInBuffer_tmp is set to the input data address */
|
||||
pInBuffer_tmp = (const uint8_t *)pInBuffer; /* pInBuffer_tmp is set to the input data address */
|
||||
Size_tmp = Size; /* Size_tmp contains the input data size in bytes */
|
||||
|
||||
/* Set the phase */
|
||||
@ -2542,7 +2544,7 @@ HAL_StatusTypeDef HASH_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint
|
||||
/* Since this is resumption, pInBuffer_tmp and Size_tmp are not set
|
||||
to the API input parameters but to those saved beforehand by HASH_WriteData()
|
||||
when the processing was suspended */
|
||||
pInBuffer_tmp = hhash->pHashInBuffPtr;
|
||||
pInBuffer_tmp = (const uint8_t *)hhash->pHashInBuffPtr;
|
||||
Size_tmp = hhash->HashInCount;
|
||||
}
|
||||
/* ... or multi-buffer HASH processing end */
|
||||
@ -2550,7 +2552,7 @@ HAL_StatusTypeDef HASH_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint
|
||||
{
|
||||
/* pInBuffer_tmp and Size_tmp are initialized to be used afterwards as
|
||||
input parameters of HASH_WriteData() */
|
||||
pInBuffer_tmp = pInBuffer;
|
||||
pInBuffer_tmp = (const uint8_t *)pInBuffer;
|
||||
Size_tmp = Size;
|
||||
/* Configure the number of valid bits in last word of the message */
|
||||
__HAL_HASH_SET_NBVALIDBITS(Size);
|
||||
@ -2628,9 +2630,10 @@ HAL_StatusTypeDef HASH_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint
|
||||
* @param Algorithm HASH algorithm.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HASH_Accumulate(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint32_t Algorithm)
|
||||
HAL_StatusTypeDef HASH_Accumulate(HASH_HandleTypeDef *hhash, const uint8_t *const pInBuffer, uint32_t Size,
|
||||
uint32_t Algorithm)
|
||||
{
|
||||
uint8_t *pInBuffer_tmp; /* input data address, input parameter of HASH_WriteData() */
|
||||
const uint8_t *pInBuffer_tmp; /* input data address, input parameter of HASH_WriteData() */
|
||||
uint32_t Size_tmp; /* input data size (in bytes), input parameter of HASH_WriteData() */
|
||||
HAL_HASH_StateTypeDef State_tmp = hhash->State;
|
||||
|
||||
@ -2662,7 +2665,7 @@ HAL_StatusTypeDef HASH_Accumulate(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer,
|
||||
/* Since this is resumption, pInBuffer_tmp and Size_tmp are not set
|
||||
to the API input parameters but to those saved beforehand by HASH_WriteData()
|
||||
when the processing was suspended */
|
||||
pInBuffer_tmp = hhash->pHashInBuffPtr; /* pInBuffer_tmp is set to the input data address */
|
||||
pInBuffer_tmp = (const uint8_t *)hhash->pHashInBuffPtr; /* pInBuffer_tmp is set to the input data address */
|
||||
Size_tmp = hhash->HashInCount; /* Size_tmp contains the input data size in bytes */
|
||||
|
||||
}
|
||||
@ -2673,7 +2676,7 @@ HAL_StatusTypeDef HASH_Accumulate(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer,
|
||||
|
||||
/* pInBuffer_tmp and Size_tmp are initialized to be used afterwards as
|
||||
input parameters of HASH_WriteData() */
|
||||
pInBuffer_tmp = pInBuffer; /* pInBuffer_tmp is set to the input data address */
|
||||
pInBuffer_tmp = (const uint8_t *)pInBuffer; /* pInBuffer_tmp is set to the input data address */
|
||||
Size_tmp = Size; /* Size_tmp contains the input data size in bytes */
|
||||
|
||||
/* Check if initialization phase has already be performed */
|
||||
@ -2731,7 +2734,8 @@ HAL_StatusTypeDef HASH_Accumulate(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer,
|
||||
* @param Algorithm HASH algorithm.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HASH_Accumulate_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint32_t Algorithm)
|
||||
HAL_StatusTypeDef HASH_Accumulate_IT(HASH_HandleTypeDef *hhash, const uint8_t *const pInBuffer, uint32_t Size,
|
||||
uint32_t Algorithm)
|
||||
{
|
||||
HAL_HASH_StateTypeDef State_tmp = hhash->State;
|
||||
__IO uint32_t inputaddr = (uint32_t) pInBuffer;
|
||||
@ -2841,7 +2845,6 @@ HAL_StatusTypeDef HASH_Accumulate_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuff
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief Initialize the HASH peripheral, next process pInBuffer then
|
||||
* read the computed digest in interruption mode.
|
||||
@ -2853,7 +2856,8 @@ HAL_StatusTypeDef HASH_Accumulate_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuff
|
||||
* @param Algorithm HASH algorithm.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HASH_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer,
|
||||
HAL_StatusTypeDef HASH_Start_IT(HASH_HandleTypeDef *hhash, const uint8_t *const pInBuffer, uint32_t Size,
|
||||
uint8_t *pOutBuffer,
|
||||
uint32_t Algorithm)
|
||||
{
|
||||
HAL_HASH_StateTypeDef State_tmp = hhash->State;
|
||||
@ -2902,6 +2906,19 @@ HAL_StatusTypeDef HASH_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, u
|
||||
|
||||
hhash->pHashOutBuffPtr = pOutBuffer; /* Points at the computed digest */
|
||||
}
|
||||
else if ((hhash->Phase == HAL_HASH_PHASE_PROCESS) && (SizeVar < 4U))
|
||||
{
|
||||
if (__HAL_HASH_GET_FLAG(HASH_FLAG_DINIS))
|
||||
{
|
||||
/* It remains data to enter and the Peripheral is ready to trigger DINIE,carry on as usual.
|
||||
Update HashInCount and pHashInBuffPtr accordingly. */
|
||||
hhash->HashInCount = SizeVar;
|
||||
hhash->pHashInBuffPtr = (uint8_t *)inputaddr;
|
||||
/* Update the configuration of the number of valid bits in last word of the message */
|
||||
__HAL_HASH_SET_NBVALIDBITS(SizeVar);
|
||||
hhash->pHashOutBuffPtr = pOutBuffer; /* Points at the computed digest */
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
initialization_skipped = 1; /* info user later on in case of multi-buffer */
|
||||
@ -3011,18 +3028,19 @@ HAL_StatusTypeDef HASH_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, u
|
||||
* @param Algorithm HASH algorithm.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HASH_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint32_t Algorithm)
|
||||
HAL_StatusTypeDef HASH_Start_DMA(HASH_HandleTypeDef *hhash, const uint8_t *const pInBuffer, uint32_t Size,
|
||||
uint32_t Algorithm)
|
||||
{
|
||||
uint32_t inputaddr;
|
||||
uint32_t inputSize;
|
||||
HAL_StatusTypeDef status ;
|
||||
HAL_HASH_StateTypeDef State_tmp = hhash->State;
|
||||
|
||||
|
||||
|
||||
/* Make sure the input buffer size (in bytes) is a multiple of 4 when MDMAT bit is set
|
||||
(case of multi-buffer HASH processing) */
|
||||
assert_param(IS_HASH_DMA_MULTIBUFFER_SIZE(Size));
|
||||
|
||||
|
||||
/* If State is ready or suspended, start or resume polling-based HASH processing */
|
||||
if ((State_tmp == HAL_HASH_STATE_READY) || (State_tmp == HAL_HASH_STATE_SUSPENDED))
|
||||
{
|
||||
@ -3188,7 +3206,8 @@ HAL_StatusTypeDef HASH_Finish(HASH_HandleTypeDef *hhash, uint8_t *pOutBuffer, ui
|
||||
* @param Algorithm HASH algorithm.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HMAC_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer,
|
||||
HAL_StatusTypeDef HMAC_Start(HASH_HandleTypeDef *hhash, const uint8_t *const pInBuffer, uint32_t Size,
|
||||
uint8_t *pOutBuffer,
|
||||
uint32_t Timeout, uint32_t Algorithm)
|
||||
{
|
||||
HAL_HASH_StateTypeDef State_tmp = hhash->State;
|
||||
@ -3252,7 +3271,6 @@ HAL_StatusTypeDef HMAC_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief Initialize the HASH peripheral in HMAC mode, next process pInBuffer then
|
||||
* read the computed digest in interruption mode.
|
||||
@ -3266,7 +3284,8 @@ HAL_StatusTypeDef HMAC_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint
|
||||
* @param Algorithm HASH algorithm.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HMAC_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t *pOutBuffer,
|
||||
HAL_StatusTypeDef HMAC_Start_IT(HASH_HandleTypeDef *hhash, const uint8_t *const pInBuffer, uint32_t Size,
|
||||
uint8_t *pOutBuffer,
|
||||
uint32_t Algorithm)
|
||||
{
|
||||
HAL_HASH_StateTypeDef State_tmp = hhash->State;
|
||||
@ -3361,7 +3380,6 @@ HAL_StatusTypeDef HMAC_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, u
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief Initialize the HASH peripheral in HMAC mode then initiate the required
|
||||
* DMA transfers to feed the key and the input buffer to the Peripheral.
|
||||
@ -3377,7 +3395,8 @@ HAL_StatusTypeDef HMAC_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, u
|
||||
* @param Algorithm HASH algorithm.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HMAC_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint32_t Algorithm)
|
||||
HAL_StatusTypeDef HMAC_Start_DMA(HASH_HandleTypeDef *hhash, const uint8_t *const pInBuffer, uint32_t Size,
|
||||
uint32_t Algorithm)
|
||||
{
|
||||
uint32_t inputaddr;
|
||||
uint32_t inputSize;
|
||||
|
||||
Reference in New Issue
Block a user