TianoCore EDK2 master
|
#include "CryptParallelHash.h"
Go to the source code of this file.
Macros | |
#define | CSHAKE256_SECURITY_STRENGTH 256 |
#define | CSHAKE256_RATE_IN_BYTES 136 |
Functions | |
BOOLEAN EFIAPI | CShake256Init (OUT VOID *CShake256Context, IN UINTN OutputLen, IN CONST VOID *Name, IN UINTN NameLen, IN CONST VOID *Customization, IN UINTN CustomizationLen) |
BOOLEAN EFIAPI | CShake256Update (IN OUT VOID *CShake256Context, IN CONST VOID *Data, IN UINTN DataSize) |
BOOLEAN EFIAPI | CShake256Final (IN OUT VOID *CShake256Context, OUT UINT8 *HashValue) |
BOOLEAN EFIAPI | CShake256HashAll (IN CONST VOID *Data, IN UINTN DataSize, IN UINTN OutputLen, IN CONST VOID *Name, IN UINTN NameLen, IN CONST VOID *Customization, IN UINTN CustomizationLen, OUT UINT8 *HashValue) |
Variables | |
CONST CHAR8 | mZeroPadding [CSHAKE256_RATE_IN_BYTES] = { 0 } |
cSHAKE-256 Digest Wrapper Implementations.
Copyright (c) 2022, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file CryptCShake256.c.
#define CSHAKE256_RATE_IN_BYTES 136 |
Definition at line 12 of file CryptCShake256.c.
#define CSHAKE256_SECURITY_STRENGTH 256 |
Definition at line 11 of file CryptCShake256.c.
Completes computation of the cSHAKE-256 digest value.
This function completes cSHAKE-256 hash computation and retrieves the digest value into the specified memory. After this function has been called, the cSHAKE-256 context cannot be used again. cSHAKE-256 context should be already correctly initialized by CShake256Init(), and should not be finalized by CShake256Final(). Behavior with invalid cSHAKE-256 context is undefined.
[in,out] | CShake256Context | Pointer to the cSHAKE-256 context. |
[out] | HashValue | Pointer to a buffer that receives the cSHAKE-256 digest value. |
TRUE | cSHAKE-256 digest computation succeeded. |
FALSE | cSHAKE-256 digest computation failed. |
FALSE | This interface is not supported. |
Definition at line 205 of file CryptCShake256.c.
BOOLEAN EFIAPI CShake256HashAll | ( | IN CONST VOID * | Data, |
IN UINTN | DataSize, | ||
IN UINTN | OutputLen, | ||
IN CONST VOID * | Name, | ||
IN UINTN | NameLen, | ||
IN CONST VOID * | Customization, | ||
IN UINTN | CustomizationLen, | ||
OUT UINT8 * | HashValue | ||
) |
Computes the CSHAKE-256 message digest of a input data buffer.
This function performs the CSHAKE-256 message digest of a given data buffer, and places the digest value into the specified memory.
[in] | Data | Pointer to the buffer containing the data to be hashed. |
[in] | DataSize | Size of Data buffer in bytes. |
[in] | OutputLen | Size of output in bytes. |
[in] | Name | Pointer to the function name string. |
[in] | NameLen | Size of the function name in bytes. |
[in] | Customization | Pointer to the customization string. |
[in] | CustomizationLen | Size of the customization string in bytes. |
[out] | HashValue | Pointer to a buffer that receives the CSHAKE-256 digest value. |
TRUE | CSHAKE-256 digest computation succeeded. |
FALSE | CSHAKE-256 digest computation failed. |
FALSE | This interface is not supported. |
Definition at line 246 of file CryptCShake256.c.
BOOLEAN EFIAPI CShake256Init | ( | OUT VOID * | CShake256Context, |
IN UINTN | OutputLen, | ||
IN CONST VOID * | Name, | ||
IN UINTN | NameLen, | ||
IN CONST VOID * | Customization, | ||
IN UINTN | CustomizationLen | ||
) |
CShake256 initial function.
Initializes user-supplied memory pointed by CShake256Context as cSHAKE-256 hash context for subsequent use.
[out] | CShake256Context | Pointer to cSHAKE-256 context being initialized. |
[in] | OutputLen | The desired number of output length in bytes. |
[in] | Name | Pointer to the function name string. |
[in] | NameLen | The length of the function name in bytes. |
[in] | Customization | Pointer to the customization string. |
[in] | CustomizationLen | The length of the customization string in bytes. |
TRUE | cSHAKE-256 context initialization succeeded. |
FALSE | cSHAKE-256 context initialization failed. |
FALSE | This interface is not supported. |
Definition at line 35 of file CryptCShake256.c.
BOOLEAN EFIAPI CShake256Update | ( | IN OUT VOID * | CShake256Context, |
IN CONST VOID * | Data, | ||
IN UINTN | DataSize | ||
) |
Digests the input data and updates cSHAKE-256 context.
This function performs cSHAKE-256 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. cSHAKE-256 context should be already correctly initialized by CShake256Init(), and should not be finalized by CShake256Final(). Behavior with invalid context is undefined.
[in,out] | CShake256Context | Pointer to the cSHAKE-256 context. |
[in] | Data | Pointer to the buffer containing the data to be hashed. |
[in] | DataSize | Size of Data buffer in bytes. |
TRUE | cSHAKE-256 data digest succeeded. |
FALSE | cSHAKE-256 data digest failed. |
FALSE | This interface is not supported. |
Definition at line 162 of file CryptCShake256.c.
CONST CHAR8 mZeroPadding[CSHAKE256_RATE_IN_BYTES] = { 0 } |
Definition at line 14 of file CryptCShake256.c.