cancel
Showing results for 
Search instead for 
Did you mean: 

Is the AES peripheral on the STM32L4xx MCUs able to handle key sizes larger than 32 bytes? Is there a list of elliptic curves that will work with a 32 byte key?

stonato labs
Associate

It seems that 32 bytes (256 bits) is the maximum key size. If so, is there a list of elliptic curves that will work with keys of this size?

3 REPLIES 3
Jocelyn RICARD
ST Employee

Hello @stonato labs​ ,

I'm not sure to get your point. AES is a normalised symmetric crypto algorithm that does not define any key larger than 256 bits. So, answer is no, the AES peripheral cannot handle keys larger than 32 bytes.

Regarding elliptic curve, this is another story.

First STM32L4 has no dedicated public key accelerator.

So, to use ECC, you need to use software cryptography.

You can have a look to the X-CUBE-CRYPTOLIB that we propose for STM32.

Documentation can be found here:

https://wiki.st.com/stm32mcu/wiki/Category:Cryptographic_library

Best regards

Jocelyn

stonato labs
Associate

Thank you for your answer, Jocelyn.

I had suspected the key was always 256 bits or smaller, but I am still new to AES and learning.

Regarding the XCUBE Cryptolib: I believe I have this installed (it is in a "Middlewares" folder in my project). Is the wiki the main source of implementation info for this library? The only documentation I was able to find was a databrief.

Jocelyn RICARD
ST Employee

Hello @stonato labs​,

In the STM32L4 Cube you will get the driver code for hardware accelerated AES, but no crypto library.

You can get crypto library here

The wiki documentation refers to this cryptolib V4

If you have already cryptolib in your middleware, reason maybe you are talking about X-CUBE-SBSFU package. If this is the case, this one includes old version V3.1 of cryptolib.

In this case, documentation for this old version can be found here

Last point, if you are new to crypto, I advice having a look some material we provide.

1) STM32Trust page is the entry point

2) Then you have the Security Learning Journey

3) And more precisely the Basics of cryptography

I hope this will help

Best regards

Jocelyn