Skip to content

Commit

Permalink
MdePkg/DxeRngLib: Add gEfiRngAlgorithmArmRndr to the secure algorithms
Browse files Browse the repository at this point in the history
DxeRngLib iterates over a list of secure algorithms before trying
to use the default algorithm provided by the Rng protocol. Add
gEfiRngAlgorithmArmRndr to this list. The algorithm represented by
this GUID is a secure DRBG of an unknown type, implemented by the
aarch64 RNDR instruction.
On AARCH64 platform, use the RNDR instruction as the first option
if it is available.

Signed-off-by: Pierre Gondois <[email protected]>
  • Loading branch information
pierregondois committed Sep 3, 2024
1 parent 975cc37 commit 3de8862
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions MdePkg/Library/DxeRngLib/DxeRngLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ typedef struct {
// the RNG protocol and are generally considered secure.
//
GLOBAL_REMOVE_IF_UNREFERENCED SECURE_RNG_ALGO_ARRAY mSecureHashAlgorithms[] = {
#ifdef MDE_CPU_AARCH64
{
&gEfiRngAlgorithmArmRndr, // unspecified SP800-90A DRBG (through RNDR instr.)
"ARM-RNDR",
FALSE,
},
#endif
{
&gEfiRngAlgorithmSp80090Ctr256Guid, // SP800-90A DRBG CTR using AES-256
"DRBG-CTR",
Expand Down
1 change: 1 addition & 0 deletions MdePkg/Library/DxeRngLib/DxeRngLib.inf
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
gEfiRngAlgorithmSp80090Ctr256Guid
gEfiRngAlgorithmSp80090Hash256Guid
gEfiRngAlgorithmSp80090Hmac256Guid
gEfiRngAlgorithmArmRndr
gEfiRngAlgorithmRaw

[FixedPcd]
Expand Down

0 comments on commit 3de8862

Please sign in to comment.