Merge pull request #4053 from TeroJaasko/baremetal_aes_masking_speedup

Baremetal aes masking speedup
This commit is contained in:
Shelly Liberman 2021-01-24 11:22:23 +02:00 committed by GitHub
commit f63b2283f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1421,9 +1421,9 @@ int mbedtls_internal_aes_encrypt( mbedtls_aes_context *ctx,
uint8_t round_ctrl_table[( 14 + AES_SCA_CM_ROUNDS + 2 )];
#if defined MBEDTLS_AES_128_BIT_MASKED
uint32_t rk_masked[MBEDTLS_AES_128_EXPANDED_KEY_SIZE_IN_WORDS] = {0};
uint8_t sbox_masked[256] = {0};
uint32_t mask[10] = {0};
uint32_t rk_masked[MBEDTLS_AES_128_EXPANDED_KEY_SIZE_IN_WORDS];
uint8_t sbox_masked[256];
uint32_t mask[10];
#endif
#if defined(MBEDTLS_VALIDATE_AES_KEYS_INTEGRITY)
@ -1560,8 +1560,6 @@ int mbedtls_internal_aes_encrypt( mbedtls_aes_context *ctx,
{
flow_control++;
}
//Cleanup the masked key
mbedtls_platform_memset( rk_masked, 0, sizeof(rk_masked) );
#else
aes_fround_final( aes_data_ptr->rk_ptr,
&aes_data_ptr->xy_values[0],