mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-11 14:15:39 +00:00
Simplify some buffer comparisons in tests
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
70edd689a8
commit
a2971ea62c
|
@ -1251,10 +1251,7 @@ void auth_crypt_tv( int cipher_id, data_t * key, data_t * iv,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TEST_ASSERT( ret == 0 );
|
TEST_ASSERT( ret == 0 );
|
||||||
|
ASSERT_COMPARE( decrypt_buf, outlen, clear->x, clear->len );
|
||||||
TEST_ASSERT( outlen == clear->len );
|
|
||||||
if( clear->len != 0 )
|
|
||||||
TEST_ASSERT( memcmp( decrypt_buf, clear->x, clear->len ) == 0 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Free this, but keep cipher_plus_tag for deprecated function with PSA */
|
/* Free this, but keep cipher_plus_tag for deprecated function with PSA */
|
||||||
|
@ -1376,9 +1373,7 @@ void auth_crypt_tv( int cipher_id, data_t * key, data_t * iv,
|
||||||
{
|
{
|
||||||
/* authentic message: is the plaintext correct? */
|
/* authentic message: is the plaintext correct? */
|
||||||
TEST_ASSERT( ret == 0 );
|
TEST_ASSERT( ret == 0 );
|
||||||
|
ASSERT_COMPARE( decrypt_buf, outlen, clear->x, clear->len );
|
||||||
TEST_ASSERT( outlen == clear->len );
|
|
||||||
TEST_ASSERT( memcmp( decrypt_buf, clear->x, clear->len ) == 0 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mbedtls_free( decrypt_buf );
|
mbedtls_free( decrypt_buf );
|
||||||
|
|
Loading…
Reference in a new issue