2 Unified Hash API Defines
4 This API when called will calculate the Hash using the
5 hashing algorithm specified by PcdHashApiLibPolicy.
7 Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
8 SPDX-License-Identifier: BSD-2-Clause-Patent
12 #ifndef __HASH_API_LIB_H_
13 #define __HASH_API_LIB_H_
15 typedef VOID
*HASH_API_CONTEXT
;
18 Retrieves the size, in bytes, of the context buffer required for hash operations.
20 @return The size, in bytes, of the context buffer required for hash operations.
24 HashApiGetContextSize (
31 @param[out] HashContext Hash context.
33 @retval TRUE Hash start and HashHandle returned.
34 @retval FALSE Hash Init unsuccessful.
39 OUT HASH_API_CONTEXT HashContext
43 Makes a copy of an existing hash context.
45 @param[in] HashContext Hash context.
46 @param[out] NewHashContext New copy of hash context.
48 @retval TRUE Hash context copy succeeded.
49 @retval FALSE Hash context copy failed.
54 IN HASH_API_CONTEXT HashContext
,
55 OUT HASH_API_CONTEXT NewHashContext
61 @param[in] HashContext Hash context.
62 @param[in] DataToHash Data to be hashed.
63 @param[in] DataToHashLen Data size.
65 @retval TRUE Hash updated.
66 @retval FALSE Hash updated unsuccessful.
71 IN HASH_API_CONTEXT HashContext
,
73 IN UINTN DataToHashLen
79 @param[in] HashContext Hash context.
80 @param[out] Digest Hash Digest.
82 @retval TRUE Hash complete and Digest is returned.
83 @retval FALSE Hash complete unsuccessful.
88 IN HASH_API_CONTEXT HashContext
,
93 Computes hash message digest of a input data buffer.
95 @param[in] DataToHash Data to be hashed.
96 @param[in] DataToHashLen Data size.
97 @param[out] Digest Hash Digest.
99 @retval TRUE Hash digest computation succeeded.
100 @retval FALSE Hash digest computation failed.
105 IN CONST VOID
*DataToHash
,
106 IN UINTN DataToHashLen
,