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/HobLib.h>
#include <Library/HashLib.h>
#include <Guid/ZeroGuid.h>
#include "HashLibBaseCryptoRouterCommon.h"
Go to the source code of this file.
Data Structures | |
struct | HASH_INTERFACE_HOB |
Macros | |
#define | HASH_LIB_PEI_ROUTER_GUID { 0x84681c08, 0x6873, 0x46f3, { 0x8b, 0xb7, 0xab, 0x66, 0x18, 0x95, 0xa1, 0xb3 } } |
Functions | |
HASH_INTERFACE_HOB * | InternalGetHashInterfaceHob (EFI_GUID *Identifier) |
HASH_INTERFACE_HOB * | InternalCreateHashInterfaceHob (EFI_GUID *Identifier) |
VOID | CheckSupportedHashMaskMismatch (IN HASH_INTERFACE_HOB *HashInterfaceHobCurrent) |
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) |
EFI_STATUS EFIAPI | HashLibBaseCryptoRouterPeiConstructor (IN EFI_PEI_FILE_HANDLE FileHandle, IN CONST EFI_PEI_SERVICES **PeiServices) |
Variables | |
EFI_GUID | mHashLibPeiRouterGuid = HASH_LIB_PEI_ROUTER_GUID |
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 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file HashLibBaseCryptoRouterPei.c.
#define HASH_LIB_PEI_ROUTER_GUID { 0x84681c08, 0x6873, 0x46f3, { 0x8b, 0xb7, 0xab, 0x66, 0x18, 0x95, 0xa1, 0xb3 } } |
Definition at line 24 of file HashLibBaseCryptoRouterPei.c.
VOID CheckSupportedHashMaskMismatch | ( | IN HASH_INTERFACE_HOB * | HashInterfaceHobCurrent | ) |
Check mismatch of supported HashMask between modules that may link different HashInstanceLib instances.
HashInterfaceHobCurrent | Pointer to hash interface hob for CURRENT module. |
Definition at line 102 of file HashLibBaseCryptoRouterPei.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 286 of file HashLibBaseCryptoRouterPei.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 227 of file HashLibBaseCryptoRouterPei.c.
EFI_STATUS EFIAPI HashLibBaseCryptoRouterPeiConstructor | ( | IN EFI_PEI_FILE_HANDLE | FileHandle, |
IN CONST EFI_PEI_SERVICES ** | PeiServices | ||
) |
The constructor function of HashLibBaseCryptoRouterPei.
FileHandle | The handle of FFS header the loaded driver. |
PeiServices | The pointer to the PEI services. |
EFI_SUCCESS | The constructor executes successfully. |
EFI_OUT_OF_RESOURCES | There is no enough resource for the constructor. |
Definition at line 395 of file HashLibBaseCryptoRouterPei.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 134 of file HashLibBaseCryptoRouterPei.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 180 of file HashLibBaseCryptoRouterPei.c.
HASH_INTERFACE_HOB * InternalCreateHashInterfaceHob | ( | EFI_GUID * | Identifier | ) |
This function creates hash interface hob.
Identifier | Identifier to create hash interface hob. |
hash | interface hob. |
Definition at line 83 of file HashLibBaseCryptoRouterPei.c.
HASH_INTERFACE_HOB * InternalGetHashInterfaceHob | ( | EFI_GUID * | Identifier | ) |
This function gets hash interface hob.
Identifier | Identifier to get hash interface hob. |
hash | interface hob. |
Definition at line 51 of file HashLibBaseCryptoRouterPei.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 326 of file HashLibBaseCryptoRouterPei.c.
EFI_GUID mHashLibPeiRouterGuid = HASH_LIB_PEI_ROUTER_GUID |
Definition at line 27 of file HashLibBaseCryptoRouterPei.c.