cancel
Showing results for 
Search instead for 
Did you mean: 

X-CUBE-CRYPTOLIB AES-CCM optimization

Guillaume FERLIN
Associate II
Posted on January 26, 2018 at 09:27

Hi,

I'm using AES CCM algorithm from X-CUBE-CRYPTOLIB (STM32AccHwCryptoV3.1.0_L4_KEIL_otslsm1elfspf.lib) in sensitive real time system and unfortunelaty it does not fit our time requirement. We would like to investigate the possibility to optimize AES CCM encryption/decryption for our application. Is there possibility to:

- Get custom API for AES CCM (especially one API to change nonce only)

- Get library sources

Thanks,

Guillaume

#x-cube-cryptolib #aes-ccm
2 REPLIES 2
Posted on January 26, 2018 at 11:56

X-CUBE-CRYPTOLIB's source code isn't available to the users so I doubt you could do anything (and I don't think reverse engineering it is worth the time).

You can try to use an open source library to be free to modify/optimize the code. For example,

https://tls.mbed.org/

has a nice and hackable AES-CCM implementation.

If your microcontroller has hardware cryptography support then the version of mbedTLS shipped with STM32Cube libraries (i.e. /STM32Cube_FW_F4_V1.19.0/Middlewares/Third_Party/mbedTLS) claims (in st_readme.txt) to have STM32 crypto acceleration support (added by ST), though I wasn't able verify it.

Posted on January 26, 2018 at 14:07

So don't use the CRYPTOLIB and program the hardware directly, and understand the limit/flows with that.

STM32Cube_FW_L4_V1.8.0\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_cryp.c

STM32Cube_FW_L4_V1.8.0\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_cryp_ex.c

\STM32Cube_FW_L4_V1.8.0\Projects\STM32L496ZG-Nucleo\Examples\CRYP\CRYP_AESModes\readme.txt

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..