TianoCore EDK2 master
Loading...
Searching...
No Matches
HashInstanceLibSha256.c File Reference

Go to the source code of this file.

Functions

VOID Tpm2SetSha256ToDigestList (IN TPML_DIGEST_VALUES *DigestList, IN UINT8 *Sha256Digest)
 
EFI_STATUS EFIAPI Sha256HashInit (OUT HASH_HANDLE *HashHandle)
 
EFI_STATUS EFIAPI Sha256HashUpdate (IN HASH_HANDLE HashHandle, IN VOID *DataToHash, IN UINTN DataToHashLen)
 
EFI_STATUS EFIAPI Sha256HashFinal (IN HASH_HANDLE HashHandle, OUT TPML_DIGEST_VALUES *DigestList)
 
EFI_STATUS EFIAPI HashInstanceLibSha256Constructor (VOID)
 

Variables

HASH_INTERFACE mSha256InternalHashInstance
 

Detailed Description

This library is BaseCrypto SHA256 hash instance. It can be registered to BaseCrypto router, to serve as hash engine.

Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file HashInstanceLibSha256.c.

Function Documentation

◆ HashInstanceLibSha256Constructor()

EFI_STATUS EFIAPI HashInstanceLibSha256Constructor ( VOID  )

The function register SHA256 instance.

Return values
EFI_SUCCESSSHA256 instance is registered, or system does not support register SHA256 instance

Definition at line 135 of file HashInstanceLibSha256.c.

◆ Sha256HashFinal()

EFI_STATUS EFIAPI Sha256HashFinal ( IN HASH_HANDLE  HashHandle,
OUT TPML_DIGEST_VALUES DigestList 
)

Complete hash sequence complete.

Parameters
HashHandleHash handle.
DigestListDigest list.
Return values
EFI_SUCCESSHash sequence complete and DigestList is returned.

Definition at line 103 of file HashInstanceLibSha256.c.

◆ Sha256HashInit()

EFI_STATUS EFIAPI Sha256HashInit ( OUT HASH_HANDLE *  HashHandle)

Start hash sequence.

Parameters
HashHandleHash handle.
Return values
EFI_SUCCESSHash sequence start and HandleHandle returned.
EFI_OUT_OF_RESOURCESNo enough resource to start hash.

Definition at line 50 of file HashInstanceLibSha256.c.

◆ Sha256HashUpdate()

EFI_STATUS EFIAPI Sha256HashUpdate ( IN HASH_HANDLE  HashHandle,
IN VOID *  DataToHash,
IN UINTN  DataToHashLen 
)

Update hash sequence data.

Parameters
HashHandleHash handle.
DataToHashData to be hashed.
DataToHashLenData size.
Return values
EFI_SUCCESSHash sequence updated.

Definition at line 79 of file HashInstanceLibSha256.c.

◆ Tpm2SetSha256ToDigestList()

VOID Tpm2SetSha256ToDigestList ( IN TPML_DIGEST_VALUES DigestList,
IN UINT8 *  Sha256Digest 
)

The function set SHA256 to digest list.

Parameters
DigestListdigest list
Sha256DigestSHA256 digest

Definition at line 26 of file HashInstanceLibSha256.c.

Variable Documentation

◆ mSha256InternalHashInstance

HASH_INTERFACE mSha256InternalHashInstance
Initial value:
= {
HASH_ALGORITHM_SHA256_GUID,
}
EFI_STATUS EFIAPI Sha256HashUpdate(IN HASH_HANDLE HashHandle, IN VOID *DataToHash, IN UINTN DataToHashLen)
EFI_STATUS EFIAPI Sha256HashInit(OUT HASH_HANDLE *HashHandle)
EFI_STATUS EFIAPI Sha256HashFinal(IN HASH_HANDLE HashHandle, OUT TPML_DIGEST_VALUES *DigestList)

Definition at line 121 of file HashInstanceLibSha256.c.