TianoCore EDK2 master
Loading...
Searching...
No Matches
CryptHmacNull.c File Reference
#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)
 

Detailed Description

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.

Function Documentation

◆ HmacSha256All()

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.

Parameters
[in]DataPointer to the buffer containing the data to be digested.
[in]DataSizeSize of Data buffer in bytes.
[in]KeyPointer to the user-supplied key.
[in]KeySizeKey size in bytes.
[out]HmacValuePointer to a buffer that receives the HMAC-SHA256 digest value (32 bytes).
Return values
TRUEHMAC-SHA256 digest computation succeeded.
FALSEHMAC-SHA256 digest computation failed.
FALSEThis interface is not supported.

Definition at line 163 of file CryptHmacNull.c.

◆ HmacSha256Duplicate()

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.

Parameters
[in]HmacSha256ContextPointer to HMAC-SHA256 context being copied.
[out]NewHmacSha256ContextPointer to new HMAC-SHA256 context.
Return values
FALSEThis interface is not supported.

Definition at line 85 of file CryptHmacNull.c.

◆ HmacSha256Final()

BOOLEAN EFIAPI HmacSha256Final ( IN OUT VOID *  HmacSha256Context,
OUT UINT8 *  HmacValue 
)

Completes computation of the HMAC-SHA256 digest value.

Return FALSE to indicate this interface is not supported.

Parameters
[in,out]HmacSha256ContextPointer to the HMAC-SHA256 context.
[out]HmacValuePointer to a buffer that receives the HMAC-SHA256 digest value (32 bytes).
Return values
FALSEThis interface is not supported.

Definition at line 132 of file CryptHmacNull.c.

◆ HmacSha256Free()

VOID EFIAPI HmacSha256Free ( IN VOID *  HmacSha256Ctx)

Release the specified HMAC_CTX context.

This function will do nothing.

Parameters
[in]HmacSha256CtxPointer to the HMAC_CTX context to be released.

Definition at line 39 of file CryptHmacNull.c.

◆ HmacSha256New()

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.

Returns
NULL This interface is not supported..

Definition at line 21 of file CryptHmacNull.c.

◆ HmacSha256SetKey()

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.

Parameters
[out]HmacSha256ContextPointer to HMAC-SHA256 context.
[in]KeyPointer to the user-supplied key.
[in]KeySizeKey size in bytes.
Return values
FALSEThis interface is not supported.

Definition at line 62 of file CryptHmacNull.c.

◆ HmacSha256Update()

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.

Parameters
[in,out]HmacSha256ContextPointer to the HMAC-SHA256 context.
[in]DataPointer to the buffer containing the data to be digested.
[in]DataSizeSize of Data buffer in bytes.
Return values
FALSEThis interface is not supported.

Definition at line 108 of file CryptHmacNull.c.

◆ HmacSha384All()

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.

Parameters
[in]DataPointer to the buffer containing the data to be digested.
[in]DataSizeSize of Data buffer in bytes.
[in]KeyPointer to the user-supplied key.
[in]KeySizeKey size in bytes.
[out]HmacValuePointer to a buffer that receives the HMAC-SHA384 digest value (48 bytes).
Return values
TRUEHMAC-SHA384 digest computation succeeded.
FALSEHMAC-SHA384 digest computation failed.
FALSEThis interface is not supported.

Definition at line 349 of file CryptHmacNull.c.

◆ HmacSha384Duplicate()

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.

Parameters
[in]HmacSha384ContextPointer to HMAC-SHA384 context being copied.
[out]NewHmacSha384ContextPointer to new HMAC-SHA384 context.
Return values
TRUEHMAC-SHA384 context copy succeeded.
FALSEHMAC-SHA384 context copy failed.
FALSEThis interface is not supported.

Definition at line 253 of file CryptHmacNull.c.

◆ HmacSha384Final()

BOOLEAN EFIAPI HmacSha384Final ( IN OUT VOID *  HmacSha384Context,
OUT UINT8 *  HmacValue 
)

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.

Parameters
[in,out]HmacSha384ContextPointer to the HMAC-SHA384 context.
[out]HmacValuePointer to a buffer that receives the HMAC-SHA384 digest value (48 bytes).
Return values
TRUEHMAC-SHA384 digest computation succeeded.
FALSEHMAC-SHA384 digest computation failed.
FALSEThis interface is not supported.

Definition at line 318 of file CryptHmacNull.c.

◆ HmacSha384Free()

VOID EFIAPI HmacSha384Free ( IN VOID *  HmacSha384Ctx)

Release the specified HMAC_CTX context.

Parameters
[in]HmacSha384CtxPointer to the HMAC_CTX context to be released.

Definition at line 200 of file CryptHmacNull.c.

◆ HmacSha384New()

VOID *EFIAPI HmacSha384New ( VOID  )

Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA384 use.

Returns
Pointer to the HMAC_CTX context that has been initialized. If the allocations fails, HmacSha384New() returns NULL.

Definition at line 184 of file CryptHmacNull.c.

◆ HmacSha384SetKey()

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.

Parameters
[out]HmacSha384ContextPointer to HMAC-SHA384 context.
[in]KeyPointer to the user-supplied key.
[in]KeySizeKey size in bytes.
Return values
TRUEThe Key is set successfully.
FALSEThe Key is set unsuccessfully.
FALSEThis interface is not supported.

Definition at line 226 of file CryptHmacNull.c.

◆ HmacSha384Update()

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.

Parameters
[in,out]HmacSha384ContextPointer to the HMAC-SHA384 context.
[in]DataPointer to the buffer containing the data to be digested.
[in]DataSizeSize of Data buffer in bytes.
Return values
TRUEHMAC-SHA384 data digest succeeded.
FALSEHMAC-SHA384 data digest failed.
FALSEThis interface is not supported.

Definition at line 284 of file CryptHmacNull.c.