18EFI_GUID mSha384Guid = HASH_ALGORITHM_SHA384_GUID;
27UINTN mHashInterfaceCount = 0;
40 OUT HASH_HANDLE *HashHandle
45 if (mHashInterfaceCount == 0) {
47 return EFI_UNSUPPORTED;
51 mHashInterface.HashInit (&HashCtx);
53 *HashHandle = HashCtx;
70 IN HASH_HANDLE HashHandle,
75 if (mHashInterfaceCount == 0) {
77 return EFI_UNSUPPORTED;
80 mHashInterface.HashUpdate (HashHandle, DataToHash, DataToHashLen);
99 IN HASH_HANDLE HashHandle,
100 IN TPMI_DH_PCR PcrIndex,
109 if (mHashInterfaceCount == 0) {
111 return EFI_UNSUPPORTED;
114 ZeroMem (DigestList,
sizeof (*DigestList));
116 mHashInterface.HashUpdate (HashHandle, DataToHash, DataToHashLen);
117 mHashInterface.HashFinal (HashHandle, &Digest);
120 &DigestList->digests[0],
122 sizeof (Digest.digests[0])
126 ASSERT (DigestList->count == 1 && DigestList->digests[0].hashAlg == TPM_ALG_SHA384);
129 (UINT32 *)DigestList->digests[0].digest.sha384,
134 ASSERT (!EFI_ERROR (Status));
151 IN TPMI_DH_PCR PcrIndex,
157 HASH_HANDLE HashHandle;
160 if (mHashInterfaceCount == 0) {
162 return EFI_UNSUPPORTED;
168 HashUpdate (HashHandle, DataToHash, DataToHashLen);
194 return EFI_UNSUPPORTED;
200 if (!
CompareGuid (&mSha384Guid, &HashInterface->HashGuid)) {
201 return EFI_UNSUPPORTED;
204 if (mHashInterfaceCount != 0) {
206 return EFI_OUT_OF_RESOURCES;
209 CopyMem (&mHashInterface, HashInterface,
sizeof (*HashInterface));
210 mHashInterfaceCount++;
#define SHA384_DIGEST_SIZE
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
BOOLEAN EFIAPI CompareGuid(IN CONST GUID *Guid1, IN CONST GUID *Guid2)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
EFI_STATUS EFIAPI HashStart(OUT HASH_HANDLE *HashHandle)
EFI_STATUS EFIAPI RegisterHashInterfaceLib(IN HASH_INTERFACE *HashInterface)
EFI_STATUS EFIAPI HashUpdate(IN HASH_HANDLE HashHandle, IN VOID *DataToHash, IN UINTN DataToHashLen)
EFI_STATUS EFIAPI HashAndExtend(IN TPMI_DH_PCR PcrIndex, IN VOID *DataToHash, IN UINTN DataToHashLen, OUT TPML_DIGEST_VALUES *DigestList)
EFI_STATUS EFIAPI HashCompleteAndExtend(IN HASH_HANDLE HashHandle, IN TPMI_DH_PCR PcrIndex, IN VOID *DataToHash, IN UINTN DataToHashLen, OUT TPML_DIGEST_VALUES *DigestList)
BOOLEAN EFIAPI TdIsEnabled()
EFI_STATUS EFIAPI TdExtendRtmr(IN UINT32 *Data, IN UINT32 DataLen, IN UINT8 Index)