Commit 662c1f5c authored by Lionel Debieve's avatar Lionel Debieve Committed by Yann Gautier
Browse files

crypto: stm32_hash: fix issue when restarting computation



While restarting a new hash computation, STR register
is not cleared. It needs to be written before each
computation.

Change-Id: If65902dd21f9c139ec5da3ca87721232f73710db
Signed-off-by: default avatarLionel Debieve <lionel.debieve@st.com>
Signed-off-by: default avatarYann Gautier <yann.gautier@st.com>
parent da9a837c
/* /*
* Copyright (c) 2019, STMicroelectronics - All Rights Reserved * Copyright (c) 2019-2020, STMicroelectronics - All Rights Reserved
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -252,6 +252,8 @@ int stm32_hash_final(uint8_t *digest) ...@@ -252,6 +252,8 @@ int stm32_hash_final(uint8_t *digest)
mmio_clrsetbits_32(hash_base() + HASH_STR, HASH_STR_NBLW_MASK, mmio_clrsetbits_32(hash_base() + HASH_STR, HASH_STR_NBLW_MASK,
8U * stm32_remain.length); 8U * stm32_remain.length);
zeromem(&stm32_remain, sizeof(stm32_remain)); zeromem(&stm32_remain, sizeof(stm32_remain));
} else {
mmio_clrbits_32(hash_base() + HASH_STR, HASH_STR_NBLW_MASK);
} }
mmio_setbits_32(hash_base() + HASH_STR, HASH_STR_DCAL); mmio_setbits_32(hash_base() + HASH_STR, HASH_STR_DCAL);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment