3 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials are licensed and made available under
6 the terms and conditions of the BSD License that accompanies this distribution.
7 The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php.
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
20 EFI Speaker Interface Protocol
26 #ifndef _PEI_SHA256_HASH_H
27 #define _PEI_SHA256_HASH_H
30 // Global ID Speaker Interface
32 #define PEI_SHA256_HASH_PPI_GUID \
34 0x950e191b, 0x8524, 0x4f51, 0x80, 0xa1, 0x5c, 0x4f, 0x1b, 0x3, 0xf3, 0x5c \
37 typedef struct _PEI_SHA256_HASH_PPI PEI_SHA256_HASH_PPI
;
40 @return The size, in bytes, of the context buffer required for hash operations.
45 (EFIAPI
*HASH_GET_CONTEXT_SIZE
)(
50 Initializes user-supplied memory pointed by HashContext as hash context for
53 If HashContext is NULL, then ASSERT().
55 @param[in, out] HashContext Pointer to Context being initialized.
57 @retval TRUE HASH context initialization succeeded.
58 @retval FALSE HASH context initialization failed.
64 IN OUT VOID
*HashContext
68 Performs digest on a data buffer of the specified length. This function can
69 be called multiple times to compute the digest of long or discontinuous data streams.
71 If HashContext is NULL, then ASSERT().
73 @param[in, out] HashContext Pointer to the MD5 context.
74 @param[in] Data Pointer to the buffer containing the data to be hashed.
75 @param[in] DataLength Length of Data buffer in bytes.
77 @retval TRUE HASH data digest succeeded.
78 @retval FALSE Invalid HASH context. After HashFinal function has been called, the
79 HASH context cannot be reused.
84 (EFIAPI
*HASH_UPDATE
)(
85 IN OUT VOID
*HashContext
,
91 Completes hash computation and retrieves the digest value into the specified
92 memory. After this function has been called, the context cannot be used again.
94 If HashContext is NULL, then ASSERT().
95 If HashValue is NULL, then ASSERT().
97 @param[in, out] HashContext Pointer to the MD5 context
98 @param[out] HashValue Pointer to a buffer that receives the HASH digest
101 @retval TRUE HASH digest computation succeeded.
102 @retval FALSE HASH digest computation failed.
107 (EFIAPI
*HASH_FINAL
)(
108 IN OUT VOID
*HashContext
,
115 typedef struct _PEI_SHA256_HASH_PPI
{
117 // Pointer to Hash GetContentSize function
119 HASH_GET_CONTEXT_SIZE GetContextSize
;
121 // Pointer to Hash Init function
125 // Pointer to Hash Update function
127 HASH_UPDATE HashUpdate
;
129 // Pointer to Hash Final function
131 HASH_FINAL HashFinal
;
133 } PEI_SHA256_HASH_PPI
;
135 extern EFI_GUID gPeiSha256HashPpiGuid
;