Skip to content

Commit 451cb45

Browse files
committed
Fix Blake2s overlapping writes
We are copying from a 32bit buffer, so are overlapping writes. This could cause damage the hash on big-endian platforms.
1 parent 180c66b commit 451cb45

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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

0 commit comments

Comments
 (0)