]> git.proxmox.com Git - mirror_edk2.git/blame - CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha1Null.c
CryptoPkg/BaseCryptLib: replace HmacXxxInit API with HmacXxxSetKey
[mirror_edk2.git] / CryptoPkg / Library / BaseCryptLib / Hmac / CryptHmacSha1Null.c
CommitLineData
532616bb 1/** @file\r
630f67dd 2 HMAC-SHA1 Wrapper Implementation which does not provide real capabilities.\r
532616bb 3\r
630f67dd 4Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.<BR>\r
2009f6b4 5SPDX-License-Identifier: BSD-2-Clause-Patent\r
532616bb 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-SHA1 operations.\r
4c270243
QL
13 (NOTE: This API is deprecated.\r
14 Use HmacSha1New() / HmacSha1Free() for HMAC-SHA1 Context operations.)\r
532616bb 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
23HmacSha1GetContextSize (\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-SHA1 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
41HmacSha1New (\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] HmacSha1Ctx Pointer to the HMAC_CTX context to be released.\r
55\r
56**/\r
57VOID\r
58EFIAPI\r
59HmacSha1Free (\r
60 IN VOID *HmacSha1Ctx\r
61 )\r
62{\r
63 ASSERT (FALSE);\r
64 return;\r
65}\r
66\r
532616bb 67/**\r
a23fdff6
JW
68 Set user-supplied key for subsequent use. It must be done before any\r
69 calling to HmacSha1Update().\r
532616bb 70\r
630f67dd 71 Return FALSE to indicate this interface is not supported.\r
532616bb 72\r
a23fdff6 73 @param[out] HmacSha1Context Pointer to HMAC-SHA1 context.\r
532616bb 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 82HmacSha1SetKey (\r
532616bb 83 OUT VOID *HmacSha1Context,\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-SHA1 context.\r
94\r
95 Return FALSE to indicate this interface is not supported.\r
96\r
97 @param[in] HmacSha1Context Pointer to HMAC-SHA1 context being copied.\r
98 @param[out] NewHmacSha1Context Pointer to new HMAC-SHA1 context.\r
99\r
100 @retval FALSE This interface is not supported.\r
101\r
102**/\r
103BOOLEAN\r
104EFIAPI\r
105HmacSha1Duplicate (\r
106 IN CONST VOID *HmacSha1Context,\r
107 OUT VOID *NewHmacSha1Context\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-SHA1 context.\r
116\r
630f67dd 117 Return FALSE to indicate this interface is not supported.\r
532616bb 118\r
119 @param[in, out] HmacSha1Context Pointer to the HMAC-SHA1 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
128HmacSha1Update (\r
129 IN OUT VOID *HmacSha1Context,\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-SHA1 digest value.\r
140\r
630f67dd 141 Return FALSE to indicate this interface is not supported.\r
532616bb 142\r
143 @param[in, out] HmacSha1Context Pointer to the HMAC-SHA1 context.\r
144 @param[out] HmacValue Pointer to a buffer that receives the HMAC-SHA1 digest\r
145 value (20 bytes).\r
146\r
147 @retval FALSE This interface is not supported.\r
148\r
149**/\r
150BOOLEAN\r
151EFIAPI\r
152HmacSha1Final (\r
153 IN OUT VOID *HmacSha1Context,\r
154 OUT UINT8 *HmacValue\r
155 )\r
156{\r
157 ASSERT (FALSE);\r
158 return FALSE;\r
159}\r