crypto-algorithms
crypto-algorithms copied to clipboard
Fix undefined behaviour in SHA-256 byte-loading by casting to WORD be…
Clang’s UndefinedBehaviorSanitizer reports:
runtime error: left shift of 255 by 24 places cannot be represented in type 'int'
Because each data byte (0–255) is promoted to a signed int before shifting, `255 << 24` overflows a 32-bit signed range.
Cast input bytes to WORD before shifting to prevent signed-integer overflow UB.