]>
Commit | Line | Data |
---|---|---|
72009c62 QL |
1 | /** @file\r |
2 | HMAC-SHA256 Wrapper Implementation which does not provide real capabilities.\r | |
3 | \r | |
4c270243 | 4 | Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>\r |
2009f6b4 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
72009c62 QL |
6 | \r |
7 | **/\r | |
8 | \r | |
9 | #include "InternalCryptLib.h"\r | |
10 | \r | |
11 | /**\r | |
12 | Retrieves the size, in bytes, of the context buffer required for HMAC-SHA256 operations.\r | |
4c270243 QL |
13 | (NOTE: This API is deprecated.\r |
14 | Use HmacSha256New() / HmacSha256Free() for HMAC-SHA256 Context operations.)\r | |
72009c62 QL |
15 | \r |
16 | Return zero to indicate this interface is not supported.\r | |
17 | \r | |
18 | @retval 0 This interface is not supported.\r | |
19 | \r | |
20 | **/\r | |
21 | UINTN\r | |
22 | EFIAPI\r | |
23 | HmacSha256GetContextSize (\r | |
24 | VOID\r | |
25 | )\r | |
26 | {\r | |
27 | ASSERT (FALSE);\r | |
28 | return 0;\r | |
29 | }\r | |
30 | \r | |
4c270243 QL |
31 | /**\r |
32 | Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA256 use.\r | |
33 | \r | |
34 | Return NULL to indicate this interface is not supported.\r | |
35 | \r | |
36 | @return NULL This interface is not supported..\r | |
37 | \r | |
38 | **/\r | |
39 | VOID *\r | |
40 | EFIAPI\r | |
41 | HmacSha256New (\r | |
42 | VOID\r | |
43 | )\r | |
44 | {\r | |
45 | ASSERT (FALSE);\r | |
46 | return NULL;\r | |
47 | }\r | |
48 | \r | |
49 | /**\r | |
50 | Release the specified HMAC_CTX context.\r | |
51 | \r | |
52 | This function will do nothing.\r | |
53 | \r | |
54 | @param[in] HmacSha256Ctx Pointer to the HMAC_CTX context to be released.\r | |
55 | \r | |
56 | **/\r | |
57 | VOID\r | |
58 | EFIAPI\r | |
59 | HmacSha256Free (\r | |
60 | IN VOID *HmacSha256Ctx\r | |
61 | )\r | |
62 | {\r | |
63 | ASSERT (FALSE);\r | |
64 | return;\r | |
65 | }\r | |
66 | \r | |
72009c62 QL |
67 | /**\r |
68 | Initializes user-supplied memory pointed by HmacSha256Context as HMAC-SHA256 context for\r | |
69 | subsequent use.\r | |
70 | \r | |
71 | Return FALSE to indicate this interface is not supported.\r | |
72 | \r | |
73 | @param[out] HmacSha256Context Pointer to HMAC-SHA256 context being initialized.\r | |
74 | @param[in] Key Pointer to the user-supplied key.\r | |
75 | @param[in] KeySize Key size in bytes.\r | |
76 | \r | |
77 | @retval FALSE This interface is not supported.\r | |
78 | \r | |
79 | **/\r | |
80 | BOOLEAN\r | |
81 | EFIAPI\r | |
82 | HmacSha256Init (\r | |
83 | OUT VOID *HmacSha256Context,\r | |
84 | IN CONST UINT8 *Key,\r | |
85 | IN UINTN KeySize\r | |
86 | )\r | |
87 | {\r | |
88 | ASSERT (FALSE);\r | |
89 | return FALSE;\r | |
90 | }\r | |
91 | \r | |
92 | /**\r | |
93 | Makes a copy of an existing HMAC-SHA256 context.\r | |
94 | \r | |
95 | Return FALSE to indicate this interface is not supported.\r | |
96 | \r | |
97 | @param[in] HmacSha256Context Pointer to HMAC-SHA256 context being copied.\r | |
98 | @param[out] NewHmacSha256Context Pointer to new HMAC-SHA256 context.\r | |
99 | \r | |
100 | @retval FALSE This interface is not supported.\r | |
101 | \r | |
102 | **/\r | |
103 | BOOLEAN\r | |
104 | EFIAPI\r | |
105 | HmacSha256Duplicate (\r | |
106 | IN CONST VOID *HmacSha256Context,\r | |
107 | OUT VOID *NewHmacSha256Context\r | |
108 | )\r | |
109 | {\r | |
110 | ASSERT (FALSE);\r | |
111 | return FALSE;\r | |
112 | }\r | |
113 | \r | |
114 | /**\r | |
115 | Digests the input data and updates HMAC-SHA256 context.\r | |
116 | \r | |
117 | Return FALSE to indicate this interface is not supported.\r | |
118 | \r | |
119 | @param[in, out] HmacSha256Context Pointer to the HMAC-SHA256 context.\r | |
120 | @param[in] Data Pointer to the buffer containing the data to be digested.\r | |
121 | @param[in] DataSize Size of Data buffer in bytes.\r | |
122 | \r | |
123 | @retval FALSE This interface is not supported.\r | |
124 | \r | |
125 | **/\r | |
126 | BOOLEAN\r | |
127 | EFIAPI\r | |
128 | HmacSha256Update (\r | |
129 | IN OUT VOID *HmacSha256Context,\r | |
130 | IN CONST VOID *Data,\r | |
131 | IN UINTN DataSize\r | |
132 | )\r | |
133 | {\r | |
134 | ASSERT (FALSE);\r | |
135 | return FALSE;\r | |
136 | }\r | |
137 | \r | |
138 | /**\r | |
139 | Completes computation of the HMAC-SHA256 digest value.\r | |
140 | \r | |
141 | Return FALSE to indicate this interface is not supported.\r | |
142 | \r | |
143 | @param[in, out] HmacSha256Context Pointer to the HMAC-SHA256 context.\r | |
68ae7cd6 | 144 | @param[out] HmacValue Pointer to a buffer that receives the HMAC-SHA256 digest\r |
72009c62 QL |
145 | value (32 bytes).\r |
146 | \r | |
147 | @retval FALSE This interface is not supported.\r | |
148 | \r | |
149 | **/\r | |
150 | BOOLEAN\r | |
151 | EFIAPI\r | |
152 | HmacSha256Final (\r | |
153 | IN OUT VOID *HmacSha256Context,\r | |
154 | OUT UINT8 *HmacValue\r | |
155 | )\r | |
156 | {\r | |
157 | ASSERT (FALSE);\r | |
158 | return FALSE;\r | |
159 | }\r |