mbedtls_aes_crypt_ecb VS mbed_internal_aes_encrypt ESP32

skxo66
Posts: 6
Joined: Wed Oct 18, 2017 6:26 am

mbedtls_aes_crypt_ecb VS mbed_internal_aes_encrypt ESP32

Postby skxo66 » Thu Apr 18, 2019 6:57 am

Hello,

I am using these two functions in two different firmware to create AES-ECB function on ESP32.
- What are the difference please (in the context of ESP32 of course)?
- Which one use the HW aes core of the EPS32?
- Is one of them deprecated?

thanks!
sk

esp_Hemal
Posts: 8
Joined: Thu Feb 14, 2019 9:44 am

Re: mbedtls_aes_crypt_ecb VS mbed_internal_aes_encrypt ESP32

Postby esp_Hemal » Thu Apr 18, 2019 10:18 am

Hi sk,

mbedtls_aes_crypt_ecb() function accepts mode (encrypt/decrypt) as one of the arguments so it can do both. Whereas mbedtls_internal_aes_encrypt() performs only encryption. Later one gets called from previous if the mode is selected as 'encrypt'. If AES HW acceleration is enabled (through menuconfig option) mbedtls_internal_aes_encrypt() would perform single block AES encryption using aes hardware

As per mbedtls documentation none of these are deprecated.

https://tls.mbed.org/api/aes_8h.html#ad ... b0d018be35

Rather mbedtls_internal_aes_encrypt() is superseded by mbedtls_aes_encrypt() and mbedtls_internal_aes_decrypt() is superseded by mbedtls_aes_decrypt()

skxo66
Posts: 6
Joined: Wed Oct 18, 2017 6:26 am

Re: mbedtls_aes_crypt_ecb VS mbed_internal_aes_encrypt ESP32

Postby skxo66 » Sat Apr 20, 2019 6:52 am

Hi esp_Hemal,

thanks for your detailed answer.

Regards
sk

Who is online

Users browsing this forum: selec1 and 138 guests