Add RNG PPI#10691
Merged
Merged
Conversation
mdkinney
reviewed
Jan 28, 2025
b2a3093 to
2f66285
Compare
Member
|
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 <michael.kubacki@microsoft.com>
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 <michael.kubacki@microsoft.com>
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 <michael.kubacki@microsoft.com>
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 <michael.kubacki@microsoft.com>
2f66285 to
2e6153d
Compare
Member
Author
Updated the references to GitHub issues. |
mdkinney
approved these changes
Feb 3, 2025
Member
jyao1
approved these changes
Feb 6, 2025
Contributor
Done. |
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.
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
RngPeimodule to SecurityPkg to produce the PPI and theRngLiblibrary 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
RngPeiPEIM 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
RngPeimodule if a platform needs to producegEfiRngPpiGuid.The platform should usually link a different
RngLibinstance toRngPeithan other PEIMs that may use the RNG PPI produced sinceRngPeiis responsible for producing the PPI.For example, a
RngLibinstance that uses the rdrand instructionmay be linked against
RngPeiand aRngLibinstance that usesthe RNG PPI may be linked against other PEIMs.