diff mbox series

[v2,2/5] sha1: Fix digest state size/type

Message ID 1654107991-598-3-git-send-email-loic.poulain@linaro.org
State Accepted
Commit 4e883522bad7f1fed4ce0e35d26080fe29a972a5
Headers show
Series Add ARMv8 CE sha1/sha256 support | expand

Commit Message

Loic Poulain June 1, 2022, 6:26 p.m. UTC
sha1 digest size is 5*32-bit => 160-bit. Using 64-bit unsigned long
does not cause issue with the current sha1 implementation, but could
be problematic for vectorized access.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
---
 include/u-boot/sha1.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tom Rini June 27, 2022, 9:31 p.m. UTC | #1
On Wed, Jun 01, 2022 at 08:26:28PM +0200, Loic Poulain wrote:

> sha1 digest size is 5*32-bit => 160-bit. Using 64-bit unsigned long
> does not cause issue with the current sha1 implementation, but could
> be problematic for vectorized access.
> 
> Signed-off-by: Loic Poulain <loic.poulain@linaro.org>

Applied to u-boot/next, thanks!
diff mbox series

Patch

diff --git a/include/u-boot/sha1.h b/include/u-boot/sha1.h
index 283f103..09fee59 100644
--- a/include/u-boot/sha1.h
+++ b/include/u-boot/sha1.h
@@ -30,7 +30,7 @@  extern const uint8_t sha1_der_prefix[];
 typedef struct
 {
     unsigned long total[2];	/*!< number of bytes processed	*/
-    unsigned long state[5];	/*!< intermediate digest state	*/
+    uint32_t state[5];		/*!< intermediate digest state	*/
     unsigned char buffer[64];	/*!< data block being processed */
 }
 sha1_context;