1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-18 04:18:10 +00:00

fix(crypto): Fix incorrect handling of empty input in blake256_Update().

This commit is contained in:
Andrew Kozlik 2021-04-21 11:52:32 +02:00 committed by Martin Milata
parent 52c34c7364
commit b2cc3bcb36

View File

@ -169,9 +169,8 @@ void blake256_Update( BLAKE256_CTX *S, const uint8_t *in, size_t inlen )
{ {
memcpy( ( void * ) ( S->buf + left ), \ memcpy( ( void * ) ( S->buf + left ), \
( void * ) in, ( size_t ) inlen ); ( void * ) in, ( size_t ) inlen );
S->buflen = left + ( int )inlen;
} }
else S->buflen = 0; S->buflen = left + inlen;
} }