SecurityPkg/Library/HashInstanceLibSha256/HashInstanceLibSha256.c File Reference


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

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

Copyright (c) 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.


Function Documentation

EFI_STATUS EFIAPI HashInstanceLibSha256Constructor ( VOID   ) 

The function register SHA256 instance.

Return values:
EFI_SUCCESS SHA256 instance is registered, or system dose not surpport registr SHA256 instance

References EFI_STATUS(), and RegisterHashInterfaceLib().

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

Complete hash sequence complete.

Parameters:
HashHandle Hash handle.
DigestList Digest list.
Return values:
EFI_SUCCESS Hash sequence complete and DigestList is returned.

References SHA256_DIGEST_SIZE, and Tpm2SetSha256ToDigestList().

EFI_STATUS EFIAPI Sha256HashInit ( OUT HASH_HANDLE HashHandle  ) 

Start hash sequence.

Parameters:
HashHandle Hash handle.
Return values:
EFI_SUCCESS Hash sequence start and HandleHandle returned.
EFI_OUT_OF_RESOURCES No enough resource to start hash.

References UINTN().

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

Update hash sequence data.

Parameters:
HashHandle Hash handle.
DataToHash Data to be hashed.
DataToHashLen Data size.
Return values:
EFI_SUCCESS Hash sequence updated.

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

The function set SHA256 to digest list.

Parameters:
DigestList digest list
Sha256Digest SHA256 digest

References SHA256_DIGEST_SIZE.

Referenced by Sha256HashFinal().


Variable Documentation


Generated on Thu Sep 24 23:44:24 2015 for SecurityPkg[ALL] by  doxygen 1.5.7.1