cancel
Showing results for 
Search instead for 
Did you mean: 

Hardware Crypto support for mbedTLS on STM32F7

Mario Luzeiro
Senior

I found from this question, on May 2017,

https://community.st.com/s/question/0D50X00009XkXqzSAF/why-mbedtls-which-is-part-of-stcube-116-release-does-not-contain-hw-acceleration-code

that hardware crypto support was in development for mbedTLS.

When we will get an update with this implemented?

4 REPLIES 4

You can find the implemented functions under the mbed-os tree's mbedtls "feature":

https://github.com/ARMmbed/mbed-os/tree/master/features/mbedtls/targets/TARGET_STM

Mario Luzeiro
Senior

Thanks for let me know! I was checking it but it was developed by an older HAL driver version (no longer supported) :\ New HAL driver does not have legacy support.

thierry BINIGUER
Associate III

HI,

As it was said in this discussion, a ST HW crypto implementation is available on Arm mbed OS but it is done on HAL crypto legacy.

In parallel, F7 came with a HAL (V1.2.7) supporting a new HAL Crypto API because of driver improvement.

How to drive this new HAL crypto API is given in this example : Firmware\Projects\STM32756G_EVAL\Examples\CRYP\CRYP_AESModes

Note  most of the code from Arm mbed OS can also be reused. A proposition is given (see attached file) with this new API, as example.

As usual, you must configure Mbed TLS (use MBEDTLS_AES_ALT) and HAL (use HAL_CRYP_MODULE_ENABLED).

Regards.

Thierry

Mario Luzeiro
Senior

Hi Thierry, thanks for the files!

I managed to build it but I had to reduce some of support features as they are not all implemented on this AES,

also, I cannot get it pass the AES tests from mbedTLS, when I run the test file I got:

 AES-ECB-128 (dec): passed

 AES-ECB-128 (enc): passed

 AES-ECB-192 (dec): passed

 AES-ECB-192 (enc): passed

 AES-ECB-256 (dec): passed

 AES-ECB-256 (enc): passed

 AES-CBC-128 (dec): passed

 AES-CBC-128 (enc): failed

Do you have also the implementation for other features if you can share? md5 and sha256 ?