CryptoPkg[all]  0.98
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
HashApiLib.h File Reference

Typedefs

typedef VOID * HASH_API_CONTEXT
 

Functions

UINTN EFIAPI HashApiGetContextSize (VOID)
 
BOOLEAN EFIAPI HashApiInit (OUT HASH_API_CONTEXT HashContext)
 
BOOLEAN EFIAPI HashApiDuplicate (IN HASH_API_CONTEXT HashContext, OUT HASH_API_CONTEXT NewHashContext)
 
BOOLEAN EFIAPI HashApiUpdate (IN HASH_API_CONTEXT HashContext, IN VOID *DataToHash, IN UINTN DataToHashLen)
 
BOOLEAN EFIAPI HashApiFinal (IN HASH_API_CONTEXT HashContext, OUT UINT8 *Digest)
 
BOOLEAN EFIAPI HashApiHashAll (IN CONST VOID *DataToHash, IN UINTN DataToHashLen, OUT UINT8 *Digest)
 

Detailed Description

Unified Hash API Defines

This API when called will calculate the Hash using the hashing algorithm specified by PcdHashApiLibPolicy.

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

Typedef Documentation

typedef VOID* HASH_API_CONTEXT

Function Documentation

BOOLEAN EFIAPI HashApiDuplicate ( IN HASH_API_CONTEXT  HashContext,
OUT HASH_API_CONTEXT  NewHashContext 
)

Makes a copy of an existing hash context.

Parameters
[in]HashContextHash context.
[out]NewHashContextNew copy of hash context.
Return values
TRUEHash context copy succeeded.
FALSEHash context copy failed.
BOOLEAN EFIAPI HashApiFinal ( IN HASH_API_CONTEXT  HashContext,
OUT UINT8 *  Digest 
)

Hash complete.

Parameters
[in]HashContextHash context.
[out]DigestHash Digest.
Return values
TRUEHash complete and Digest is returned.
FALSEHash complete unsuccessful.
UINTN EFIAPI HashApiGetContextSize ( VOID  )

Retrieves the size, in bytes, of the context buffer required for hash operations.

Returns
The size, in bytes, of the context buffer required for hash operations.
BOOLEAN EFIAPI HashApiHashAll ( IN CONST VOID *  DataToHash,
IN UINTN  DataToHashLen,
OUT UINT8 *  Digest 
)

Computes hash message digest of a input data buffer.

Parameters
[in]DataToHashData to be hashed.
[in]DataToHashLenData size.
[out]DigestHash Digest.
Return values
TRUEHash digest computation succeeded.
FALSEHash digest computation failed.
BOOLEAN EFIAPI HashApiInit ( OUT HASH_API_CONTEXT  HashContext)

Init hash sequence.

Parameters
[out]HashContextHash context.
Return values
TRUEHash start and HashHandle returned.
FALSEHash Init unsuccessful.
BOOLEAN EFIAPI HashApiUpdate ( IN HASH_API_CONTEXT  HashContext,
IN VOID *  DataToHash,
IN UINTN  DataToHashLen 
)

Update hash data.

Parameters
[in]HashContextHash context.
[in]DataToHashData to be hashed.
[in]DataToHashLenData size.
Return values
TRUEHash updated.
FALSEHash updated unsuccessful.