mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-24 01:35:46 +00:00
Merge remote-tracking branch 'origin/pr/2582' into development
* origin/pr/2582: Call mbedtls_cipher_free() to reset a cipher context Don't call mbedtls_cipher_setkey twice
This commit is contained in:
commit
5c7915b0ed
|
@ -1011,6 +1011,20 @@ void auth_crypt_tv( int cipher_id, data_t * key, data_t * iv,
|
||||||
TEST_ASSERT( memcmp( output, clear->x, clear->len ) == 0 );
|
TEST_ASSERT( memcmp( output, clear->x, clear->len ) == 0 );
|
||||||
|
|
||||||
/* then encrypt the clear->x and make sure we get the same ciphertext and tag->x */
|
/* then encrypt the clear->x and make sure we get the same ciphertext and tag->x */
|
||||||
|
mbedtls_cipher_free( &ctx );
|
||||||
|
#if defined(MBEDTLS_USE_PSA_CRYPTO)
|
||||||
|
if( use_psa == 1 )
|
||||||
|
{
|
||||||
|
TEST_ASSERT( 0 == mbedtls_cipher_setup_psa( &ctx,
|
||||||
|
mbedtls_cipher_info_from_type( cipher_id ),
|
||||||
|
tag->len ) );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
TEST_ASSERT( 0 == mbedtls_cipher_setup( &ctx,
|
||||||
|
mbedtls_cipher_info_from_type( cipher_id ) ) );
|
||||||
|
}
|
||||||
TEST_ASSERT( 0 == mbedtls_cipher_setkey( &ctx, key->x, 8 * key->len,
|
TEST_ASSERT( 0 == mbedtls_cipher_setkey( &ctx, key->x, 8 * key->len,
|
||||||
MBEDTLS_ENCRYPT ) );
|
MBEDTLS_ENCRYPT ) );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue