summaryrefslogtreecommitdiffstats
path: root/SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RdRand.h
diff options
context:
space:
mode:
authorRebecca Cran <rebecca@nuviainc.com>2021-05-10 15:53:08 -0600
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-05-11 16:26:05 +0000
commit4e5ecdbac8bdf235b2072baa0c5e170cd9f57463 (patch)
treedfab7b8f283b9a4b4fc775fc6ef5592776ea88a4 /SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RdRand.h
parent9301e5644cef5a5234f71b178373dd508cabb9ee (diff)
downloadedk2-4e5ecdbac8bdf235b2072baa0c5e170cd9f57463.tar.gz
edk2-4e5ecdbac8bdf235b2072baa0c5e170cd9f57463.tar.bz2
edk2-4e5ecdbac8bdf235b2072baa0c5e170cd9f57463.zip
SecurityPkg: Add support for RngDxe on AARCH64
AARCH64 support has been added to BaseRngLib via the optional ARMv8.5 FEAT_RNG. Refactor RngDxe to support AARCH64, note support for it in the VALID_ARCHITECTURES line of RngDxe.inf and enable it in SecurityPkg.dsc. Signed-off-by: Rebecca Cran <rebecca@nuviainc.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Acked-by: Jiewen Yao <Jiewen.yao@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Diffstat (limited to 'SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RdRand.h')
-rw-r--r--SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RdRand.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RdRand.h b/SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RdRand.h
new file mode 100644
index 0000000000..072378e062
--- /dev/null
+++ b/SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RdRand.h
@@ -0,0 +1,43 @@
+/** @file
+ Header for the RDRAND APIs used by RNG DXE driver.
+
+ Support API definitions for RDRAND instruction access, which will leverage
+ Intel Secure Key technology 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) 2013, Intel Corporation. All rights reserved.<BR>
+(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef __RD_RAND_H__
+#define __RD_RAND_H__
+
+#include <Library/BaseLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/TimerLib.h>
+#include <Protocol/Rng.h>
+
+/**
+ Generate high-quality entropy source through RDRAND.
+
+ @param[in] Length Size of the buffer, in bytes, to fill with.
+ @param[out] Entropy Pointer to the buffer to store the entropy data.
+
+ @retval EFI_SUCCESS Entropy generation succeeded.
+ @retval EFI_NOT_READY Failed to request random data.
+
+**/
+EFI_STATUS
+EFIAPI
+RdRandGenerateEntropy (
+ IN UINTN Length,
+ OUT UINT8 *Entropy
+ );
+
+#endif // __RD_RAND_H__