-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Add RNG PPI #10691
Merged
Merged
Add RNG PPI #10691
+742
−137
Conversation
This file contains 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
mdkinney
reviewed
Jan 28, 2025
b2a3093
to
2f66285
Compare
The commit messages reference BZ links. Should those be updated to GitHub Issues links? |
Move the structure definition to a common location that can be shared with the RNG PPI. Move the algorithms to a common header that can be referenced independent of the protocol. Include the algorithm header in the interface header since the algorithms are directly used in the interface and for compatibility with existing code. Signed-off-by: Michael Kubacki <[email protected]>
REF:tianocore#10529 Adds a new PPI that serves the same purpose as EFI_RNG_PROTOCOL in DXE. This PPI can be produced by a PEIM to provide a dynamic interface to RNG services in PEI. Signed-off-by: Michael Kubacki <[email protected]>
REF:tianocore#10529 Adds a new PEI library instance for RngLib that uses the RNG services provided by the RNG PPI. This library instance will add a DEPEX on gEfiRngPpiGuid on modules it links against. It can be used to allow PEIMs to get RNG support over a dynamic interface. Signed-off-by: Michael Kubacki <[email protected]>
REF:tianocore#10529 The `RngPei` PEIM can be used if RNG should be provided over a dynamic binary interface to other PEIMs on a platform. Tested with: - SecurityPkg CI - Verify RNG linked with RngLib is executed as expected - Verify random numbers are generated successfully with a valid RngLib Integration instructions: Use the `RngPei` module if a platform needs to produce `gEfiRngPpiGuid`. The platform should usually link a different `RngLib` instance to `RngPei` than other PEIMs that may use the RNG PPI produced since `RngPei` is responsible for producing the PPI. For example, a `RngLib` instance that uses the rdrand instruction may be linked against `RngPei` and a `RngLib` instance that uses the RNG PPI may be linked against other PEIMs. Signed-off-by: Michael Kubacki <[email protected]>
2f66285
to
2e6153d
Compare
Updated the references to GitHub issues. |
mdkinney
approved these changes
Feb 3, 2025
jyao1
approved these changes
Feb 6, 2025
Done. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Description
Closes #10529
The RNG PPI was a code first proposal under BZ1814 and published in the PI Spec v1.9.
This change adds the
RngPei
module to SecurityPkg to produce the PPI and theRngLib
library to MdePkg to consume the PPI.MdePkg: Add Random Number Generator (RNG) PPI
Adds a new PPI that serves the same purpose as EFI_RNG_PROTOCOL in
DXE. This PPI can be produced by a PEIM to provide a dynamic interface
to RNG services in PEI.
MdePkg: Add PeiRngLib
Adds a new PEI library instance for RngLib that uses the RNG services
provided by the RNG PPI.
This library instance will add a DEPEX on gEfiRngPpiGuid on modules
it links against. It can be used to allow PEIMs to get RNG support
over a dynamic interface.
SecurityPkg: Add RngPei
The
RngPei
PEIM can be used if RNG should be provided over adynamic binary interface to other PEIMs on a platform.
How This Was Tested
RngLib
Integration Instructions
Use the
RngPei
module if a platform needs to producegEfiRngPpiGuid
.The platform should usually link a different
RngLib
instance toRngPei
than other PEIMs that may use the RNG PPI produced sinceRngPei
is responsible for producing the PPI.For example, a
RngLib
instance that uses the rdrand instructionmay be linked against
RngPei
and aRngLib
instance that usesthe RNG PPI may be linked against other PEIMs.