SecurityPkg[all]
0.98
|
Data Structures | |
struct | HASH_INTERFACE |
Macros | |
#define | HASH_ALGORITHM_SHA1_GUID EFI_HASH_ALGORITHM_SHA1_GUID |
#define | HASH_ALGORITHM_SHA256_GUID EFI_HASH_ALGORITHM_SHA256_GUID |
#define | HASH_ALGORITHM_SHA384_GUID EFI_HASH_ALGORITHM_SHA384_GUID |
#define | HASH_ALGORITHM_SHA512_GUID EFI_HASH_ALGORITHM_SHA512_GUID |
#define | HASH_ALGORITHM_SM3_256_GUID |
Typedefs | |
typedef UINTN | HASH_HANDLE |
typedef IN VOID * | DataToHash |
typedef IN VOID IN UINTN | DataToHashLen |
typedef OUT TPML_DIGEST_VALUES * | DigestList |
Functions | |
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) |
typedef | EFI_STATUS (EFIAPI *HASH_INIT)(OUT HASH_HANDLE *HashHandle) |
EFI_STATUS EFIAPI | RegisterHashInterfaceLib (IN HASH_INTERFACE *HashInterface) |
This library abstract TPM2 hash calculation. The platform can choose multiply hash, while caller just need invoke these API. Then all hash value will be returned and/or extended.
Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
#define HASH_ALGORITHM_SHA1_GUID EFI_HASH_ALGORITHM_SHA1_GUID |
#define HASH_ALGORITHM_SHA256_GUID EFI_HASH_ALGORITHM_SHA256_GUID |
#define HASH_ALGORITHM_SHA384_GUID EFI_HASH_ALGORITHM_SHA384_GUID |
#define HASH_ALGORITHM_SHA512_GUID EFI_HASH_ALGORITHM_SHA512_GUID |
#define HASH_ALGORITHM_SM3_256_GUID |
typedef IN VOID* DataToHash |
typedef IN VOID IN UINTN DataToHashLen |
typedef OUT TPML_DIGEST_VALUES* DigestList |
typedef UINTN HASH_HANDLE |
typedef EFI_STATUS | ( | EFIAPI * | HASH_FINAL | ) |
Start hash sequence.
HashHandle | Hash handle. |
EFI_SUCCESS | Hash sequence start and HandleHandle returned. |
EFI_OUT_OF_RESOURCES | No enough resource to start hash. |
Update hash sequence data.
HashHandle | Hash handle. |
DataToHash | Data to be hashed. |
DataToHashLen | Data size. |
EFI_SUCCESS | Hash sequence updated. |
Complete hash sequence complete.
HashHandle | Hash handle. |
DigestList | Digest list. |
EFI_SUCCESS | Hash sequence complete and DigestList is returned. |
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. |
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. |
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. |
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. |
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. |