ReactOS 0.4.17-dev-1005-g171e1de
sha3_512.c File Reference
#include "precomp.h"
#include "hash_pattern.c"
Include dependency graph for sha3_512.c:

Go to the source code of this file.

Macros

#define ALG   SHA3_512
 
#define Alg   Sha3_512
 

Functions

VOID SYMCRYPT_CALL SymCryptSha3_512Init (_Out_ PSYMCRYPT_SHA3_512_STATE pState)
 
VOID SYMCRYPT_CALL SymCryptSha3_512Append (_Inout_ PSYMCRYPT_SHA3_512_STATE pState, _In_reads_(cbData) PCBYTE pbData, SIZE_T cbData)
 
VOID SYMCRYPT_CALL SymCryptSha3_512Result (_Inout_ PSYMCRYPT_SHA3_512_STATE pState, _Out_writes_(SYMCRYPT_SHA3_512_RESULT_SIZE) PBYTE pbResult)
 
VOID SYMCRYPT_CALL SymCryptSha3_512StateExport (_In_ PCSYMCRYPT_SHA3_512_STATE pState, _Out_writes_bytes_(SYMCRYPT_SHA3_512_STATE_EXPORT_SIZE) PBYTE pbBlob)
 
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptSha3_512StateImport (_Out_ PSYMCRYPT_SHA3_512_STATE pState, _In_reads_bytes_(SYMCRYPT_SHA3_512_STATE_EXPORT_SIZE) PCBYTE pbBlob)
 
VOID SYMCRYPT_CALL SymCryptSha3_512Selftest (void)
 

Variables

const SYMCRYPT_HASH SymCryptSha3_512Algorithm_default
 
const PCSYMCRYPT_HASH SymCryptSha3_512Algorithm = &SymCryptSha3_512Algorithm_default
 
static const BYTE sha3_512KATAnswer [64]
 

Macro Definition Documentation

◆ ALG

#define ALG   SHA3_512

Definition at line 33 of file sha3_512.c.

◆ Alg

#define Alg   Sha3_512

Definition at line 34 of file sha3_512.c.

Function Documentation

◆ SymCryptSha3_512Append()

VOID SYMCRYPT_CALL SymCryptSha3_512Append ( _Inout_ PSYMCRYPT_SHA3_512_STATE  pState,
_In_reads_(cbData) PCBYTE  pbData,
SIZE_T  cbData 
)

Definition at line 60 of file sha3_512.c.

64{
66}
VOID SYMCRYPT_CALL SymCryptKeccakAppend(_Inout_ PSYMCRYPT_KECCAK_STATE pState, _In_reads_(cbData) PCBYTE pbData, SIZE_T cbData)
Definition: sha3.c:285
PCBYTE PBYTE SIZE_T cbData
PSYMCRYPT_COMMON_HASH_STATE pState
PCBYTE pbData

Referenced by SymCryptMlKemEncapsulateInternal().

◆ SymCryptSha3_512Init()

VOID SYMCRYPT_CALL SymCryptSha3_512Init ( _Out_ PSYMCRYPT_SHA3_512_STATE  pState)

Definition at line 45 of file sha3_512.c.

46{
50
52}
VOID SYMCRYPT_CALL SymCryptKeccakInit(_Out_ PSYMCRYPT_KECCAK_STATE pState, UINT32 inputBlockSize, UINT8 padding)
Definition: sha3.c:174
#define SYMCRYPT_SHA3_PADDING_VALUE
Definition: sc_lib.h:1808
#define SYMCRYPT_SHA3_512_INPUT_BLOCK_SIZE
Definition: symcrypt.h:1723
#define SYMCRYPT_SET_MAGIC(p)

Referenced by SymCryptMlKemEncapsulateInternal().

◆ SymCryptSha3_512Result()

Definition at line 74 of file sha3_512.c.

77{
79}
#define TRUE
Definition: types.h:120
VOID SYMCRYPT_CALL SymCryptKeccakExtract(_Inout_ PSYMCRYPT_KECCAK_STATE pState, _Out_writes_(cbResult) PBYTE pbResult, SIZE_T cbResult, BOOLEAN bWipe)
Definition: sha3.c:411
static const BYTE pbResult[]
#define SYMCRYPT_SHA3_512_RESULT_SIZE
Definition: symcrypt.h:1722

Referenced by SymCryptMlKemEncapsulateInternal().

◆ SymCryptSha3_512Selftest()

VOID SYMCRYPT_CALL SymCryptSha3_512Selftest ( void  )

Definition at line 132 of file sha3_512.c.

