cancel
Showing results for 
Search instead for 
Did you mean: 

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

GMaud
Associate II

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

3 REPLIES 3
Jocelyn RICARD
ST Employee

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
Associate II

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

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