]> git.proxmox.com Git - mirror_edk2.git/blame - Vlv2TbltDevicePkg/Include/Ppi/Sha256Hash.h
Use SmmMemLib to check communication buffer.
[mirror_edk2.git] / Vlv2TbltDevicePkg / Include / Ppi / Sha256Hash.h
CommitLineData
3cbfba02
DW
1/*++\r
2\r
3 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>\r
4 \r\r
5 This program and the accompanying materials are licensed and made available under\r\r
6 the terms and conditions of the BSD License that accompanies this distribution. \r\r
7 The full text of the license may be found at \r\r
8 http://opensource.org/licenses/bsd-license.php. \r\r
9 \r\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r\r
12 \r\r
13\r
14Module Name:\r
15\r
16 Speaker.h\r
17\r
18Abstract:\r
19\r
20 EFI Speaker Interface Protocol\r
21\r
22\r
23\r
24--*/\r
25\r
26#ifndef _PEI_SHA256_HASH_H\r
27#define _PEI_SHA256_HASH_H\r
28\r
29//\r
30// Global ID Speaker Interface\r
31//\r
32#define PEI_SHA256_HASH_PPI_GUID \\r
33 { \\r
34 0x950e191b, 0x8524, 0x4f51, 0x80, 0xa1, 0x5c, 0x4f, 0x1b, 0x3, 0xf3, 0x5c \\r
35 }\r
36\r
37typedef struct _PEI_SHA256_HASH_PPI PEI_SHA256_HASH_PPI;\r
38\r
39/**\r
40 @return The size, in bytes, of the context buffer required for hash operations.\r
41\r
42**/\r
43typedef\r
44UINTN\r
45(EFIAPI *HASH_GET_CONTEXT_SIZE)(\r
46 VOID\r
47 );\r
48\r
49/**\r
50 Initializes user-supplied memory pointed by HashContext as hash context for\r
51 subsequent use.\r
52\r
53 If HashContext is NULL, then ASSERT().\r
54\r
55 @param[in, out] HashContext Pointer to Context being initialized.\r
56\r
57 @retval TRUE HASH context initialization succeeded.\r
58 @retval FALSE HASH context initialization failed.\r
59\r
60**/\r
61typedef\r
62BOOLEAN\r
63(EFIAPI *HASH_INIT)(\r
64 IN OUT VOID *HashContext\r
65 );\r
66\r
67/**\r
68 Performs digest on a data buffer of the specified length. This function can\r
69 be called multiple times to compute the digest of long or discontinuous data streams.\r
70\r
71 If HashContext is NULL, then ASSERT().\r
72\r
73 @param[in, out] HashContext Pointer to the MD5 context.\r
74 @param[in] Data Pointer to the buffer containing the data to be hashed.\r
75 @param[in] DataLength Length of Data buffer in bytes.\r
76\r
77 @retval TRUE HASH data digest succeeded.\r
78 @retval FALSE Invalid HASH context. After HashFinal function has been called, the\r
79 HASH context cannot be reused.\r
80\r
81**/\r
82typedef\r
83BOOLEAN\r
84(EFIAPI *HASH_UPDATE)(\r
85 IN OUT VOID *HashContext,\r
86 IN CONST VOID *Data,\r
87 IN UINTN DataLength\r
88 );\r
89\r
90/**\r
91 Completes hash computation and retrieves the digest value into the specified\r
92 memory. After this function has been called, the context cannot be used again.\r
93\r
94 If HashContext is NULL, then ASSERT().\r
95 If HashValue is NULL, then ASSERT().\r
96\r
97 @param[in, out] HashContext Pointer to the MD5 context\r
98 @param[out] HashValue Pointer to a buffer that receives the HASH digest\r
99 value.\r
100\r
101 @retval TRUE HASH digest computation succeeded.\r
102 @retval FALSE HASH digest computation failed.\r
103\r
104**/\r
105typedef\r
106BOOLEAN\r
107(EFIAPI *HASH_FINAL)(\r
108 IN OUT VOID *HashContext,\r
109 OUT UINT8 *HashValue\r
110 );\r
111\r
112//\r
113// Ppi definition\r
114//\r
115typedef struct _PEI_SHA256_HASH_PPI {\r
116 //\r
117 // Pointer to Hash GetContentSize function\r
118 //\r
119 HASH_GET_CONTEXT_SIZE GetContextSize;\r
120 //\r
121 // Pointer to Hash Init function\r
122 //\r
123 HASH_INIT HashInit;\r
124 //\r
125 // Pointer to Hash Update function\r
126 //\r
127 HASH_UPDATE HashUpdate;\r
128 //\r
129 // Pointer to Hash Final function\r
130 //\r
131 HASH_FINAL HashFinal;\r
132\r
133} PEI_SHA256_HASH_PPI;\r
134\r
135extern EFI_GUID gPeiSha256HashPpiGuid;\r
136#endif\r