Merge pull request #9778 from LinuxJedi/exp-fixes

Fixes to big-endian bugs found in Curve448 and Blake2S
This commit is contained in:
David Garske
2026-02-16 14:30:47 -08:00
committed by GitHub
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -365,7 +365,7 @@ int blake2s_final( blake2s_state *S, byte *out, byte outlen )
}
for( i = 0; i < 8; ++i ) /* Output full hash to temp buffer */
store64( buffer + sizeof( S->h[i] ) * i, S->h[i] );
store32( buffer + sizeof( S->h[i] ) * i, S->h[i] );
XMEMCPY( out, buffer, outlen );
+2 -2
View File
@@ -409,12 +409,12 @@ int wc_curve448_check_public(const byte* pub, word32 pubSz, int endian)
return ECC_BAD_ARG_E;
}
if ((i == 27) && (pub[i] == 0xfe)) {
for (++i; i < CURVE448_PUB_KEY_SIZE - 1; i--) {
for (++i; i < CURVE448_PUB_KEY_SIZE - 1; i++) {
if (pub[i] != 0xff) {
break;
}
}
if ((i == CURVE448_PUB_KEY_SIZE) && (pub[i] >= 0xfe)) {
if ((i == CURVE448_PUB_KEY_SIZE - 1) && (pub[i] >= 0xfe)) {
return ECC_BAD_ARG_E;
}
}