]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseRngLib/BaseRngLibInternals.h
MdePkg: Apply uncrustify changes
[mirror_edk2.git] / MdePkg / Library / BaseRngLib / BaseRngLibInternals.h
CommitLineData
9301e564
RC
1/** @file\r
2\r
3 Architecture specific interface to RNG functionality.\r
4\r
5Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>\r
6\r
7SPDX-License-Identifier: BSD-2-Clause-Patent\r
8\r
9**/\r
10\r
11#ifndef BASE_RNGLIB_INTERNALS_H_\r
12\r
13/**\r
14 Generates a 16-bit random number.\r
15\r
16 @param[out] Rand Buffer pointer to store the 16-bit random value.\r
17\r
18 @retval TRUE Random number generated successfully.\r
19 @retval FALSE Failed to generate the random number.\r
20\r
21**/\r
22BOOLEAN\r
23EFIAPI\r
24ArchGetRandomNumber16 (\r
2f88bd3a 25 OUT UINT16 *Rand\r
9301e564
RC
26 );\r
27\r
28/**\r
29 Generates a 32-bit random number.\r
30\r
31 @param[out] Rand Buffer pointer to store the 32-bit random value.\r
32\r
33 @retval TRUE Random number generated successfully.\r
34 @retval FALSE Failed to generate the random number.\r
35\r
36**/\r
37BOOLEAN\r
38EFIAPI\r
39ArchGetRandomNumber32 (\r
2f88bd3a 40 OUT UINT32 *Rand\r
9301e564
RC
41 );\r
42\r
43/**\r
44 Generates a 64-bit random number.\r
45\r
46 @param[out] Rand Buffer pointer to store the 64-bit random value.\r
47\r
48 @retval TRUE Random number generated successfully.\r
49 @retval FALSE Failed to generate the random number.\r
50\r
51**/\r
52BOOLEAN\r
53EFIAPI\r
54ArchGetRandomNumber64 (\r
2f88bd3a 55 OUT UINT64 *Rand\r
9301e564
RC
56 );\r
57\r
58/**\r
59 Checks whether the RNG instruction is supported.\r
60\r
61 @retval TRUE RNG instruction is supported.\r
62 @retval FALSE RNG instruction is not supported.\r
63\r
64**/\r
65BOOLEAN\r
66EFIAPI\r
67ArchIsRngSupported (\r
68 VOID\r
69 );\r
70\r
71#if defined (MDE_CPU_AARCH64)\r
72\r
73// RNDR, Random Number\r
2f88bd3a 74#define RNDR S3_3_C2_C4_0\r
9301e564
RC
75\r
76#endif\r
77\r
2f88bd3a 78#endif // BASE_RNGLIB_INTERNALS_H_\r