TianoCore EDK2 master
|
#include "InternalCryptLib.h"
Go to the source code of this file.
Functions | |
VOID *EFIAPI | HmacSha256New (VOID) |
VOID EFIAPI | HmacSha256Free (IN VOID *HmacSha256Ctx) |
BOOLEAN EFIAPI | HmacSha256SetKey (OUT VOID *HmacSha256Context, IN CONST UINT8 *Key, IN UINTN KeySize) |
BOOLEAN EFIAPI | HmacSha256Duplicate (IN CONST VOID *HmacSha256Context, OUT VOID *NewHmacSha256Context) |
BOOLEAN EFIAPI | HmacSha256Update (IN OUT VOID *HmacSha256Context, IN CONST VOID *Data, IN UINTN DataSize) |
BOOLEAN EFIAPI | HmacSha256Final (IN OUT VOID *HmacSha256Context, OUT UINT8 *HmacValue) |
BOOLEAN EFIAPI | HmacSha256All (IN CONST VOID *Data, IN UINTN DataSize, IN CONST UINT8 *Key, IN UINTN KeySize, OUT UINT8 *HmacValue) |
VOID *EFIAPI | HmacSha384New (VOID) |
VOID EFIAPI | HmacSha384Free (IN VOID *HmacSha384Ctx) |
BOOLEAN EFIAPI | HmacSha384SetKey (OUT VOID *HmacSha384Context, IN CONST UINT8 *Key, IN UINTN KeySize) |
BOOLEAN EFIAPI | HmacSha384Duplicate (IN CONST VOID *HmacSha384Context, OUT VOID *NewHmacSha384Context) |
BOOLEAN EFIAPI | HmacSha384Update (IN OUT VOID *HmacSha384Context, IN CONST VOID *Data, IN UINTN DataSize) |
BOOLEAN EFIAPI | HmacSha384Final (IN OUT VOID *HmacSha384Context, OUT UINT8 *HmacValue) |
BOOLEAN EFIAPI | HmacSha384All (IN CONST VOID *Data, IN UINTN DataSize, IN CONST UINT8 *Key, IN UINTN KeySize, OUT UINT8 *HmacValue) |
HMAC-SHA256/SHA384 Wrapper Implementation which does not provide real capabilities.
Copyright (c) 2023, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file CryptHmacNull.c.
BOOLEAN EFIAPI HmacSha256All | ( | IN CONST VOID * | Data, |
IN UINTN | DataSize, | ||
IN CONST UINT8 * | Key, | ||
IN UINTN | KeySize, | ||
OUT UINT8 * | HmacValue | ||
) |
Computes the HMAC-SHA256 digest of a input data buffer.
This function performs the HMAC-SHA256 digest of a given data buffer, and places the digest value into the specified memory.
If this interface is not supported, then return FALSE.
[in] | Data | Pointer to the buffer containing the data to be digested. |
[in] | DataSize | Size of Data buffer in bytes. |
[in] | Key | Pointer to the user-supplied key. |
[in] | KeySize | Key size in bytes. |
[out] | HmacValue | Pointer to a buffer that receives the HMAC-SHA256 digest value (32 bytes). |
TRUE | HMAC-SHA256 digest computation succeeded. |
FALSE | HMAC-SHA256 digest computation failed. |
FALSE | This interface is not supported. |
Definition at line 163 of file CryptHmacNull.c.
BOOLEAN EFIAPI HmacSha256Duplicate | ( | IN CONST VOID * | HmacSha256Context, |
OUT VOID * | NewHmacSha256Context | ||
) |
Makes a copy of an existing HMAC-SHA256 context.
Return FALSE to indicate this interface is not supported.
[in] | HmacSha256Context | Pointer to HMAC-SHA256 context being copied. |
[out] | NewHmacSha256Context | Pointer to new HMAC-SHA256 context. |
FALSE | This interface is not supported. |
Definition at line 85 of file CryptHmacNull.c.
Completes computation of the HMAC-SHA256 digest value.
Return FALSE to indicate this interface is not supported.
[in,out] | HmacSha256Context | Pointer to the HMAC-SHA256 context. |
[out] | HmacValue | Pointer to a buffer that receives the HMAC-SHA256 digest value (32 bytes). |
FALSE | This interface is not supported. |
Definition at line 132 of file CryptHmacNull.c.
VOID EFIAPI HmacSha256Free | ( | IN VOID * | HmacSha256Ctx | ) |
Release the specified HMAC_CTX context.
This function will do nothing.
[in] | HmacSha256Ctx | Pointer to the HMAC_CTX context to be released. |
Definition at line 39 of file CryptHmacNull.c.
VOID *EFIAPI HmacSha256New | ( | VOID | ) |
Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA256 use.
Return NULL to indicate this interface is not supported.
Definition at line 21 of file CryptHmacNull.c.
BOOLEAN EFIAPI HmacSha256SetKey | ( | OUT VOID * | HmacSha256Context, |
IN CONST UINT8 * | Key, | ||
IN UINTN | KeySize | ||
) |
Set user-supplied key for subsequent use. It must be done before any calling to HmacSha256Update().
Return FALSE to indicate this interface is not supported.
[out] | HmacSha256Context | Pointer to HMAC-SHA256 context. |
[in] | Key | Pointer to the user-supplied key. |
[in] | KeySize | Key size in bytes. |
FALSE | This interface is not supported. |
Definition at line 62 of file CryptHmacNull.c.
BOOLEAN EFIAPI HmacSha256Update | ( | IN OUT VOID * | HmacSha256Context, |
IN CONST VOID * | Data, | ||
IN UINTN | DataSize | ||
) |
Digests the input data and updates HMAC-SHA256 context.
Return FALSE to indicate this interface is not supported.
[in,out] | HmacSha256Context | Pointer to the HMAC-SHA256 context. |
[in] | Data | Pointer to the buffer containing the data to be digested. |
[in] | DataSize | Size of Data buffer in bytes. |
FALSE | This interface is not supported. |
Definition at line 108 of file CryptHmacNull.c.
BOOLEAN EFIAPI HmacSha384All | ( | IN CONST VOID * | Data, |
IN UINTN | DataSize, | ||
IN CONST UINT8 * | Key, | ||
IN UINTN | KeySize, | ||
OUT UINT8 * | HmacValue | ||
) |
Computes the HMAC-SHA384 digest of a input data buffer.
This function performs the HMAC-SHA384 digest of a given data buffer, and places the digest value into the specified memory.
If this interface is not supported, then return FALSE.
[in] | Data | Pointer to the buffer containing the data to be digested. |
[in] | DataSize | Size of Data buffer in bytes. |
[in] | Key | Pointer to the user-supplied key. |
[in] | KeySize | Key size in bytes. |
[out] | HmacValue | Pointer to a buffer that receives the HMAC-SHA384 digest value (48 bytes). |
TRUE | HMAC-SHA384 digest computation succeeded. |
FALSE | HMAC-SHA384 digest computation failed. |
FALSE | This interface is not supported. |
Definition at line 349 of file CryptHmacNull.c.
BOOLEAN EFIAPI HmacSha384Duplicate | ( | IN CONST VOID * | HmacSha384Context, |
OUT VOID * | NewHmacSha384Context | ||
) |
Makes a copy of an existing HMAC-SHA384 context.
If HmacSha384Context is NULL, then return FALSE. If NewHmacSha384Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in] | HmacSha384Context | Pointer to HMAC-SHA384 context being copied. |
[out] | NewHmacSha384Context | Pointer to new HMAC-SHA384 context. |
TRUE | HMAC-SHA384 context copy succeeded. |
FALSE | HMAC-SHA384 context copy failed. |
FALSE | This interface is not supported. |
Definition at line 253 of file CryptHmacNull.c.
Completes computation of the HMAC-SHA384 digest value.
This function completes HMAC-SHA384 hash computation and retrieves the digest value into the specified memory. After this function has been called, the HMAC-SHA384 context cannot be used again. HMAC-SHA384 context should be initialized by HmacSha384New(), and should not be finalized by HmacSha384Final(). Behavior with invalid HMAC-SHA384 context is undefined.
If HmacSha384Context is NULL, then return FALSE. If HmacValue is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in,out] | HmacSha384Context | Pointer to the HMAC-SHA384 context. |
[out] | HmacValue | Pointer to a buffer that receives the HMAC-SHA384 digest value (48 bytes). |
TRUE | HMAC-SHA384 digest computation succeeded. |
FALSE | HMAC-SHA384 digest computation failed. |
FALSE | This interface is not supported. |
Definition at line 318 of file CryptHmacNull.c.
VOID EFIAPI HmacSha384Free | ( | IN VOID * | HmacSha384Ctx | ) |
Release the specified HMAC_CTX context.
[in] | HmacSha384Ctx | Pointer to the HMAC_CTX context to be released. |
Definition at line 200 of file CryptHmacNull.c.
VOID *EFIAPI HmacSha384New | ( | VOID | ) |
Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA384 use.
Definition at line 184 of file CryptHmacNull.c.
BOOLEAN EFIAPI HmacSha384SetKey | ( | OUT VOID * | HmacSha384Context, |
IN CONST UINT8 * | Key, | ||
IN UINTN | KeySize | ||
) |
Set user-supplied key for subsequent use. It must be done before any calling to HmacSha384Update().
If HmacSha384Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[out] | HmacSha384Context | Pointer to HMAC-SHA384 context. |
[in] | Key | Pointer to the user-supplied key. |
[in] | KeySize | Key size in bytes. |
TRUE | The Key is set successfully. |
FALSE | The Key is set unsuccessfully. |
FALSE | This interface is not supported. |
Definition at line 226 of file CryptHmacNull.c.
BOOLEAN EFIAPI HmacSha384Update | ( | IN OUT VOID * | HmacSha384Context, |
IN CONST VOID * | Data, | ||
IN UINTN | DataSize | ||
) |
Digests the input data and updates HMAC-SHA384 context.
This function performs HMAC-SHA384 digest on a data buffer of the specified size. It can be called multiple times to compute the digest of long or discontinuous data streams. HMAC-SHA384 context should be initialized by HmacSha384New(), and should not be finalized by HmacSha384Final(). Behavior with invalid context is undefined.
If HmacSha384Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in,out] | HmacSha384Context | Pointer to the HMAC-SHA384 context. |
[in] | Data | Pointer to the buffer containing the data to be digested. |
[in] | DataSize | Size of Data buffer in bytes. |
TRUE | HMAC-SHA384 data digest succeeded. |
FALSE | HMAC-SHA384 data digest failed. |
FALSE | This interface is not supported. |
Definition at line 284 of file CryptHmacNull.c.