Skip to content

Commit d81bb72

Browse files
authored
Merge pull request #9778 from LinuxJedi/exp-fixes
Fixes to big-endian bugs found in Curve448 and Blake2S
2 parents 36a28ac + 451cb45 commit d81bb72

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

wolfcrypt/src/blake2s.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ int blake2s_final( blake2s_state *S, byte *out, byte outlen )
365365
}
366366

367367
for( i = 0; i < 8; ++i ) /* Output full hash to temp buffer */
368-
store64( buffer + sizeof( S->h[i] ) * i, S->h[i] );
368+
store32( buffer + sizeof( S->h[i] ) * i, S->h[i] );
369369

370370
XMEMCPY( out, buffer, outlen );
371371

wolfcrypt/src/curve448.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,12 +409,12 @@ int wc_curve448_check_public(const byte* pub, word32 pubSz, int endian)
409409
return ECC_BAD_ARG_E;
410410
}
411411
if ((i == 27) && (pub[i] == 0xfe)) {
412-
for (++i; i < CURVE448_PUB_KEY_SIZE - 1; i--) {
412+
for (++i; i < CURVE448_PUB_KEY_SIZE - 1; i++) {
413413
if (pub[i] != 0xff) {
414414
break;
415415
}
416416
}
417-
if ((i == CURVE448_PUB_KEY_SIZE) && (pub[i] >= 0xfe)) {
417+
if ((i == CURVE448_PUB_KEY_SIZE - 1) && (pub[i] >= 0xfe)) {
418418
return ECC_BAD_ARG_E;
419419
}
420420
}

0 commit comments

Comments
 (0)