]>
git.proxmox.com Git - mirror_edk2.git/blob - SecurityPkg/Library/TpmCommLib/TpmComm.c
2 Basic TPM command functions.
4 Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #include "CommonHeader.h"
12 Single function calculates SHA1 digest value for all raw data. It
13 combines Sha1Init(), Sha1Update() and Sha1Final().
15 @param[in] Data Raw data to be digested.
16 @param[in] DataLen Size of the raw data.
17 @param[out] Digest Pointer to a buffer that stores the final digest.
19 @retval EFI_SUCCESS Always successfully calculate the final digest.
26 OUT TPM_DIGEST
*Digest
32 CtxSize
= Sha1GetContextSize ();
33 Sha1Ctx
= AllocatePool (CtxSize
);
34 ASSERT (Sha1Ctx
!= NULL
);
37 Sha1Update (Sha1Ctx
, Data
, DataLen
);
38 Sha1Final (Sha1Ctx
, (UINT8
*)Digest
);