aes: validate keys using crc before encryption/decryption

CRC is calculated when the key is set. This commit also adds new tests
for ecb encryption and decryption, simulating a fault injection after the key is set.
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
This commit is contained in:
Andrzej Kurek 2020-08-07 21:02:25 -04:00
parent 9df2b416b9
commit fba5921186
No known key found for this signature in database
GPG key ID: 89A90840DC388527
10 changed files with 202 additions and 8 deletions

View file

@ -1874,6 +1874,14 @@ int query_config( const char *config )
}
#endif /* MBEDTLS_CRC_C */
#if defined(MBEDTLS_VALIDATE_AES_KEYS_INTEGRITY)
if( strcmp( "MBEDTLS_VALIDATE_AES_KEYS_INTEGRITY", config ) == 0 )
{
MACRO_EXPANSION_TO_STR( MBEDTLS_VALIDATE_AES_KEYS_INTEGRITY );
return( 0 );
}
#endif /* MBEDTLS_VALIDATE_AES_KEYS_INTEGRITY */
#if defined(MBEDTLS_GCM_C)
if( strcmp( "MBEDTLS_GCM_C", config ) == 0 )
{