]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/Include/Library/RpmcLib.h
SecurityPkg: add RpmcLib and VariableKeyLib public headers
[mirror_edk2.git] / SecurityPkg / Include / Library / RpmcLib.h
diff --git a/SecurityPkg/Include/Library/RpmcLib.h b/SecurityPkg/Include/Library/RpmcLib.h
new file mode 100644 (file)
index 0000000..5882bfa
--- /dev/null
@@ -0,0 +1,43 @@
+/** @file\r
+  Public definitions for the Replay Protected Monotonic Counter (RPMC) Library.\r
+\r
+Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+**/\r
+\r
+#ifndef _RPMC_LIB_H_\r
+#define _RPMC_LIB_H_\r
+\r
+#include <Uefi/UefiBaseType.h>\r
+\r
+/**\r
+  Requests the monotonic counter from the designated RPMC counter.\r
+\r
+  @param[out]   CounterValue            A pointer to a buffer to store the RPMC value.\r
+\r
+  @retval       EFI_SUCCESS             The operation completed successfully.\r
+  @retval       EFI_DEVICE_ERROR        A device error occurred while attempting to update the counter.\r
+  @retval       EFI_UNSUPPORTED         The operation is un-supported.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+RequestMonotonicCounter (\r
+  OUT UINT32  *CounterValue\r
+  );\r
+\r
+/**\r
+  Increments the monotonic counter in the SPI flash device by 1.\r
+\r
+  @retval       EFI_SUCCESS             The operation completed successfully.\r
+  @retval       EFI_DEVICE_ERROR        A device error occurred while attempting to update the counter.\r
+  @retval       EFI_UNSUPPORTED         The operation is un-supported.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+IncrementMonotonicCounter (\r
+  VOID\r
+  );\r
+\r
+#endif\r
+\r