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/PcdLib.h>
#include <Library/HashLib.h>
#include <Protocol/Tcg2Protocol.h>
#include "HashLibBaseCryptoRouterCommon.h"
Go to the source code of this file.
Functions | |
VOID | CheckSupportedHashMaskMismatch (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 | Tpm2ExtendNvIndex (TPMI_RH_NV_INDEX NvIndex, UINT16 DataSize, BYTE *Data) |
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) |
EFI_STATUS EFIAPI | HashLibBaseCryptoRouterDxeConstructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
Variables | |
HASH_INTERFACE | mHashInterface [HASH_COUNT] |
UINTN | mHashInterfaceCount = 0 |
UINT32 | mSupportedHashMaskLast = 0 |
UINT32 | mSupportedHashMaskCurrent = 0 |
This library is BaseCrypto router. It will redirect hash request to each individual hash handler registered, such as SHA1, SHA256. Platform can use PcdTpm2HashMask to mask some hash engines.
Copyright (c) 2013 - 2024, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file HashLibBaseCryptoRouterDxe.c.
VOID CheckSupportedHashMaskMismatch | ( | VOID | ) |
Check mismatch of supported HashMask between modules that may link different HashInstanceLib instances.
Definition at line 39 of file HashLibBaseCryptoRouterDxe.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 265 of file HashLibBaseCryptoRouterDxe.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 188 of file HashLibBaseCryptoRouterDxe.c.
EFI_STATUS EFIAPI HashLibBaseCryptoRouterDxeConstructor | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
The constructor function of HashLibBaseCryptoRouterDxe.
ImageHandle | The firmware allocated handle for the EFI image. |
SystemTable | A pointer to the EFI System Table. |
EFI_SUCCESS | The constructor executed correctly. |
Definition at line 358 of file HashLibBaseCryptoRouterDxe.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 HashLibBaseCryptoRouterDxe.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 104 of file HashLibBaseCryptoRouterDxe.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 299 of file HashLibBaseCryptoRouterDxe.c.
EFI_STATUS EFIAPI Tpm2ExtendNvIndex | ( | TPMI_RH_NV_INDEX | NvIndex, |
UINT16 | DataSize, | ||
BYTE * | Data | ||
) |
Extend to TPM NvIndex.
[in] | NvIndex | The NV Index of the area to extend. |
[in] | DataSize | The data size to extend. |
[in] | Data | The data to extend. |
EFI_SUCCESS | Operation completed successfully. |
EFI_DEVICE_ERROR | The command was unsuccessful. |
EFI_NOT_FOUND | The command was returned successfully, but NvIndex is not found. |
Definition at line 145 of file HashLibBaseCryptoRouterDxe.c.
HASH_INTERFACE mHashInterface[HASH_COUNT] |
Definition at line 23 of file HashLibBaseCryptoRouterDxe.c.
UINTN mHashInterfaceCount = 0 |
Definition at line 28 of file HashLibBaseCryptoRouterDxe.c.
UINT32 mSupportedHashMaskCurrent = 0 |
Definition at line 31 of file HashLibBaseCryptoRouterDxe.c.
UINT32 mSupportedHashMaskLast = 0 |
Definition at line 30 of file HashLibBaseCryptoRouterDxe.c.