-
Notifications
You must be signed in to change notification settings - Fork 830
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
[csrng] Make reseed counters always readable, allow locking down internal state access per instance #23539
Conversation
Thanks @vogelpi. This LGTM. |
Previously, the reseed counters were only readable if the otp_en_csrng_sw_app_read fuses were enabled and if the CTRL.READ_INT_STATE field was enabled, i.e., if the full internal state was readable. However, the reseed counter should be readable even if the internal state is not readable because this allows firmware to track the age of the different CSRNG contexts. The reseed counter itself is not sensitive information as it doesn't allow inferring the values of Key and V. Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
Previously, the design featured a single read enable switch plus an OTP fuse controlling read access for all three CTR_DRBG instances. This is non-ideal as firmware may want to perform known-answer testing of individual instances after enabling and then lock down instances individually. This commit thus adds a per-instance internal state read enable on top of the previously implemented mechanisms. After enabling, the internal state of all instances can be read and firmware can disable read access on a per-instance basis. Once firmware is done with the known-answer testing, it can lock the per-instance internal state read enable settings until the next reset. This resolves lowRISC#21141. Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
2e3e4fb
to
00c1934
Compare
Thanks for your review @moidx . As discussed in the triage meeting yesterday it would be better to allow locking the read enable settings until the next reset in ROM_EXT . I've now modified the PR accordingly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the REGWEN
changes. This LGTM.
All tests except for |
As discussed here: #21141 (comment)