TianoCore EDK2 master
|
#include <PiPei.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/Tpm2CommandLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/HashLib.h>
#include <Library/PcdLib.h>
Go to the source code of this file.
Data Structures | |
struct | TPM2_HASH_MASK |
Functions | |
TPM_ALG_ID | Tpm2GetAlgoFromHashMask (VOID) |
EFI_STATUS EFIAPI | HashStart (OUT HASH_HANDLE *HashHandle) |
EFI_STATUS EFIAPI | HashUpdate (IN HASH_HANDLE HashHandle, IN VOID *DataToHash, IN UINTN DataToHashLen) |
EFI_STATUS EFIAPI | HashCompleteAndExtend (IN HASH_HANDLE HashHandle, IN TPMI_DH_PCR PcrIndex, IN VOID *DataToHash, IN UINTN DataToHashLen, OUT TPML_DIGEST_VALUES *DigestList) |
EFI_STATUS EFIAPI | HashAndExtend (IN TPMI_DH_PCR PcrIndex, IN VOID *DataToHash, IN UINTN DataToHashLen, OUT TPML_DIGEST_VALUES *DigestList) |
EFI_STATUS EFIAPI | RegisterHashInterfaceLib (IN HASH_INTERFACE *HashInterface) |
Variables | |
TPM2_HASH_MASK | mTpm2HashMask [] |
This library uses TPM2 device to calculation hash.
Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2015 Hewlett Packard Enterprise Development LP
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file HashLibTpm2.c.
EFI_STATUS EFIAPI HashAndExtend | ( | IN TPMI_DH_PCR | PcrIndex, |
IN VOID * | DataToHash, | ||
IN UINTN | DataToHashLen, | ||
OUT TPML_DIGEST_VALUES * | DigestList | ||
) |
Hash data and extend to PCR.
PcrIndex | PCR to be extended. |
DataToHash | Data to be hashed. |
DataToHashLen | Data size. |
DigestList | Digest list. |
EFI_SUCCESS | Hash data and DigestList is returned. |
Definition at line 225 of file HashLibTpm2.c.
EFI_STATUS EFIAPI HashCompleteAndExtend | ( | IN HASH_HANDLE | HashHandle, |
IN TPMI_DH_PCR | PcrIndex, | ||
IN VOID * | DataToHash, | ||
IN UINTN | DataToHashLen, | ||
OUT TPML_DIGEST_VALUES * | DigestList | ||
) |
Hash sequence complete and extend to PCR.
HashHandle | Hash handle. |
PcrIndex | PCR to be extended. |
DataToHash | Data to be hashed. |
DataToHashLen | Data size. |
DigestList | Digest list. |
EFI_SUCCESS | Hash sequence complete and DigestList is returned. |
Definition at line 142 of file HashLibTpm2.c.
EFI_STATUS EFIAPI HashStart | ( | OUT HASH_HANDLE * | HashHandle | ) |
Start hash sequence.
HashHandle | Hash handle. |
EFI_SUCCESS | Hash sequence start and HandleHandle returned. |
EFI_OUT_OF_RESOURCES | No enough resource to start hash. |
Definition at line 64 of file HashLibTpm2.c.
EFI_STATUS EFIAPI HashUpdate | ( | IN HASH_HANDLE | HashHandle, |
IN VOID * | DataToHash, | ||
IN UINTN | DataToHashLen | ||
) |
Update hash sequence data.
HashHandle | Hash handle. |
DataToHash | Data to be hashed. |
DataToHashLen | Data size. |
EFI_SUCCESS | Hash sequence updated. |
Definition at line 93 of file HashLibTpm2.c.
EFI_STATUS EFIAPI RegisterHashInterfaceLib | ( | IN HASH_INTERFACE * | HashInterface | ) |
This service register Hash.
HashInterface | Hash interface |
EFI_SUCCESS | This hash interface is registered successfully. |
EFI_UNSUPPORTED | System does not support register this interface. |
EFI_ALREADY_STARTED | System already register this interface. |
Definition at line 337 of file HashLibTpm2.c.
TPM_ALG_ID Tpm2GetAlgoFromHashMask | ( | VOID | ) |
The function get algorithm from hash mask info.
Definition at line 37 of file HashLibTpm2.c.
TPM2_HASH_MASK mTpm2HashMask[] |
Definition at line 24 of file HashLibTpm2.c.