3 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
15 EFI Speaker Interface Protocol
21 #ifndef _PEI_SHA256_HASH_H
22 #define _PEI_SHA256_HASH_H
25 // Global ID Speaker Interface
27 #define PEI_SHA256_HASH_PPI_GUID \
29 0x950e191b, 0x8524, 0x4f51, 0x80, 0xa1, 0x5c, 0x4f, 0x1b, 0x3, 0xf3, 0x5c \
32 typedef struct _PEI_SHA256_HASH_PPI PEI_SHA256_HASH_PPI
;
35 @return The size, in bytes, of the context buffer required for hash operations.
40 (EFIAPI
*HASH_GET_CONTEXT_SIZE
)(
45 Initializes user-supplied memory pointed by HashContext as hash context for
48 If HashContext is NULL, then ASSERT().
50 @param[in, out] HashContext Pointer to Context being initialized.
52 @retval TRUE HASH context initialization succeeded.
53 @retval FALSE HASH context initialization failed.
59 IN OUT VOID
*HashContext
63 Performs digest on a data buffer of the specified length. This function can
64 be called multiple times to compute the digest of long or discontinuous data streams.
66 If HashContext is NULL, then ASSERT().
68 @param[in, out] HashContext Pointer to the MD5 context.
69 @param[in] Data Pointer to the buffer containing the data to be hashed.
70 @param[in] DataLength Length of Data buffer in bytes.
72 @retval TRUE HASH data digest succeeded.
73 @retval FALSE Invalid HASH context. After HashFinal function has been called, the
74 HASH context cannot be reused.
79 (EFIAPI
*HASH_UPDATE
)(
80 IN OUT VOID
*HashContext
,
86 Completes hash computation and retrieves the digest value into the specified
87 memory. After this function has been called, the context cannot be used again.
89 If HashContext is NULL, then ASSERT().
90 If HashValue is NULL, then ASSERT().
92 @param[in, out] HashContext Pointer to the MD5 context
93 @param[out] HashValue Pointer to a buffer that receives the HASH digest
96 @retval TRUE HASH digest computation succeeded.
97 @retval FALSE HASH digest computation failed.
102 (EFIAPI
*HASH_FINAL
)(
103 IN OUT VOID
*HashContext
,
110 typedef struct _PEI_SHA256_HASH_PPI
{
112 // Pointer to Hash GetContentSize function
114 HASH_GET_CONTEXT_SIZE GetContextSize
;
116 // Pointer to Hash Init function
120 // Pointer to Hash Update function
122 HASH_UPDATE HashUpdate
;
124 // Pointer to Hash Final function
126 HASH_FINAL HashFinal
;
128 } PEI_SHA256_HASH_PPI
;
130 extern EFI_GUID gPeiSha256HashPpiGuid
;