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

Go to the source code of this file.

Functions

VOID Tpm2SetSm3ToDigestList (IN TPML_DIGEST_VALUES *DigestList, IN UINT8 *Sm3Digest)
 
EFI_STATUS EFIAPI Sm3HashInit (OUT HASH_HANDLE *HashHandle)
 
EFI_STATUS EFIAPI Sm3HashUpdate (IN HASH_HANDLE HashHandle, IN VOID *DataToHash, IN UINTN DataToHashLen)
 
EFI_STATUS EFIAPI Sm3HashFinal (IN HASH_HANDLE HashHandle, OUT TPML_DIGEST_VALUES *DigestList)
 
EFI_STATUS EFIAPI HashInstanceLibSm3Constructor (VOID)
 

Variables

HASH_INTERFACE mSm3InternalHashInstance
 

Detailed Description

BaseCrypto SM3 hash instance library. It can be registered to BaseCrypto router, to serve as hash engine.

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

Definition in file HashInstanceLibSm3.c.

Function Documentation

◆ HashInstanceLibSm3Constructor()

EFI_STATUS EFIAPI HashInstanceLibSm3Constructor ( VOID  )

The function register SM3 instance.

Return values
EFI_SUCCESSSM3 instance is registered, or system dose not support register SM3 instance

Definition at line 136 of file HashInstanceLibSm3.c.

◆ Sm3HashFinal()

EFI_STATUS EFIAPI Sm3HashFinal ( 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 104 of file HashInstanceLibSm3.c.

◆ Sm3HashInit()

EFI_STATUS EFIAPI Sm3HashInit ( 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 HashInstanceLibSm3.c.

◆ Sm3HashUpdate()

EFI_STATUS EFIAPI Sm3HashUpdate ( 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 80 of file HashInstanceLibSm3.c.

◆ Tpm2SetSm3ToDigestList()

VOID Tpm2SetSm3ToDigestList ( IN TPML_DIGEST_VALUES DigestList,
IN UINT8 *  Sm3Digest 
)

The function set SM3 to digest list.

Parameters
DigestListdigest list
Sm3DigestSM3 digest

Definition at line 25 of file HashInstanceLibSm3.c.

Variable Documentation

◆ mSm3InternalHashInstance

HASH_INTERFACE mSm3InternalHashInstance
Initial value:
= {
HASH_ALGORITHM_SM3_256_GUID,
}
EFI_STATUS EFIAPI Sm3HashFinal(IN HASH_HANDLE HashHandle, OUT TPML_DIGEST_VALUES *DigestList)
EFI_STATUS EFIAPI Sm3HashInit(OUT HASH_HANDLE *HashHandle)
EFI_STATUS EFIAPI Sm3HashUpdate(IN HASH_HANDLE HashHandle, IN VOID *DataToHash, IN UINTN DataToHashLen)

Definition at line 122 of file HashInstanceLibSm3.c.