From fb42b39a7d88d1966491cc1a1a533cdd5154c661 Mon Sep 17 00:00:00 2001 From: Tuan Phan Date: Thu, 9 Jul 2026 11:06:38 -0700 Subject: [PATCH] SecurityPkg/RngDxe: Replace Intel-specific with arch-neutral comments The RngDxe driver and its non-AArch64 support files still contained comments and descriptions referring to Intel Secure Key technology, RDRAND/RDSEED instructions, and the Intel DRNG implementation guide. These references are no longer accurate because the driver obtains random data through the platform-provided RngLib abstraction rather than relying on Intel-specific CPU features. Update the comments and descriptions to use architecture-neutral language that better reflects the current implementation. Signed-off-by: Tuan Phan --- .../RngDxe/Rand/AesCore.c | 5 ++-- .../RngDxe/Rand/AesCore.h | 5 ++-- .../RngDxe/Rand/RdRand.c | 24 ++++++++----------- .../RngDxe/Rand/RngDxe.c | 9 +++---- .../RandomNumberGenerator/RngDxe/RngDxe.c | 13 +++++----- .../RandomNumberGenerator/RngDxe/RngDxe.inf | 14 +++++------ .../RandomNumberGenerator/RngDxe/RngDxe.uni | 11 ++++----- .../RngDxe/RngDxeExtra.uni | 2 -- .../RngDxe/RngDxeInternals.h | 4 ++-- 9 files changed, 40 insertions(+), 47 deletions(-) diff --git a/SecurityPkg/RandomNumberGenerator/RngDxe/Rand/AesCore.c b/SecurityPkg/RandomNumberGenerator/RngDxe/Rand/AesCore.c index 3ac20e889c..582709d074 100644 --- a/SecurityPkg/RandomNumberGenerator/RngDxe/Rand/AesCore.c +++ b/SecurityPkg/RandomNumberGenerator/RngDxe/Rand/AesCore.c @@ -3,8 +3,9 @@ Refer to FIPS PUB 197 ("Advanced Encryption Standard (AES)") for detailed algorithm description of AES. -Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent + Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent **/ diff --git a/SecurityPkg/RandomNumberGenerator/RngDxe/Rand/AesCore.h b/SecurityPkg/RandomNumberGenerator/RngDxe/Rand/AesCore.h index 0afbe4cb14..6cc9873026 100644 --- a/SecurityPkg/RandomNumberGenerator/RngDxe/Rand/AesCore.h +++ b/SecurityPkg/RandomNumberGenerator/RngDxe/Rand/AesCore.h @@ -1,8 +1,9 @@ /** @file Function prototype for AES Block Cipher support. -Copyright (c) 2013, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent + Copyright (c) 2013, Intel Corporation. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent **/ diff --git a/SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RdRand.c b/SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RdRand.c index 4b011c7e8e..c61357ee3f 100644 --- a/SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RdRand.c +++ b/SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RdRand.c @@ -1,15 +1,13 @@ /** @file - Support routines for RDRAND instruction access, which will leverage - Intel Secure Key technology to provide high-quality random numbers for use + Support routines for random number generation, which will leverage + the platform RngLib to provide high-quality random numbers for use in applications, or entropy for seeding other random number generators. - Refer to http://software.intel.com/en-us/articles/intel-digital-random-number - -generator-drng-software-implementation-guide/ for more information about Intel - Secure Key technology. -Copyright (c) 2021 - 2022, Arm Limited. All rights reserved.
-Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
-(C) Copyright 2015 Hewlett Packard Enterprise Development LP
-SPDX-License-Identifier: BSD-2-Clause-Patent + Copyright (c) 2021 - 2022, Arm Limited. All rights reserved.
+ Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
+ (C) Copyright 2015 Hewlett Packard Enterprise Development LP
+ + SPDX-License-Identifier: BSD-2-Clause-Patent **/ #include @@ -22,10 +20,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent /** Creates a 128bit random value that is fully forward and backward prediction resistant, - suitable for seeding a NIST SP800-90 Compliant, FIPS 1402-2 certifiable SW DRBG. - This function takes multiple random numbers through RDRAND without intervening - delays to ensure reseeding and performs AES-CBC-MAC over the data to compute the - seed value. + suitable for seeding a NIST SP800-90 Compliant, FIPS 1402-2 certifiable SW DRBG using + the platform RngLib. @param[out] SeedBuffer Pointer to a 128bit buffer to store the random seed. @@ -84,7 +80,7 @@ RdRandGetSeed128 ( } /** - Generate high-quality entropy source through RDRAND. + Generate high-quality entropy source. @param[in] Length Size of the buffer, in bytes, to fill with. @param[out] Entropy Pointer to the buffer to store the entropy data. diff --git a/SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RngDxe.c b/SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RngDxe.c index 8b0742bab6..416f733ff4 100644 --- a/SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RngDxe.c +++ b/SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RngDxe.c @@ -1,14 +1,12 @@ /** @file RNG Driver to produce the UEFI Random Number Generator protocol. - The driver will use the new RDRAND instruction to produce high-quality, high-performance - entropy and random number. + The driver uses the platform RngLib to produce high-quality, high-performance + entropy and random numbers. RNG Algorithms defined in UEFI 2.4: - EFI_RNG_ALGORITHM_SP800_90_CTR_256_GUID - Supported - (RDRAND implements a hardware NIST SP800-90 AES-CTR-256 based DRBG) - EFI_RNG_ALGORITHM_RAW - Supported - (Structuring RDRAND invocation can be guaranteed as high-quality entropy source) - EFI_RNG_ALGORITHM_SP800_90_HMAC_256_GUID - Unsupported - EFI_RNG_ALGORITHM_SP800_90_HASH_256_GUID - Unsupported - EFI_RNG_ALGORITHM_X9_31_3DES_GUID - Unsupported @@ -17,6 +15,7 @@ Copyright (c) 2021 - 2022, Arm Limited. All rights reserved.
Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2015 Hewlett Packard Enterprise Development LP
+ SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -181,8 +180,6 @@ RngGetInfo ( } CopyMem (&RNGAlgorithmList[0], &gEfiRngAlgorithmSp80090Ctr256Guid, sizeof (EFI_RNG_ALGORITHM)); - - // x86 platforms also support EFI_RNG_ALGORITHM_RAW via RDSEED CopyMem (&RNGAlgorithmList[1], &gEfiRngAlgorithmRaw, sizeof (EFI_RNG_ALGORITHM)); *RNGAlgorithmListSize = RequiredSize; diff --git a/SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.c b/SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.c index 292338b7d0..3c430894b3 100644 --- a/SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.c +++ b/SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.c @@ -1,8 +1,9 @@ /** @file RNG Driver to produce the UEFI Random Number Generator protocol. - The driver uses CPU RNG instructions to produce high-quality, - high-performance entropy and random number. + The driver uses the platform RngLib and/or architecture specific + instructions or firmware interface implementation to produce + high-quality, high-performance entropy and random numbers. RNG Algorithms defined in UEFI 2.4: - EFI_RNG_ALGORITHM_SP800_90_CTR_256_GUID @@ -12,10 +13,10 @@ - EFI_RNG_ALGORITHM_X9_31_3DES_GUID - EFI_RNG_ALGORITHM_X9_31_AES_GUID -Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
-(C) Copyright 2015 Hewlett Packard Enterprise Development LP
+ Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
+ (C) Copyright 2015 Hewlett Packard Enterprise Development LP
-SPDX-License-Identifier: BSD-2-Clause-Patent + SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -118,7 +119,7 @@ RngDriverUnLoad ( } /** - Runs CPU RNG instruction to fill a buffer of arbitrary size with random bytes. + Fills a buffer of arbitrary size with random bytes. @param[in] Length Size of the buffer, in bytes, to fill with. @param[out] RandBuffer Pointer to the buffer to store the random result. diff --git a/SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf b/SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf index fd5c1c9f99..9a126bae34 100644 --- a/SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf +++ b/SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf @@ -1,16 +1,16 @@ -## @file +## @file # Produces the UEFI Random Number Generator protocol # -# This module will leverage Intel Secure Key technology to produce the Random -# Number Generator protocol, which is used to provide high-quality random numbers -# for use in applications, or entropy for seeding other random number generators. -# Refer to http://software.intel.com/en-us/articles/intel-digital-random-number -# -generator-drng-software-implementation-guide/ for more information about Intel -# Secure Key technology. +# This module produces the Random Number Generator protocol, which is used to +# provide high-quality random numbers for use in applications, or entropy for +# seeding other random number generators. It relies on the platform RngLib and/or +# architecture specific instructions or firmware interface implementation to +# access the hardware random number source. # # Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
# (C) Copyright 2015 Hewlett Packard Enterprise Development LP
# Copyright (c) 2021 - 2022, Arm Limited. All rights reserved.
+# # SPDX-License-Identifier: BSD-2-Clause-Patent # ## diff --git a/SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.uni b/SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.uni index 975c466330..dc5540500c 100644 --- a/SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.uni +++ b/SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.uni @@ -1,12 +1,11 @@ // /** @file // Produces the UEFI Random Number Generator protocol // -// This module will leverage Intel Secure Key technology to produce the Random -// Number Generator protocol, which is used to provide high-quality random numbers -// for use in applications, or entropy for seeding other random number generators. -// Refer to http://software.intel.com/en-us/articles/intel-digital-random-number -// -generator-drng-software-implementation-guide/ for more information about Intel -// Secure Key technology. +// This module produces the Random Number Generator protocol, which is used to +// provide high-quality random numbers for use in applications, or entropy for +// seeding other random number generators. It relies on the platform RngLib and/or +// architecture specific instructions or firmware interface implementation to +// access the hardware random number source. // // Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
// diff --git a/SecurityPkg/RandomNumberGenerator/RngDxe/RngDxeExtra.uni b/SecurityPkg/RandomNumberGenerator/RngDxe/RngDxeExtra.uni index 0c7731e4f9..7f725e36db 100644 --- a/SecurityPkg/RandomNumberGenerator/RngDxe/RngDxeExtra.uni +++ b/SecurityPkg/RandomNumberGenerator/RngDxe/RngDxeExtra.uni @@ -10,5 +10,3 @@ #string STR_PROPERTIES_MODULE_NAME #language en-US "UEFI Random Number Generator DXE" - - diff --git a/SecurityPkg/RandomNumberGenerator/RngDxe/RngDxeInternals.h b/SecurityPkg/RandomNumberGenerator/RngDxe/RngDxeInternals.h index fc8c7db07b..9155d26383 100644 --- a/SecurityPkg/RandomNumberGenerator/RngDxe/RngDxeInternals.h +++ b/SecurityPkg/RandomNumberGenerator/RngDxe/RngDxeInternals.h @@ -101,7 +101,7 @@ RngGetRNG ( ); /** - Runs CPU RNG instruction to fill a buffer of arbitrary size with random bytes. + Fills a buffer of arbitrary size with random bytes. @param[in] Length Size of the buffer, in bytes, to fill with. @param[out] RandBuffer Pointer to the buffer to store the random result. @@ -118,7 +118,7 @@ RngGetBytes ( ); /** - Generate high-quality entropy source using a TRNG or through RDRAND. + Generate high-quality entropy source. @param[in] Length Size of the buffer, in bytes, to fill with. @param[out] Entropy Pointer to the buffer to store the entropy data.