urbanze wrote:Well... Sucess!! Before, I put only "mbedtls\include\mbedtls\aes.h". Now, I tried put more one "mbedtls\library\aes.c" and WORKED!
I'm glad you got this working. Can you explain exactly what you needed to change?
See both libraries: https://i.imgur.com/d3liT0L.png
However, with HWCrypto only, takes ~129uS. MbedTLS with Acell ON takes ~150uS.... List bellow show my tests.
That doesn't seem right. With the code you posted mbedtls_aes_crypt_ecb() is remapped via macro directly to your comparison function esp_aes_crypt_ecb(). So they should be the exact same function when acceleration is enabled.
See here: https://github.com/espressif/esp-idf/bl ... _alt.h#L39
You may need to run a lot more than 4 iterations to even out small differences and "jitter" due to interrupts, task switching, etc.
Well angus, problems! LOL.
1-) "Can you explain exactly what you needed to change?"
-I need to include this both libraries :
Without aes.c, doesn't work. Error: Undefined reference to all functions of mbed.
2-) I made some test and benchmark's with 4 and 250 encryptations 128bits. The results were surprising and inverse, see:
2.1-) HWCrypto and 4 encrypts. Total time: 125uS
2.2-) HWCrypto and 250 encrypts. Total time: 6519uS
2.3-) MbedTLS and 4 encrypts. Total time: 143uS
2.4-) MbedTLS and 250 encrypts. Total time: 4164uS
Strangely, as you said, they are both identical. The results with 250 encryptions were quite different, can you explain why?
Another thing, explain to me why they put "mode" inside the encryption function
, for example:
esp_aes_crypt_ecb(ctx, MODE, input, output);
If the function already says it is encryption, it is necessary to put "AES_ENCRYPT". Unlike the decryption function, you do not need to enter the mode.