]> git.proxmox.com Git - mirror_edk2.git/blame - CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha256Null.c
CryptoPkg: Update HMAC Wrapper with opaque HMAC_CTX object.
[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
72009c62
QL
5This program and the accompanying materials\r
6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#include "InternalCryptLib.h"\r
16\r
17/**\r
18 Retrieves the size, in bytes, of the context buffer required for HMAC-SHA256 operations.\r
4c270243
QL
19 (NOTE: This API is deprecated.\r
20 Use HmacSha256New() / HmacSha256Free() for HMAC-SHA256 Context operations.)\r
72009c62
QL
21\r
22 Return zero to indicate this interface is not supported.\r
23\r
24 @retval 0 This interface is not supported.\r
25\r
26**/\r
27UINTN\r
28EFIAPI\r
29HmacSha256GetContextSize (\r
30 VOID\r
31 )\r
32{\r
33 ASSERT (FALSE);\r
34 return 0;\r
35}\r
36\r
4c270243
QL
37/**\r
38 Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA256 use.\r
39\r
40 Return NULL to indicate this interface is not supported.\r
41\r
42 @return NULL This interface is not supported..\r
43\r
44**/\r
45VOID *\r
46EFIAPI\r
47HmacSha256New (\r
48 VOID\r
49 )\r
50{\r
51 ASSERT (FALSE);\r
52 return NULL;\r
53}\r
54\r
55/**\r
56 Release the specified HMAC_CTX context.\r
57\r
58 This function will do nothing.\r
59\r
60 @param[in] HmacSha256Ctx Pointer to the HMAC_CTX context to be released.\r
61\r
62**/\r
63VOID\r
64EFIAPI\r
65HmacSha256Free (\r
66 IN VOID *HmacSha256Ctx\r
67 )\r
68{\r
69 ASSERT (FALSE);\r
70 return;\r
71}\r
72\r
72009c62
QL
73/**\r
74 Initializes user-supplied memory pointed by HmacSha256Context as HMAC-SHA256 context for\r
75 subsequent use.\r
76\r
77 Return FALSE to indicate this interface is not supported.\r
78\r
79 @param[out] HmacSha256Context Pointer to HMAC-SHA256 context being initialized.\r
80 @param[in] Key Pointer to the user-supplied key.\r
81 @param[in] KeySize Key size in bytes.\r
82\r
83 @retval FALSE This interface is not supported.\r
84\r
85**/\r
86BOOLEAN\r
87EFIAPI\r
88HmacSha256Init (\r
89 OUT VOID *HmacSha256Context,\r
90 IN CONST UINT8 *Key,\r
91 IN UINTN KeySize\r
92 )\r
93{\r
94 ASSERT (FALSE);\r
95 return FALSE;\r
96}\r
97\r
98/**\r
99 Makes a copy of an existing HMAC-SHA256 context.\r
100\r
101 Return FALSE to indicate this interface is not supported.\r
102\r
103 @param[in] HmacSha256Context Pointer to HMAC-SHA256 context being copied.\r
104 @param[out] NewHmacSha256Context Pointer to new HMAC-SHA256 context.\r
105\r
106 @retval FALSE This interface is not supported.\r
107\r
108**/\r
109BOOLEAN\r
110EFIAPI\r
111HmacSha256Duplicate (\r
112 IN CONST VOID *HmacSha256Context,\r
113 OUT VOID *NewHmacSha256Context\r
114 )\r
115{\r
116 ASSERT (FALSE);\r
117 return FALSE;\r
118}\r
119\r
120/**\r
121 Digests the input data and updates HMAC-SHA256 context.\r
122\r
123 Return FALSE to indicate this interface is not supported.\r
124\r
125 @param[in, out] HmacSha256Context Pointer to the HMAC-SHA256 context.\r
126 @param[in] Data Pointer to the buffer containing the data to be digested.\r
127 @param[in] DataSize Size of Data buffer in bytes.\r
128\r
129 @retval FALSE This interface is not supported.\r
130\r
131**/\r
132BOOLEAN\r
133EFIAPI\r
134HmacSha256Update (\r
135 IN OUT VOID *HmacSha256Context,\r
136 IN CONST VOID *Data,\r
137 IN UINTN DataSize\r
138 )\r
139{\r
140 ASSERT (FALSE);\r
141 return FALSE;\r
142}\r
143\r
144/**\r
145 Completes computation of the HMAC-SHA256 digest value.\r
146\r
147 Return FALSE to indicate this interface is not supported.\r
148\r
149 @param[in, out] HmacSha256Context Pointer to the HMAC-SHA256 context.\r
68ae7cd6 150 @param[out] HmacValue Pointer to a buffer that receives the HMAC-SHA256 digest\r
72009c62
QL
151 value (32 bytes).\r
152\r
153 @retval FALSE This interface is not supported.\r
154\r
155**/\r
156BOOLEAN\r
157EFIAPI\r
158HmacSha256Final (\r
159 IN OUT VOID *HmacSha256Context,\r
160 OUT UINT8 *HmacValue\r
161 )\r
162{\r
163 ASSERT (FALSE);\r
164 return FALSE;\r
165}\r