mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-05 17:40:50 +02:00
Merge pull request #9778 from LinuxJedi/exp-fixes
Fixes to big-endian bugs found in Curve448 and Blake2S
This commit is contained in:
@@ -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 );
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user