]>
git.proxmox.com Git - mirror_edk2.git/blob - SecurityPkg/Library/TpmCommLib/TpmComm.c
2 Basic TPM command functions.
4 Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #include "CommonHeader.h"
18 Single function calculates SHA1 digest value for all raw data. It
19 combines Sha1Init(), Sha1Update() and Sha1Final().
21 @param[in] Data Raw data to be digested.
22 @param[in] DataLen Size of the raw data.
23 @param[out] Digest Pointer to a buffer that stores the final digest.
25 @retval EFI_SUCCESS Always successfully calculate the final digest.
32 OUT TPM_DIGEST
*Digest
38 CtxSize
= Sha1GetContextSize ();
39 Sha1Ctx
= AllocatePool (CtxSize
);
40 ASSERT (Sha1Ctx
!= NULL
);
43 Sha1Update (Sha1Ctx
, Data
, DataLen
);
44 Sha1Final (Sha1Ctx
, (UINT8
*)Digest
);