Does X-CUBE-CRYPTOLIB support hardware acceleration?
Hi,
I've been exploring cryptography support on the STM32 uCs, especially on the L4 series. I'm able to run the X-CUBE-CRYPTOLIB code to perform AES-GCM, but it's very slow. It takes roughly 4ms to encrypt and tag 80 bytes, with a master clock of 8MHz.
From looking at the debugger, it seems like the AES hardware peripheral is not being used, so it makes sense it's performing so poorly. I couldn't find any define in the .h files to configure it to use hardware support and I'm seeing conflicting statements from differents pieces of documentation.
The Reference Manual for the L4 family states that "The AES peripheral provides hardware acceleration to AES cryptographic algorithms packaged in STM32 cryptographic library.".
This version of the library documentation (from 2015) states that: "For dedicated devices some algorithms are supported with hardware acceleration, to optimize the performance and the footprint usage"
However, the more recent version states that: "To benefit from STM32 cryptographic accelerators, refer to the STM32Cube MCU and MPU package hardware abstraction layer (HAL) functions and examples."
So it would seem like it was supported at some point, but then it was dropped and the reference manual failed to update that claim. However, it makes no sense to me. Why drop support for such a useful feature. I understand the HAL may be as good or even better, but having the same library with different backends is always easier to maintain across many products. Especially if you're already including the X-CUBE-CRYPTOLIB to have ECDH (which the HAL doesn't have).
Anyway, most of this is conjecture on my part, I may be entirely wrong. Does the X-CUBE-CRYPTOLIB support hardware acceleration? Can it use the AES peripheral for AES-GCM?
Thank you!
