TianoCore EDK2 master
Loading...
Searching...
No Matches
HashLib.h
Go to the documentation of this file.
1
11#ifndef _HASH_LIB_H_
12#define _HASH_LIB_H_
13
14#include <Uefi.h>
15#include <Protocol/Hash.h>
17typedef UINTN HASH_HANDLE;
18
28EFIAPI
30 OUT HASH_HANDLE *HashHandle
31 );
32
43EFIAPI
45 IN HASH_HANDLE HashHandle,
46 IN VOID *DataToHash,
47 IN UINTN DataToHashLen
48 );
49
62EFIAPI
64 IN HASH_HANDLE HashHandle,
65 IN TPMI_DH_PCR PcrIndex,
66 IN VOID *DataToHash,
67 IN UINTN DataToHashLen,
68 OUT TPML_DIGEST_VALUES *DigestList
69 );
70
82EFIAPI
84 IN TPMI_DH_PCR PcrIndex,
85 IN VOID *DataToHash,
86 IN UINTN DataToHashLen,
87 OUT TPML_DIGEST_VALUES *DigestList
88 );
89
98typedef
100(EFIAPI *HASH_INIT)(
101 OUT HASH_HANDLE *HashHandle
102 );
103
113typedef
115(EFIAPI *HASH_UPDATE)(
116 IN HASH_HANDLE HashHandle,
117 IN VOID *DataToHash,
118 IN UINTN DataToHashLen
119 );
120
129typedef
131(EFIAPI *HASH_FINAL)(
132 IN HASH_HANDLE HashHandle,
133 OUT TPML_DIGEST_VALUES *DigestList
134 );
135
136#define HASH_ALGORITHM_SHA1_GUID EFI_HASH_ALGORITHM_SHA1_GUID
137#define HASH_ALGORITHM_SHA256_GUID EFI_HASH_ALGORITHM_SHA256_GUID
138#define HASH_ALGORITHM_SHA384_GUID EFI_HASH_ALGORITHM_SHA384_GUID
139#define HASH_ALGORITHM_SHA512_GUID EFI_HASH_ALGORITHM_SHA512_GUID
140#define HASH_ALGORITHM_SM3_256_GUID \
141 { \
142 0x251C7818, 0x0DBF, 0xE619, { 0x7F, 0xC2, 0xD6, 0xAC, 0x43, 0x42, 0x7D, 0xA3 } \
143 }
144
145typedef struct {
146 EFI_GUID HashGuid;
147 HASH_INIT HashInit;
149 HASH_FINAL HashFinal;
151
162EFIAPI
164 IN HASH_INTERFACE *HashInterface
165 );
166
167#endif
UINT64 UINTN
EFI_STATUS(EFIAPI * HASH_INIT)(OUT HASH_HANDLE *HashHandle)
Definition: HashLib.h:100
EFI_STATUS EFIAPI HashStart(OUT HASH_HANDLE *HashHandle)
Definition: HashLibTdx.c:39
EFI_STATUS EFIAPI RegisterHashInterfaceLib(IN HASH_INTERFACE *HashInterface)
Definition: HashLibTdx.c:185
EFI_STATUS EFIAPI HashUpdate(IN HASH_HANDLE HashHandle, IN VOID *DataToHash, IN UINTN DataToHashLen)
Definition: HashLibTdx.c:69
EFI_STATUS EFIAPI HashAndExtend(IN TPMI_DH_PCR PcrIndex, IN VOID *DataToHash, IN UINTN DataToHashLen, OUT TPML_DIGEST_VALUES *DigestList)
Definition: HashLibTdx.c:150
EFI_STATUS(EFIAPI * HASH_UPDATE)(IN HASH_HANDLE HashHandle, IN VOID *DataToHash, IN UINTN DataToHashLen)
Definition: HashLib.h:115
EFI_STATUS EFIAPI HashCompleteAndExtend(IN HASH_HANDLE HashHandle, IN TPMI_DH_PCR PcrIndex, IN VOID *DataToHash, IN UINTN DataToHashLen, OUT TPML_DIGEST_VALUES *DigestList)
Definition: HashLibTdx.c:98
EFI_STATUS(EFIAPI * HASH_FINAL)(IN HASH_HANDLE HashHandle, OUT TPML_DIGEST_VALUES *DigestList)
Definition: HashLib.h:131
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
Definition: Base.h:213