mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-08-19 09:43:24 +02:00
Merge pull request #10917 from MarkAtwood/fix/slhdsa-base2b-shift-ub
fix: signed-shift UB in SLH-DSA base_2b digest accumulator
This commit is contained in:
@@ -1722,7 +1722,10 @@ static void slhdsakey_base_2b(const byte* x, byte b, byte outLen, word16* baseb)
|
||||
int j;
|
||||
int i = 0;
|
||||
int bits = 0;
|
||||
int total = 0;
|
||||
/* total accumulates unmasked via << 8 and must be unsigned: a signed
|
||||
* type overflows from the 4th consumed byte (UB). High bits are
|
||||
* discarded by mask, so the output is unaffected. */
|
||||
word32 total = 0;
|
||||
word16 mask = (word16)((1 << b) - 1);
|
||||
|
||||
for (j = 0; j < outLen; j++) {
|
||||
|
||||
Reference in New Issue
Block a user