mirror of
https://github.com/yuzu-mirror/mbedtls.git
synced 2026-04-20 22:05:15 +00:00
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:
parent
9df2b416b9
commit
fba5921186
10 changed files with 202 additions and 8 deletions
|
|
@ -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 )
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue