]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseRngLibNull/BaseRngLibNull.c
MdePkg: add null version of RngLib
[mirror_edk2.git] / MdePkg / Library / BaseRngLibNull / BaseRngLibNull.c
diff --git a/MdePkg/Library/BaseRngLibNull/BaseRngLibNull.c b/MdePkg/Library/BaseRngLibNull/BaseRngLibNull.c
new file mode 100644 (file)
index 0000000..cad3059
--- /dev/null
@@ -0,0 +1,94 @@
+/** @file\r
+  Null version of Random number generator services.\r
+\r
+Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+**/\r
+\r
+#include <Library/DebugLib.h>\r
+#include <Library/RngLib.h>\r
+\r
+/**\r
+  Generates a 16-bit random number.\r
+\r
+  if Rand is NULL, then ASSERT().\r
+\r
+  @param[out] Rand     Buffer pointer to store the 16-bit random value.\r
+\r
+  @retval TRUE         Random number generated successfully.\r
+  @retval FALSE        Failed to generate the random number.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+GetRandomNumber16 (\r
+  OUT     UINT16                    *Rand\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return FALSE;\r
+}\r
+\r
+/**\r
+  Generates a 32-bit random number.\r
+\r
+  if Rand is NULL, then ASSERT().\r
+\r
+  @param[out] Rand     Buffer pointer to store the 32-bit random value.\r
+\r
+  @retval TRUE         Random number generated successfully.\r
+  @retval FALSE        Failed to generate the random number.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+GetRandomNumber32 (\r
+  OUT     UINT32                    *Rand\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return FALSE;\r
+}\r
+\r
+/**\r
+  Generates a 64-bit random number.\r
+\r
+  if Rand is NULL, then ASSERT().\r
+\r
+  @param[out] Rand     Buffer pointer to store the 64-bit random value.\r
+\r
+  @retval TRUE         Random number generated successfully.\r
+  @retval FALSE        Failed to generate the random number.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+GetRandomNumber64 (\r
+  OUT     UINT64                    *Rand\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return FALSE;\r
+}\r
+\r
+/**\r
+  Generates a 128-bit random number.\r
+\r
+  if Rand is NULL, then ASSERT().\r
+\r
+  @param[out] Rand     Buffer pointer to store the 128-bit random value.\r
+\r
+  @retval TRUE         Random number generated successfully.\r
+  @retval FALSE        Failed to generate the random number.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+GetRandomNumber128 (\r
+  OUT     UINT64                    *Rand\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return FALSE;\r
+}\r