Skip to main content
GMaud
Associate II
Aug 11, 2023 12:19 PM UTC
Question

What clocks/HW blocks are required for Cryptolib AES to work in STM32WL?

Hi ST fanboys,

 

I am using the STM32WL55 device and have implemented the latest cryptolib (4.1).

This is all working fine with correct AES encryption and decryption, up to the moment that I start implementing the low power features and switch of all unused clocks and blocks. At that point the cryptolib features stop working.

Sadly the Cryptolib documentation (what is available when looking hard) does not specify what hardware features of the STM32WL device are used ie. what clocks, what HW blocks???

Can somebody point these out so I can activate those blocks when I come out of standby/stop mode and so that I can turn them off again when going into standby/stop mode.

Features used in Crypto are TRNG, AES_CBC, AES-CTR

 

thanks in advance

This topic has been closed for replies.

3 replies

Jocelyn RICARD
ST Employee
Aug 22, 2023 6:10 PM UTC

Hello @GMaud,

Normally, only HW block used by Cryptolib is the CRC. So, you need basically to enable CRC clock.

This is a way to ensure cryptolib is run on STM32.

Best regards

Jocelyn

GMaud
GMaudAuthor
Associate II
Aug 30, 2023 11:24 AM UTC

Hi Jocelyn, indeed, I found that the CRC is used by the cryptolib. I also use the CRC HW for other parts in my code so there was a conflict causing incorrect decypher -> solved by reset of the CRC on each operation.

Now the only blocking item left is the True Random Number Generator in the STM32WL. This worked fine without the cryptolib but when I use the TRNG in combination crypto it works before going into sleep/stop, but when resuming operation the TRNG hangs. Any guidance how to init/deinit the RNG hardware block or what the cryptolib is doing with that HW block?

 

Jocelyn RICARD
ST Employee
Sep 13, 2023 1:13 PM UTC

Hello @GMaud ,

when going to STOP mode, all clocks are stopped.

After wakeup you need to setup the clocks again and setup the clock to TRNG peripheral.

Best regards

Jocelyn