Add CSPRNG to LVBS platform#825
Open
sangho2 wants to merge 5 commits into
Open
Conversation
30e46bc to
6cec07a
Compare
wdcui
reviewed
May 15, 2026
| let mut word = 0; | ||
| loop { | ||
| // Safety: `RDRAND` is available on the LVBS target CPUs. A false | ||
| // carry flag means random data is temporarily unavailable. |
Member
There was a problem hiding this comment.
What happens when it's unavailable? Would we get a bad seed in this case?
Contributor
Author
There was a problem hiding this comment.
AFAIK, RDRAND returns zero if there is not enough HW entropy.
added 3 commits
May 20, 2026 01:42
45bc674 to
ee071f9
Compare
|
🤖 SemverChecks 🤖 No breaking API changes detected Note: this does not mean API is unchanged, or even that there are no breaking changes; simply, none of the detections triggered. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds Cryptographically Secure Pseudo-Random Number Generator (CSPRNG) to the LVBS platform. Userland applications (e.g., TAs) can use this CSPRNG using
fill_bytes_crngthough the shim. For now, it uses ChaCha20, so this is not for applications/scenarios demanding FIPS certification.