SecurityPkg/RngDxe: Rename RdRandGenerateEntropy to generic name

Bugzilla: 3668 (https://bugzilla.tianocore.org/show_bug.cgi?id=3668)

Rename RdRandGenerateEntropy() to GenerateEntropy() to provide a
common interface to generate entropy on other architectures.
GenerateEntropy() is intended to generate high quality entropy.

Also move the definition to RngDxeInternals.h

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Acked-by: Jiewen Yao <jiewen.yao@intel.com>
This commit is contained in:
Sami Mujawar
2022-10-28 17:32:50 +02:00
committed by mergify[bot]
parent e00ec499c5
commit 8a89747844
5 changed files with 36 additions and 49 deletions

View File

@@ -10,6 +10,8 @@
#ifndef RNGDXE_INTERNALS_H_
#define RNGDXE_INTERNALS_H_
#include <Protocol/Rng.h>
/**
Returns information about the random number generation implementation.
@@ -114,4 +116,21 @@ RngGetBytes (
OUT UINT8 *RandBuffer
);
/**
Generate high-quality entropy source using a TRNG or 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
GenerateEntropy (
IN UINTN Length,
OUT UINT8 *Entropy
);
#endif // RNGDXE_INTERNALS_H_