]>
git.proxmox.com Git - mirror_edk2.git/blob - CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacNull.c
2 HMAC-SHA256/SHA384 Wrapper Implementation which does not provide real capabilities.
4 Copyright (c) 2016 - 2022, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #include "InternalCryptLib.h"
12 Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA256 use.
14 Return NULL to indicate this interface is not supported.
16 @return NULL This interface is not supported..
30 Release the specified HMAC_CTX context.
32 This function will do nothing.
34 @param[in] HmacSha256Ctx Pointer to the HMAC_CTX context to be released.
40 IN VOID
*HmacSha256Ctx
48 Set user-supplied key for subsequent use. It must be done before any
49 calling to HmacSha256Update().
51 Return FALSE to indicate this interface is not supported.
53 @param[out] HmacSha256Context Pointer to HMAC-SHA256 context.
54 @param[in] Key Pointer to the user-supplied key.
55 @param[in] KeySize Key size in bytes.
57 @retval FALSE This interface is not supported.
63 OUT VOID
*HmacSha256Context
,
73 Makes a copy of an existing HMAC-SHA256 context.
75 Return FALSE to indicate this interface is not supported.
77 @param[in] HmacSha256Context Pointer to HMAC-SHA256 context being copied.
78 @param[out] NewHmacSha256Context Pointer to new HMAC-SHA256 context.
80 @retval FALSE This interface is not supported.
86 IN CONST VOID
*HmacSha256Context
,
87 OUT VOID
*NewHmacSha256Context
95 Digests the input data and updates HMAC-SHA256 context.
97 Return FALSE to indicate this interface is not supported.
99 @param[in, out] HmacSha256Context Pointer to the HMAC-SHA256 context.
100 @param[in] Data Pointer to the buffer containing the data to be digested.
101 @param[in] DataSize Size of Data buffer in bytes.
103 @retval FALSE This interface is not supported.
109 IN OUT VOID
*HmacSha256Context
,
119 Completes computation of the HMAC-SHA256 digest value.
121 Return FALSE to indicate this interface is not supported.
123 @param[in, out] HmacSha256Context Pointer to the HMAC-SHA256 context.
124 @param[out] HmacValue Pointer to a buffer that receives the HMAC-SHA256 digest
127 @retval FALSE This interface is not supported.
133 IN OUT VOID
*HmacSha256Context
,
142 Computes the HMAC-SHA256 digest of a input data buffer.
144 This function performs the HMAC-SHA256 digest of a given data buffer, and places
145 the digest value into the specified memory.
147 If this interface is not supported, then return FALSE.
149 @param[in] Data Pointer to the buffer containing the data to be digested.
150 @param[in] DataSize Size of Data buffer in bytes.
151 @param[in] Key Pointer to the user-supplied key.
152 @param[in] KeySize Key size in bytes.
153 @param[out] HmacValue Pointer to a buffer that receives the HMAC-SHA256 digest
156 @retval TRUE HMAC-SHA256 digest computation succeeded.
157 @retval FALSE HMAC-SHA256 digest computation failed.
158 @retval FALSE This interface is not supported.
176 Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA384 use.
178 @return Pointer to the HMAC_CTX context that has been initialized.
179 If the allocations fails, HmacSha384New() returns NULL.
193 Release the specified HMAC_CTX context.
195 @param[in] HmacSha384Ctx Pointer to the HMAC_CTX context to be released.
201 IN VOID
*HmacSha384Ctx
209 Set user-supplied key for subsequent use. It must be done before any
210 calling to HmacSha384Update().
212 If HmacSha384Context is NULL, then return FALSE.
213 If this interface is not supported, then return FALSE.
215 @param[out] HmacSha384Context Pointer to HMAC-SHA384 context.
216 @param[in] Key Pointer to the user-supplied key.
217 @param[in] KeySize Key size in bytes.
219 @retval TRUE The Key is set successfully.
220 @retval FALSE The Key is set unsuccessfully.
221 @retval FALSE This interface is not supported.
227 OUT VOID
*HmacSha384Context
,
237 Makes a copy of an existing HMAC-SHA384 context.
239 If HmacSha384Context is NULL, then return FALSE.
240 If NewHmacSha384Context is NULL, then return FALSE.
241 If this interface is not supported, then return FALSE.
243 @param[in] HmacSha384Context Pointer to HMAC-SHA384 context being copied.
244 @param[out] NewHmacSha384Context Pointer to new HMAC-SHA384 context.
246 @retval TRUE HMAC-SHA384 context copy succeeded.
247 @retval FALSE HMAC-SHA384 context copy failed.
248 @retval FALSE This interface is not supported.
253 HmacSha384Duplicate (
254 IN CONST VOID
*HmacSha384Context
,
255 OUT VOID
*NewHmacSha384Context
263 Digests the input data and updates HMAC-SHA384 context.
265 This function performs HMAC-SHA384 digest on a data buffer of the specified size.
266 It can be called multiple times to compute the digest of long or discontinuous data streams.
267 HMAC-SHA384 context should be initialized by HmacSha384New(), and should not be finalized
268 by HmacSha384Final(). Behavior with invalid context is undefined.
270 If HmacSha384Context is NULL, then return FALSE.
271 If this interface is not supported, then return FALSE.
273 @param[in, out] HmacSha384Context Pointer to the HMAC-SHA384 context.
274 @param[in] Data Pointer to the buffer containing the data to be digested.
275 @param[in] DataSize Size of Data buffer in bytes.
277 @retval TRUE HMAC-SHA384 data digest succeeded.
278 @retval FALSE HMAC-SHA384 data digest failed.
279 @retval FALSE This interface is not supported.
285 IN OUT VOID
*HmacSha384Context
,
295 Completes computation of the HMAC-SHA384 digest value.
297 This function completes HMAC-SHA384 hash computation and retrieves the digest value into
298 the specified memory. After this function has been called, the HMAC-SHA384 context cannot
300 HMAC-SHA384 context should be initialized by HmacSha384New(), and should not be finalized
301 by HmacSha384Final(). Behavior with invalid HMAC-SHA384 context is undefined.
303 If HmacSha384Context is NULL, then return FALSE.
304 If HmacValue is NULL, then return FALSE.
305 If this interface is not supported, then return FALSE.
307 @param[in, out] HmacSha384Context Pointer to the HMAC-SHA384 context.
308 @param[out] HmacValue Pointer to a buffer that receives the HMAC-SHA384 digest
311 @retval TRUE HMAC-SHA384 digest computation succeeded.
312 @retval FALSE HMAC-SHA384 digest computation failed.
313 @retval FALSE This interface is not supported.
319 IN OUT VOID
*HmacSha384Context
,
328 Computes the HMAC-SHA384 digest of a input data buffer.
330 This function performs the HMAC-SHA384 digest of a given data buffer, and places
331 the digest value into the specified memory.
333 If this interface is not supported, then return FALSE.
335 @param[in] Data Pointer to the buffer containing the data to be digested.
336 @param[in] DataSize Size of Data buffer in bytes.
337 @param[in] Key Pointer to the user-supplied key.
338 @param[in] KeySize Key size in bytes.
339 @param[out] HmacValue Pointer to a buffer that receives the HMAC-SHA384 digest
342 @retval TRUE HMAC-SHA384 digest computation succeeded.
343 @retval FALSE HMAC-SHA384 digest computation failed.
344 @retval FALSE This interface is not supported.