MdePkg: TimerRngLib: Added RngLib that uses TimerLib

Added a new RngLib that provides random numbers from the TimerLib
using the performance counter. This is meant to be used for OpenSSL
to replicate past behavior. This should not be used in production as
a real source of entropy.

Ref: https://github.com/tianocore/edk2/pull/845
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1871

Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>

Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Matthew Carlson <matthewfcarlson@gmail.com>
This commit is contained in:
Matthew Carlson
2020-07-27 18:36:24 -07:00
committed by mergify[bot]
parent 32b0a492d5
commit f56ed0e51d
4 changed files with 242 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
// @file
// Instance of RNG (Random Number Generator) Library.
//
// RngLib that uses TimerLib's performance counter to provide random numbers.
//
// Copyright (c) Microsoft Corporation.
//
// SPDX-License-Identifier: BSD-2-Clause-Patent
//
#string STR_MODULE_ABSTRACT #language en-US "Instance of RNG Library"
#string STR_MODULE_DESCRIPTION #language en-US "BaseRng Library that uses the TimerLib to provide low-entropy random numbers"