]> git.proxmox.com Git - mirror_edk2.git/blob - Vlv2TbltDevicePkg/Include/Ppi/Sha256Hash.h
1c9b2b9ea17dd0ad6c6655458e1be6e100ac8046
[mirror_edk2.git] / Vlv2TbltDevicePkg / Include / Ppi / Sha256Hash.h
1 /*++
2
3 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
4
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7
8
9 Module Name:
10
11 Speaker.h
12
13 Abstract:
14
15 EFI Speaker Interface Protocol
16
17
18
19 --*/
20
21 #ifndef _PEI_SHA256_HASH_H
22 #define _PEI_SHA256_HASH_H
23
24 //
25 // Global ID Speaker Interface
26 //
27 #define PEI_SHA256_HASH_PPI_GUID \
28 { \
29 0x950e191b, 0x8524, 0x4f51, 0x80, 0xa1, 0x5c, 0x4f, 0x1b, 0x3, 0xf3, 0x5c \
30 }
31
32 typedef struct _PEI_SHA256_HASH_PPI PEI_SHA256_HASH_PPI;
33
34 /**
35 @return The size, in bytes, of the context buffer required for hash operations.
36
37 **/
38 typedef
39 UINTN
40 (EFIAPI *HASH_GET_CONTEXT_SIZE)(
41 VOID
42 );
43
44 /**
45 Initializes user-supplied memory pointed by HashContext as hash context for
46 subsequent use.
47
48 If HashContext is NULL, then ASSERT().
49
50 @param[in, out] HashContext Pointer to Context being initialized.
51
52 @retval TRUE HASH context initialization succeeded.
53 @retval FALSE HASH context initialization failed.
54
55 **/
56 typedef
57 BOOLEAN
58 (EFIAPI *HASH_INIT)(
59 IN OUT VOID *HashContext
60 );
61
62 /**
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.
65
66 If HashContext is NULL, then ASSERT().
67
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.
71
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.
75
76 **/
77 typedef
78 BOOLEAN
79 (EFIAPI *HASH_UPDATE)(
80 IN OUT VOID *HashContext,
81 IN CONST VOID *Data,
82 IN UINTN DataLength
83 );
84
85 /**
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.
88
89 If HashContext is NULL, then ASSERT().
90 If HashValue is NULL, then ASSERT().
91
92 @param[in, out] HashContext Pointer to the MD5 context
93 @param[out] HashValue Pointer to a buffer that receives the HASH digest
94 value.
95
96 @retval TRUE HASH digest computation succeeded.
97 @retval FALSE HASH digest computation failed.
98
99 **/
100 typedef
101 BOOLEAN
102 (EFIAPI *HASH_FINAL)(
103 IN OUT VOID *HashContext,
104 OUT UINT8 *HashValue
105 );
106
107 //
108 // Ppi definition
109 //
110 typedef struct _PEI_SHA256_HASH_PPI {
111 //
112 // Pointer to Hash GetContentSize function
113 //
114 HASH_GET_CONTEXT_SIZE GetContextSize;
115 //
116 // Pointer to Hash Init function
117 //
118 HASH_INIT HashInit;
119 //
120 // Pointer to Hash Update function
121 //
122 HASH_UPDATE HashUpdate;
123 //
124 // Pointer to Hash Final function
125 //
126 HASH_FINAL HashFinal;
127
128 } PEI_SHA256_HASH_PPI;
129
130 extern EFI_GUID gPeiSha256HashPpiGuid;
131 #endif