TianoCore EDK2 master
Loading...
Searching...
No Matches
RngLib.h File Reference

Go to the source code of this file.

Functions

BOOLEAN EFIAPI GetRandomNumber16 (OUT UINT16 *Rand)
 
BOOLEAN EFIAPI GetRandomNumber32 (OUT UINT32 *Rand)
 
BOOLEAN EFIAPI GetRandomNumber64 (OUT UINT64 *Rand)
 
BOOLEAN EFIAPI GetRandomNumber128 (OUT UINT64 *Rand)
 
EFI_STATUS EFIAPI GetRngGuid (GUID *RngGuid)
 

Detailed Description

Provides random number generator services.

Copyright (c) 2023, Arm Limited. All rights reserved.
Copyright (c) 2015, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file RngLib.h.

Function Documentation

◆ GetRandomNumber128()

BOOLEAN EFIAPI GetRandomNumber128 ( OUT UINT64 *  Rand)

Generates a 128-bit random number.

if Rand is NULL, then ASSERT().

Parameters
[out]RandBuffer pointer to store the 128-bit random value.
Return values
TRUERandom number generated successfully.
FALSEFailed to generate the random number.

Generates a 128-bit random number.

if Rand is NULL, return FALSE.

Parameters
[out]RandBuffer pointer to store the 128-bit random value.
Return values
TRUERandom number generated successfully.
FALSEFailed to generate the random number.

Definition at line 182 of file RngLibTimer.c.

◆ GetRandomNumber16()

BOOLEAN EFIAPI GetRandomNumber16 ( OUT UINT16 *  Rand)

Generates a 16-bit random number.

if Rand is NULL, then ASSERT().

Parameters
[out]RandBuffer pointer to store the 16-bit random value.
Return values
TRUERandom number generated successfully.
FALSEFailed to generate the random number.

Generates a 16-bit random number.

if Rand is NULL, return FALSE.

Parameters
[out]RandBuffer pointer to store the 16-bit random value.
Return values
TRUERandom number generated successfully.
FALSEFailed to generate the random number.

Definition at line 62 of file RngLibTimer.c.

◆ GetRandomNumber32()

BOOLEAN EFIAPI GetRandomNumber32 ( OUT UINT32 *  Rand)

Generates a 32-bit random number.

if Rand is NULL, then ASSERT().

Parameters
[out]RandBuffer pointer to store the 32-bit random value.
Return values
TRUERandom number generated successfully.
FALSEFailed to generate the random number.

Generates a 32-bit random number.

if Rand is NULL, return FALSE.

Parameters
[out]RandBuffer pointer to store the 32-bit random value.
Return values
TRUERandom number generated successfully.
FALSEFailed to generate the random number.

Definition at line 102 of file RngLibTimer.c.

◆ GetRandomNumber64()

BOOLEAN EFIAPI GetRandomNumber64 ( OUT UINT64 *  Rand)

Generates a 64-bit random number.

if Rand is NULL, then ASSERT().

Parameters
[out]RandBuffer pointer to store the 64-bit random value.
Return values
TRUERandom number generated successfully.
FALSEFailed to generate the random number.

Generates a 64-bit random number.

if Rand is NULL, return FALSE.

Parameters
[out]RandBuffer pointer to store the 64-bit random value.
Return values
TRUERandom number generated successfully.
FALSEFailed to generate the random number.

Definition at line 142 of file RngLibTimer.c.

◆ GetRngGuid()

EFI_STATUS EFIAPI GetRngGuid ( GUID RngGuid)

Get a GUID identifying the RNG algorithm implementation.

Parameters
[out]RngGuidIf success, contains the GUID identifying the RNG algorithm implementation.
Return values
EFI_SUCCESSSuccess.
EFI_UNSUPPORTEDNot supported.
EFI_INVALID_PARAMETERInvalid parameter.

Definition at line 210 of file RngLibTimer.c.