TianoCore EDK2 master
|
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/RngLib.h>
#include <Protocol/Rng.h>
#include "RngDxeInternals.h"
Go to the source code of this file.
Functions | |
EFI_STATUS EFIAPI | RngDriverEntry (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
EFI_STATUS EFIAPI | RngDriverUnLoad (IN EFI_HANDLE ImageHandle) |
EFI_STATUS EFIAPI | RngGetBytes (IN UINTN Length, OUT UINT8 *RandBuffer) |
Variables | |
UINTN | mAvailableAlgoArrayCount |
EFI_RNG_ALGORITHM * | mAvailableAlgoArray |
EFI_RNG_PROTOCOL | mRngRdRand |
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.
RNG Algorithms defined in UEFI 2.4:
Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2015 Hewlett Packard Enterprise Development LP
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file RngDxe.c.
EFI_STATUS EFIAPI RngDriverEntry | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
The user Entry Point for the Random Number Generator (RNG) driver.
[in] | ImageHandle | The firmware allocated handle for the EFI image. |
[in] | SystemTable | A pointer to the EFI System Table. |
EFI_SUCCESS | The entry point is executed successfully. |
EFI_NOT_SUPPORTED | Platform does not support RNG. |
Other | Some error occurs when executing this entry point. |
EFI_STATUS EFIAPI RngDriverUnLoad | ( | IN EFI_HANDLE | ImageHandle | ) |
This is the unload handle for RndgDxe module.
Disconnect the driver specified by ImageHandle from all the devices in the handle database. Uninstall all the protocols installed in the driver entry point.
[in] | ImageHandle | The drivers' driver image. |
EFI_SUCCESS | The image is unloaded. |
Others | Failed to unload the image. |
EFI_STATUS EFIAPI RngGetBytes | ( | IN UINTN | Length, |
OUT UINT8 * | RandBuffer | ||
) |
Runs CPU RNG instruction to fill a buffer of arbitrary size with random bytes.
[in] | Length | Size of the buffer, in bytes, to fill with. |
[out] | RandBuffer | Pointer to the buffer to store the random result. |
EFI_SUCCESS | Random bytes generation succeeded. |
EFI_NOT_READY | Failed to request random bytes. |
EFI_RNG_ALGORITHM* mAvailableAlgoArray |
EFI_RNG_PROTOCOL mRngRdRand |