VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Include/Library/RngLib.h

Last change on this file was 105670, checked in by vboxsync, 6 months ago

Devices/EFI/FirmwareNew: Merge edk2-stable-202405 and make it build on aarch64, bugref:4643

  • Property svn:eol-style set to native
File size: 2.0 KB
Line 
1/** @file
2 Provides random number generator services.
3
4Copyright (c) 2023, Arm Limited. All rights reserved.<BR>
5Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
6SPDX-License-Identifier: BSD-2-Clause-Patent
7
8**/
9
10#ifndef __RNG_LIB_H__
11#define __RNG_LIB_H__
12
13/**
14 Generates a 16-bit random number.
15
16 if Rand is NULL, then ASSERT().
17
18 @param[out] Rand Buffer pointer to store the 16-bit random value.
19
20 @retval TRUE Random number generated successfully.
21 @retval FALSE Failed to generate the random number.
22
23**/
24BOOLEAN
25EFIAPI
26GetRandomNumber16 (
27 OUT UINT16 *Rand
28 );
29
30/**
31 Generates a 32-bit random number.
32
33 if Rand is NULL, then ASSERT().
34
35 @param[out] Rand Buffer pointer to store the 32-bit random value.
36
37 @retval TRUE Random number generated successfully.
38 @retval FALSE Failed to generate the random number.
39
40**/
41BOOLEAN
42EFIAPI
43GetRandomNumber32 (
44 OUT UINT32 *Rand
45 );
46
47/**
48 Generates a 64-bit random number.
49
50 if Rand is NULL, then ASSERT().
51
52 @param[out] Rand Buffer pointer to store the 64-bit random value.
53
54 @retval TRUE Random number generated successfully.
55 @retval FALSE Failed to generate the random number.
56
57**/
58BOOLEAN
59EFIAPI
60GetRandomNumber64 (
61 OUT UINT64 *Rand
62 );
63
64/**
65 Generates a 128-bit random number.
66
67 if Rand is NULL, then ASSERT().
68
69 @param[out] Rand Buffer pointer to store the 128-bit random value.
70
71 @retval TRUE Random number generated successfully.
72 @retval FALSE Failed to generate the random number.
73
74**/
75BOOLEAN
76EFIAPI
77GetRandomNumber128 (
78 OUT UINT64 *Rand
79 );
80
81/**
82 Get a GUID identifying the RNG algorithm implementation.
83
84 @param [out] RngGuid If success, contains the GUID identifying
85 the RNG algorithm implementation.
86
87 @retval EFI_SUCCESS Success.
88 @retval EFI_UNSUPPORTED Not supported.
89 @retval EFI_INVALID_PARAMETER Invalid parameter.
90**/
91EFI_STATUS
92EFIAPI
93GetRngGuid (
94 GUID *RngGuid
95 );
96
97#endif // __RNG_LIB_H__
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette