2 Definitions for OBB FVs verification.
4 Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef __FV_REPORT_PEI_H__
10 #define __FV_REPORT_PEI_H__
14 #include <IndustryStandard/Tpm20.h>
16 #include <Ppi/FirmwareVolumeInfoStoredHashFv.h>
18 #include <Library/PeiServicesLib.h>
19 #include <Library/PcdLib.h>
20 #include <Library/HobLib.h>
21 #include <Library/DebugLib.h>
22 #include <Library/BaseMemoryLib.h>
23 #include <Library/MemoryAllocationLib.h>
24 #include <Library/BaseCryptLib.h>
25 #include <Library/ReportStatusCodeLib.h>
27 #define HASH_INFO_PTR(PreHashedFvPpi) \
28 (HASH_INFO *)((UINT8 *)(PreHashedFvPpi) + sizeof (EDKII_PEI_FIRMWARE_VOLUME_INFO_PREHASHED_FV_PPI))
30 #define HASH_VALUE_PTR(HashInfo) \
31 (VOID *)((UINT8 *)(HashInfo) + sizeof (HASH_INFO))
34 Computes the message digest of a input data buffer.
36 This function performs message digest of a given data buffer, and places
37 the digest value into the specified memory.
39 If this interface is not supported, then return FALSE.
41 @param[in] Data Pointer to the buffer containing the data to be hashed.
42 @param[in] DataSize Size of Data buffer in bytes.
43 @param[out] HashValue Pointer to a buffer that receives digest value.
45 @retval TRUE The digest computation succeeded.
46 @retval FALSE The digest computation failed.
51 (EFIAPI
*HASH_ALL_METHOD
) (
58 Initializes user-supplied memory as hash context for subsequent use.
60 @param[out] HashContext Pointer to hash context being initialized.
62 @retval TRUE Hash context initialization succeeded.
63 @retval FALSE Hash context initialization failed.
64 @retval FALSE This interface is not supported.
69 (EFIAPI
*HASH_INIT_METHOD
) (
74 Digests the input data and updates hash context.
76 @param[in, out] HashContext Pointer to the hash context.
77 @param[in] Data Pointer to the buffer containing the data to be hashed.
78 @param[in] DataSize Size of Data buffer in bytes.
80 @retval TRUE Hash data digest succeeded.
81 @retval FALSE Hash data digest failed.
82 @retval FALSE This interface is not supported.
87 (EFIAPI
*HASH_UPDATE_METHOD
) (
88 IN OUT VOID
*HashContext
,
94 Completes computation of the hash digest value.
96 @param[in, out] HashContext Pointer to the hash context.
97 @param[out] HashValue Pointer to a buffer that receives the hash digest
100 @retval TRUE Hash digest computation succeeded.
101 @retval FALSE Hash digest computation failed.
102 @retval FALSE This interface is not supported.
107 (EFIAPI
*HASH_FINAL_METHOD
) (
108 IN OUT VOID
*HashContext
,
115 HASH_INIT_METHOD HashInit
;
116 HASH_UPDATE_METHOD HashUpdate
;
117 HASH_FINAL_METHOD HashFinal
;
118 HASH_ALL_METHOD HashAll
;
121 #endif //__FV_REPORT_PEI_H__