-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drivers/entropy: stm32: non-compliant RNG configuration on some MCUs #45866
Comments
In the configure_rng(), during the Init sequence, health_test_config and health_test_magic are set by the
However missing before and after LL_RNG_SetHealthConfig : |
Precisely! I expect to be able to lay hands next week on a B-U85I-IOT01 board that includes an RNG peripheral with RNG_HTCR register and CONFIGx fields. Therefore, if that's alright with you I can fix the issue next week. Otherwise, if you prefer, I should be able to do the PR earlier but in that case it would be preferable that someone ensures that the entropy driver is still working properly on real hardware |
That's the purpose of the #45994 |
In order to apply the RNG configuration for the NIST certification, the conditions are about the rng_clock source, the RNG_CR register to write and loop , then immediately writing the RNG_HTCR magic nb then immediately writing the RNG_HTCR config nb. |
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time. |
Describe the bug
On some STM32 MCUs, such as the STM32H723 or STM32L5, the RNG peripheral must be configured according to specific values provided in the reference manual to obtain best latency and to be compliant with NIST. This includes:
However, it seems that the RNG driver:
To Reproduce
N/A
Expected behavior
The STM32 RNG peripheral should be properly configured.
Impact
RNG configuration is not compliant with NIST and entropy generation latency might not be ideal.
Environment
Commit e9d3791
Additional context
Note that I unfortunately have no STM32 MCU with a RNG peripheral having such configuration fields at my disposal, so this issue is only based on my understanding of the reference manual and the driver implementation. In case the issue turns out to be real, I am willing to create a PR but I won't be able to test the fix on real hardware.
The text was updated successfully, but these errors were encountered: