UefiPayloadPkg: Add RNG support

Uses the RDRAND instruction if available and install EfiRngProtocol.
The protocol may be used by iPXE or the Linux kernel to gather entropy.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
This commit is contained in:
Patrick Rudolph
2020-05-11 14:31:44 +02:00
committed by Tim Crawford
parent 95c492569f
commit 69ae47ba5d
5 changed files with 260 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
## @file
# Instance of RNG (Random Number Generator) Library.
#
# Copyright (c) 2020 9elements Agency GmbH.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = BaseRngLib
MODULE_UNI_FILE = BaseRngLib.uni
FILE_GUID = 05C48431-DE18-4550-931A-3350E8551498
MODULE_TYPE = BASE
VERSION_STRING = 1.0
LIBRARY_CLASS = RngLib
CONSTRUCTOR = BaseRngLibConstructor
#
# VALID_ARCHITECTURES = IA32 X64
#
[Sources.Ia32, Sources.X64]
BaseRng.c
[Packages]
MdePkg/MdePkg.dec
[LibraryClasses]
BaseLib
DebugLib