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