diff options
author | Shelly Liberman <shelly.liberman@arm.com> | 2021-01-24 11:22:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-24 11:22:23 +0200 |
commit | f63b2283f2fa98f2a0e65e7530535ae8a4224f66 (patch) | |
tree | fdf24003a31934c9aa103e1a6661cf2fff366e8d | |
parent | ae7bf2c05e6daf542e98ae779bbe22305b676638 (diff) | |
parent | ada61f05b370f588c06371c4977be0267a800ce4 (diff) | |
download | mbedtls-archive/baremetal.zip mbedtls-archive/baremetal.tar.gz mbedtls-archive/baremetal.tar.bz2 |
Merge pull request #4053 from TeroJaasko/baremetal_aes_masking_speeduparchive/baremetal
Baremetal aes masking speedup
-rw-r--r-- | library/aes.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/library/aes.c b/library/aes.c index 50f9702..72cfc10 100644 --- a/library/aes.c +++ b/library/aes.c @@ -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], |