133{
135
137
139
140 if (memcmp(result, sha3_512KATAnswer, sizeof(result)) != 0)
141 {
142 SymCryptFatal('SHA3');
143 }
144}
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2807
GLuint64EXT * result
Definition: glext.h:11304
VOID SYMCRYPT_CALL SymCryptInjectError(PBYTE pbData, SIZE_T cbData)
const BYTE SymCryptTestMsg3[3]
Definition: selftest.c:8
static const BYTE sha3_512KATAnswer[64]
Definition: sha3_512.c:119
_Analysis_noreturn_ VOID SYMCRYPT_CALL SymCryptFatal(UINT32 fatalCode)
VOID SYMCRYPT_CALL SymCryptSha3_512(_In_reads_(cbData) PCBYTE pbData, SIZE_T cbData, _Out_writes_(SYMCRYPT_SHA3_512_RESULT_SIZE) PBYTE pbResult)
unsigned char BYTE
Definition: xxhash.c:193

◆ SymCryptSha3_512StateExport()

Definition at line 87 of file sha3_512.c.

90{
93}
@ SymCryptBlobTypeSha3_512State
Definition: sc_lib.h:1070
VOID SYMCRYPT_CALL SymCryptKeccakStateExport(SYMCRYPT_BLOB_TYPE type, _In_ PCSYMCRYPT_KECCAK_STATE pState, _Out_writes_bytes_(SYMCRYPT_KECCAK_STATE_EXPORT_SIZE) PBYTE pbBlob)
Definition: sha3.c:479
#define SYMCRYPT_CHECK_MAGIC(p)

◆ SymCryptSha3_512StateImport()

Definition at line 100 of file sha3_512.c.

103{
105
106 if (scError == SYMCRYPT_NO_ERROR)
107 {
109 }
110
111 return scError;
112}
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptKeccakStateImport(SYMCRYPT_BLOB_TYPE type, _Out_ PSYMCRYPT_KECCAK_STATE pState, _In_reads_bytes_(SYMCRYPT_KECCAK_STATE_EXPORT_SIZE) PCBYTE pbBlob)
Definition: sha3.c:518
SYMCRYPT_ERROR
Definition: symcrypt.h:227

Variable Documentation

◆ sha3_512KATAnswer

const BYTE sha3_512KATAnswer[64]
static
Initial value:
= {
0xb7, 0x51, 0x85, 0x0b, 0x1a, 0x57, 0x16, 0x8a,
0x56, 0x93, 0xcd, 0x92, 0x4b, 0x6b, 0x09, 0x6e,
0x08, 0xf6, 0x21, 0x82, 0x74, 0x44, 0xf7, 0x0d,
0x88, 0x4f, 0x5d, 0x02, 0x40, 0xd2, 0x71, 0x2e,
0x10, 0xe1, 0x16, 0xe9, 0x19, 0x2a, 0xf3, 0xc9,
0x1a, 0x7e, 0xc5, 0x76, 0x47, 0xe3, 0x93, 0x40,
0x57, 0x34, 0x0b, 0x4c, 0xf4, 0x08, 0xd5, 0xa5,
0x65, 0x92, 0xf8, 0x27, 0x4e, 0xec, 0x53, 0xf0
}

Definition at line 119 of file sha3_512.c.

Referenced by SymCryptSha3_512Selftest().

◆ SymCryptSha3_512Algorithm

Definition at line 27 of file sha3_512.c.

Referenced by SymCryptHmacSha3_512ExpandKey().

◆ SymCryptSha3_512Algorithm_default

const SYMCRYPT_HASH SymCryptSha3_512Algorithm_default
Initial value:
= {
NULL,
}
#define NULL
Definition: types.h:112
VOID SYMCRYPT_CALL SymCryptSha3_512Init(_Out_ PSYMCRYPT_SHA3_512_STATE pState)
Definition: sha3_512.c:45
VOID SYMCRYPT_CALL SymCryptSha3_512Append(_Inout_ PSYMCRYPT_SHA3_512_STATE pState, _In_reads_(cbData) PCBYTE pbData, SIZE_T cbData)
Definition: sha3_512.c:60
VOID SYMCRYPT_CALL SymCryptSha3_512Result(_Inout_ PSYMCRYPT_SHA3_512_STATE pState, _Out_writes_(SYMCRYPT_SHA3_512_RESULT_SIZE) PBYTE pbResult)
Definition: sha3_512.c:74
VOID SYMCRYPT_CALL SymCryptSha3_512StateCopy(_In_ PCSYMCRYPT_SHA3_512_STATE pSrc, _Out_ PSYMCRYPT_SHA3_512_STATE pDst)
#define SYMCRYPT_FIELD_SIZE(type, field)
SYMCRYPT_MAGIC_FIELD SYMCRYPT_SHA3_512_STATE
#define SYMCRYPT_FIELD_OFFSET(type, field)

Definition at line 14 of file sha3_512.c.