HAL RNG Abstraction missing?

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
spatialerror
Posts: 1
Joined: Sat Jul 13, 2013 2:46 pm

HAL RNG Abstraction missing?

Post by spatialerror »

I browsed through the code looking for an uniform way to get random numbers from HWRNG or a SWPRNG ^^ doesnt look like thats implemented but it would be nice to have at least on the STM407 an easy way for accessing the TRNG

would be a minimal modification of the api i guess to add it
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: HAL RNG Abstraction missing?

Post by Giovanni »

Hi,

This feature is very STM32F4-specific but it could be added as a platform-specific driver. Thanks for the hint.

Giovanni
faisal
Posts: 382
Joined: Wed Jul 19, 2017 12:44 am
Has thanked: 45 times
Been thanked: 62 times

Re: HAL RNG Abstraction missing?

Post by faisal »

How do you feel on about having a standard TRNG HAL driver, now that SAMA5D2x also has a TRNG?
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: HAL RNG Abstraction missing?

Post by Giovanni »

Hi,

It is in the crypto HAL driver in 18.2.0, currently the STM32 implementation is missing, it could be added.

Giovanni
podhrmic
Posts: 21
Joined: Wed Nov 06, 2013 1:40 am

Re: HAL RNG Abstraction missing?

Post by podhrmic »

Hi,

I noticed the crypto hal driver is implemented only for STM32F7. Are you planning to implement (at least the RNG) for STM32F4?

Regards
M
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: HAL RNG Abstraction missing?

Post by Giovanni »

Hi,

Now there is a new TRNG driver in HAL (trunk version), the functionality will be removed from crypto. It should work on F4 but have not tested it on all platforms.

There is a demo under /testhal/STM32/multi/TRNG.

Giovanni
podhrmic
Posts: 21
Joined: Wed Nov 06, 2013 1:40 am

Re: HAL RNG Abstraction missing?

Post by podhrmic »

Hi Giovanni, thanks for the info.
Post Reply