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

Go to the source code of this file.

Functions

VOID Tpm2SetSha512ToDigestList (IN TPML_DIGEST_VALUES *DigestList, IN UINT8 *Sha512Digest)
 
EFI_STATUS EFIAPI Sha512HashInit (OUT HASH_HANDLE *HashHandle)
 
EFI_STATUS EFIAPI Sha512HashUpdate (IN HASH_HANDLE HashHandle, IN VOID *DataToHash, IN UINTN DataToHashLen)
 
EFI_STATUS EFIAPI Sha512HashFinal (IN HASH_HANDLE HashHandle, OUT TPML_DIGEST_VALUES *DigestList)
 
EFI_STATUS EFIAPI HashInstanceLibSha512Constructor (VOID)
 

Variables

HASH_INTERFACE mSha512InternalHashInstance
 

Detailed Description

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

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

Definition in file HashInstanceLibSha512.c.

Function Documentation

◆ HashInstanceLibSha512Constructor()

EFI_STATUS EFIAPI HashInstanceLibSha512Constructor ( VOID  )

The function register SHA512 instance.

Return values
EFI_SUCCESSSHA512 instance is registered, or system does not support register SHA512 instance

Definition at line 134 of file HashInstanceLibSha512.c.

◆ Sha512HashFinal()

EFI_STATUS EFIAPI Sha512HashFinal ( 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 102 of file HashInstanceLibSha512.c.

◆ Sha512HashInit()

EFI_STATUS EFIAPI Sha512HashInit ( 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 49 of file HashInstanceLibSha512.c.

◆ Sha512HashUpdate()

EFI_STATUS EFIAPI Sha512HashUpdate ( 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 78 of file HashInstanceLibSha512.c.

◆ Tpm2SetSha512ToDigestList()

VOID Tpm2SetSha512ToDigestList ( IN TPML_DIGEST_VALUES DigestList,
IN UINT8 *  Sha512Digest 
)

The function set SHA512 to digest list.

Parameters
DigestListdigest list
Sha512DigestSHA512 digest

Definition at line 25 of file HashInstanceLibSha512.c.

Variable Documentation

◆ mSha512InternalHashInstance

HASH_INTERFACE mSha512InternalHashInstance
Initial value:
= {
HASH_ALGORITHM_SHA512_GUID,
}
EFI_STATUS EFIAPI Sha512HashFinal(IN HASH_HANDLE HashHandle, OUT TPML_DIGEST_VALUES *DigestList)
EFI_STATUS EFIAPI Sha512HashUpdate(IN HASH_HANDLE HashHandle, IN VOID *DataToHash, IN UINTN DataToHashLen)
EFI_STATUS EFIAPI Sha512HashInit(OUT HASH_HANDLE *HashHandle)

Definition at line 120 of file HashInstanceLibSha512.c.