]> git.proxmox.com Git - mirror_edk2.git/blame - CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha256Null.c
CryptoPkg/BaseCryptLib: replace HmacXxxInit API with HmacXxxSetKey
[mirror_edk2.git] / CryptoPkg / Library / BaseCryptLib / Hmac / CryptHmacSha256Null.c
CommitLineData
72009c62
QL
1/** @file\r
2 HMAC-SHA256 Wrapper Implementation which does not provide real capabilities.\r
3\r
4c270243 4Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>\r
2009f6b4 5SPDX-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
21UINTN\r
22EFIAPI\r
23HmacSha256GetContextSize (\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
39VOID *\r
40EFIAPI\r
41HmacSha256New (\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
57VOID\r
58EFIAPI\r
59HmacSha256Free (\r
60 IN VOID *HmacSha256Ctx\r
61 )\r
62{\r
63 ASSERT (FALSE);\r
64 return;\r
65}\r
66\r
72009c62 67/**\r
a23fdff6
JW
68 Set user-supplied key for subsequent use. It must be done before any\r
69 calling to HmacSha256Update().\r
72009c62
QL
70\r
71 Return FALSE to indicate this interface is not supported.\r
72\r
a23fdff6 73 @param[out] HmacSha256Context Pointer to HMAC-SHA256 context.\r
72009c62
QL
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
80BOOLEAN\r
81EFIAPI\r
a23fdff6 82HmacSha256SetKey (\r
72009c62
QL
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
103BOOLEAN\r
104EFIAPI\r
105HmacSha256Duplicate (\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
126BOOLEAN\r
127EFIAPI\r
128HmacSha256Update (\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
150BOOLEAN\r
151EFIAPI\r
152HmacSha256Final (\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