TianoCore EDK2 master
Loading...
Searching...
No Matches
TpmComm.c
Go to the documentation of this file.
1
9#include "CommonHeader.h"
10
22EFIAPI
24 IN CONST UINT8 *Data,
25 IN UINTN DataLen,
26 OUT TPM_DIGEST *Digest
27 )
28{
29 VOID *Sha1Ctx;
30 UINTN CtxSize;
31
32 CtxSize = Sha1GetContextSize ();
33 Sha1Ctx = AllocatePool (CtxSize);
34 ASSERT (Sha1Ctx != NULL);
35
36 Sha1Init (Sha1Ctx);
37 Sha1Update (Sha1Ctx, Data, DataLen);
38 Sha1Final (Sha1Ctx, (UINT8 *)Digest);
39
40 FreePool (Sha1Ctx);
41
42 return EFI_SUCCESS;
43}
UINT64 UINTN
BOOLEAN EFIAPI Sha1Final(IN OUT VOID *Sha1Context, OUT UINT8 *HashValue)
Definition: CryptSha1.c:163
BOOLEAN EFIAPI Sha1Init(OUT VOID *Sha1Context)
Definition: CryptSha1.c:46
UINTN EFIAPI Sha1GetContextSize(VOID)
Definition: CryptSha1.c:22
BOOLEAN EFIAPI Sha1Update(IN OUT VOID *Sha1Context, IN CONST VOID *Data, IN UINTN DataSize)
Definition: CryptSha1.c:115
VOID EFIAPI FreePool(IN VOID *Buffer)
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
EFI_STATUS EFIAPI TpmCommHashAll(IN CONST UINT8 *Data, IN UINTN DataLen, OUT TPM_DIGEST *Digest)
Definition: TpmComm.c:23
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
#define EFI_SUCCESS
Definition: UefiBaseType.h:112