Fix: Handle endianness in SHA1 block expansion

Addresses a potential endianness issue in the SHA1 block expansion logic, using `#ifdef WORDS_BIGENDIAN` to ensure correct data access regardless of platform.
This commit is contained in:
njohnson 2025-09-10 21:55:11 -04:00
parent bc3cc77a0a
commit 15399a2969

View File

@ -94,7 +94,6 @@ void SHA1_Transform(uint32_t state[5], const uint8_t buffer[64]);
/* blk0() and blk() perform the initial expand. */ /* blk0() and blk() perform the initial expand. */
/* I got the idea of expanding during the round function from SSLeay */ /* I got the idea of expanding during the round function from SSLeay */
/* FIXME: can we do this in an endian-proof way? */
#ifdef WORDS_BIGENDIAN #ifdef WORDS_BIGENDIAN
#define blk0(i) block->l[i] #define blk0(i) block->l[i]
#else #else