TianoCore EDK2 master
Loading...
Searching...
No Matches
RngDxe.c File Reference

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_ALGORITHMmAvailableAlgoArray
 
EFI_RNG_PROTOCOL mRngRdRand
 

Detailed Description

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:

  • EFI_RNG_ALGORITHM_SP800_90_CTR_256_GUID
  • EFI_RNG_ALGORITHM_RAW
  • EFI_RNG_ALGORITHM_SP800_90_HMAC_256_GUID
  • EFI_RNG_ALGORITHM_SP800_90_HASH_256_GUID
  • EFI_RNG_ALGORITHM_X9_31_3DES_GUID
  • EFI_RNG_ALGORITHM_X9_31_AES_GUID

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.

Function Documentation

◆ RngDriverEntry()

EFI_STATUS EFIAPI RngDriverEntry ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

The user Entry Point for the Random Number Generator (RNG) driver.

Parameters
[in]ImageHandleThe firmware allocated handle for the EFI image.
[in]SystemTableA pointer to the EFI System Table.
Return values
EFI_SUCCESSThe entry point is executed successfully.
EFI_NOT_SUPPORTEDPlatform does not support RNG.
OtherSome error occurs when executing this entry point.

Definition at line 58 of file RngDxe.c.

◆ RngDriverUnLoad()

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.

Parameters
[in]ImageHandleThe drivers' driver image.
Return values
EFI_SUCCESSThe image is unloaded.
OthersFailed to unload the image.

Definition at line 109 of file RngDxe.c.

◆ RngGetBytes()

EFI_STATUS EFIAPI RngGetBytes ( IN UINTN  Length,
OUT UINT8 *  RandBuffer 
)

Runs CPU RNG instruction to fill a buffer of arbitrary size with random bytes.

Parameters
[in]LengthSize of the buffer, in bytes, to fill with.
[out]RandBufferPointer to the buffer to store the random result.
Return values
EFI_SUCCESSRandom bytes generation succeeded.
EFI_NOT_READYFailed to request random bytes.

Definition at line 132 of file RngDxe.c.

Variable Documentation

◆ mAvailableAlgoArray

EFI_RNG_ALGORITHM* mAvailableAlgoArray

Definition at line 35 of file RngDxe.c.

◆ mAvailableAlgoArrayCount

UINTN mAvailableAlgoArrayCount

Definition at line 34 of file RngDxe.c.

◆ mRngRdRand

EFI_RNG_PROTOCOL mRngRdRand
Initial value:
= {
}
EFI_STATUS EFIAPI RngGetInfo(IN EFI_RNG_PROTOCOL *This, IN OUT UINTN *RNGAlgorithmListSize, OUT EFI_RNG_ALGORITHM *RNGAlgorithmList)
Definition: RngDxe.c:160
EFI_STATUS EFIAPI RngGetRNG(IN EFI_RNG_PROTOCOL *This, IN EFI_RNG_ALGORITHM *RNGAlgorithm OPTIONAL, IN UINTN RNGValueLength, OUT UINT8 *RNGValue)
Definition: RngDxe.c:92

Definition at line 40 of file RngDxe.c.