]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseRngLibNull/BaseRngLibNull.c
MdePkg: add null version of RngLib
[mirror_edk2.git] / MdePkg / Library / BaseRngLibNull / BaseRngLibNull.c
CommitLineData
c9af866c
JW
1/** @file\r
2 Null version of Random number generator services.\r
3\r
4Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>\r
5SPDX-License-Identifier: BSD-2-Clause-Patent\r
6\r
7**/\r
8\r
9#include <Library/DebugLib.h>\r
10#include <Library/RngLib.h>\r
11\r
12/**\r
13 Generates a 16-bit random number.\r
14\r
15 if Rand is NULL, then ASSERT().\r
16\r
17 @param[out] Rand Buffer pointer to store the 16-bit random value.\r
18\r
19 @retval TRUE Random number generated successfully.\r
20 @retval FALSE Failed to generate the random number.\r
21\r
22**/\r
23BOOLEAN\r
24EFIAPI\r
25GetRandomNumber16 (\r
26 OUT UINT16 *Rand\r
27 )\r
28{\r
29 ASSERT (FALSE);\r
30 return FALSE;\r
31}\r
32\r
33/**\r
34 Generates a 32-bit random number.\r
35\r
36 if Rand is NULL, then ASSERT().\r
37\r
38 @param[out] Rand Buffer pointer to store the 32-bit random value.\r
39\r
40 @retval TRUE Random number generated successfully.\r
41 @retval FALSE Failed to generate the random number.\r
42\r
43**/\r
44BOOLEAN\r
45EFIAPI\r
46GetRandomNumber32 (\r
47 OUT UINT32 *Rand\r
48 )\r
49{\r
50 ASSERT (FALSE);\r
51 return FALSE;\r
52}\r
53\r
54/**\r
55 Generates a 64-bit random number.\r
56\r
57 if Rand is NULL, then ASSERT().\r
58\r
59 @param[out] Rand Buffer pointer to store the 64-bit random value.\r
60\r
61 @retval TRUE Random number generated successfully.\r
62 @retval FALSE Failed to generate the random number.\r
63\r
64**/\r
65BOOLEAN\r
66EFIAPI\r
67GetRandomNumber64 (\r
68 OUT UINT64 *Rand\r
69 )\r
70{\r
71 ASSERT (FALSE);\r
72 return FALSE;\r
73}\r
74\r
75/**\r
76 Generates a 128-bit random number.\r
77\r
78 if Rand is NULL, then ASSERT().\r
79\r
80 @param[out] Rand Buffer pointer to store the 128-bit random value.\r
81\r
82 @retval TRUE Random number generated successfully.\r
83 @retval FALSE Failed to generate the random number.\r
84\r
85**/\r
86BOOLEAN\r
87EFIAPI\r
88GetRandomNumber128 (\r
89 OUT UINT64 *Rand\r
90 )\r
91{\r
92 ASSERT (FALSE);\r
93 return FALSE;\r
94}\r