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

Go to the source code of this file.

Functions

SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptHmacSha3_512ExpandKey (_Out_ PSYMCRYPT_HMAC_SHA3_512_EXPANDED_KEY pExpandedKey, _In_reads_opt_(cbKey) PCBYTE pbKey, SIZE_T cbKey)
 
VOID SYMCRYPT_CALL SymCryptHmacSha3_512KeyCopy (_In_ PCSYMCRYPT_HMAC_SHA3_512_EXPANDED_KEY pSrc, _Out_ PSYMCRYPT_HMAC_SHA3_512_EXPANDED_KEY pDst)
 
VOID SYMCRYPT_CALL SymCryptHmacSha3_512 (_In_ PCSYMCRYPT_HMAC_SHA3_512_EXPANDED_KEY pExpandedKey, _In_reads_(cbData) PCBYTE pbData, SIZE_T cbData, _Out_writes_(SYMCRYPT_HMAC_SHA3_512_RESULT_SIZE) PBYTE pbResult)
 
VOID SYMCRYPT_CALL SymCryptHmacSha3_512StateCopy (_In_ PCSYMCRYPT_HMAC_SHA3_512_STATE pSrc, _In_opt_ PCSYMCRYPT_HMAC_SHA3_512_EXPANDED_KEY pExpandedKey, _Out_ PSYMCRYPT_HMAC_SHA3_512_STATE pDst)
 
VOID SYMCRYPT_CALL SymCryptHmacSha3_512Init (_Out_ PSYMCRYPT_HMAC_SHA3_512_STATE pState, _In_ PCSYMCRYPT_HMAC_SHA3_512_EXPANDED_KEY pExpandedKey)
 
VOID SYMCRYPT_CALL SymCryptHmacSha3_512Append (_Inout_ PSYMCRYPT_HMAC_SHA3_512_STATE pState, _In_reads_(cbData) PCBYTE pbData, SIZE_T cbData)
 
VOID SYMCRYPT_CALL SymCryptHmacSha3_512Result (_Inout_ PSYMCRYPT_HMAC_SHA3_512_STATE pState, _Out_writes_(SYMCRYPT_HMAC_SHA3_512_RESULT_SIZE) PBYTE pbResult)
 
VOID SYMCRYPT_CALL SymCryptHmacSha3_512Selftest (void)
 

Variables

const SYMCRYPT_MAC SymCryptHmacSha3_512Algorithm_default
 
const PCSYMCRYPT_MAC SymCryptHmacSha3_512Algorithm = &SymCryptHmacSha3_512Algorithm_default
 
static const BYTE hmacSha3_512Kat [64]
 

Function Documentation

◆ SymCryptHmacSha3_512()

Definition at line 30 of file hmacsha3_512.c.

35{
37}
static const BYTE pbResult[]
SYMCRYPT_NOINLINE VOID SYMCRYPT_CALL SymCryptHmac(_In_ PCSYMCRYPT_HMAC_EXPANDED_KEY pExpandedKey, _In_reads_(cbData) PCBYTE pbData, SIZE_T cbData, _Out_writes_(pExpandedKey->pHash->resultSize) PBYTE pbResult)
Definition: hmac.c:184
PCBYTE PBYTE SIZE_T cbData
PCBYTE pbData
PCVOID pExpandedKey

Referenced by SymCryptHmacSha3_512Selftest().

◆ SymCryptHmacSha3_512Append()

VOID SYMCRYPT_CALL SymCryptHmacSha3_512Append ( _Inout_ PSYMCRYPT_HMAC_SHA3_512_STATE  pState,
_In_reads_(cbData) PCBYTE  pbData,
SIZE_T  cbData 
)

Definition at line 60 of file hmacsha3_512.c.

64{
66}
VOID SYMCRYPT_CALL SymCryptHmacAppend(_Inout_ PSYMCRYPT_HMAC_STATE pState, _In_reads_(cbData) PCBYTE pbData, SIZE_T cbData)
Definition: hmac.c:130
PSYMCRYPT_COMMON_HASH_STATE pState

◆ SymCryptHmacSha3_512ExpandKey()

SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptHmacSha3_512ExpandKey ( _Out_ PSYMCRYPT_HMAC_SHA3_512_EXPANDED_KEY  pExpandedKey,
_In_reads_opt_(cbKey) PCBYTE  pbKey,
SIZE_T  cbKey 
)

Definition at line 11 of file hmacsha3_512.c.

15{
17}
const PCSYMCRYPT_HASH SymCryptSha3_512Algorithm
Definition: sha3_512.c:27
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptHmacExpandKey(_In_ PCSYMCRYPT_HASH pHash, _Out_ PSYMCRYPT_HMAC_EXPANDED_KEY pExpandedKey, _In_reads_opt_(cbKey) PCBYTE pbKey, SIZE_T cbKey)
Definition: hmac.c:53
PCBYTE pbKey
PCBYTE SIZE_T cbKey

Referenced by SymCryptHmacSha3_512Selftest().

◆ SymCryptHmacSha3_512Init()

VOID SYMCRYPT_CALL SymCryptHmacSha3_512Init ( _Out_ PSYMCRYPT_HMAC_SHA3_512_STATE  pState,
_In_ PCSYMCRYPT_HMAC_SHA3_512_EXPANDED_KEY  pExpandedKey 
)

Definition at line 51 of file hmacsha3_512.c.

54{
55 SymCryptHmacInit(&pState->generic, &pExpandedKey->generic);
56}
SYMCRYPT_NOINLINE VOID SYMCRYPT_CALL SymCryptHmacInit(_Out_ PSYMCRYPT_HMAC_STATE pState, _In_ PCSYMCRYPT_HMAC_EXPANDED_KEY pExpandedKey)
Definition: hmac.c:115

◆ SymCryptHmacSha3_512KeyCopy()

Definition at line 21 of file hmacsha3_512.c.

24{
25 SymCryptHmacKeyCopy(&pSrc->generic, &pDst->generic);
26}
VOID SYMCRYPT_CALL SymCryptHmacKeyCopy(_In_ PCSYMCRYPT_HMAC_EXPANDED_KEY pSrc, _Out_ PSYMCRYPT_HMAC_EXPANDED_KEY pDst)
Definition: hmac.c:36

◆ SymCryptHmacSha3_512Result()

Definition at line 70 of file hmacsha3_512.c.

73{
75}
SYMCRYPT_NOINLINE VOID SYMCRYPT_CALL SymCryptHmacResult(_Inout_ PSYMCRYPT_HMAC_STATE pState, _Out_writes_(pState->pKey->pHash->resultSize) PBYTE pbResult)
Definition: hmac.c:141

◆ SymCryptHmacSha3_512Selftest()

VOID SYMCRYPT_CALL SymCryptHmacSha3_512Selftest ( void  )

Definition at line 107 of file hmacsha3_512.c.

108{
111
114
115 SymCryptInjectError( res, sizeof( res ) );
116
117 if( memcmp( res, hmacSha3_512Kat, sizeof( res ) ) != 0 )
118 {
119 SymCryptFatal( 'hsh3' );
120 }
121
122 //
123 // Normally we would wipe the expanded key structure here,
124 // but as this is a selftest with known data this is not needed.
125 //
126}
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2807
GLuint res
Definition: glext.h:9613
VOID SYMCRYPT_CALL SymCryptHmacSha3_512(_In_ PCSYMCRYPT_HMAC_SHA3_512_EXPANDED_KEY pExpandedKey, _In_reads_(cbData) PCBYTE pbData, SIZE_T cbData, _Out_writes_(SYMCRYPT_HMAC_SHA3_512_RESULT_SIZE) PBYTE pbResult)
Definition: hmacsha3_512.c:30
static const BYTE hmacSha3_512Kat[64]
Definition: hmacsha3_512.c:93
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptHmacSha3_512ExpandKey(_Out_ PSYMCRYPT_HMAC_SHA3_512_EXPANDED_KEY pExpandedKey, _In_reads_opt_(cbKey) PCBYTE pbKey, SIZE_T cbKey)
Definition: hmacsha3_512.c:11
VOID SYMCRYPT_CALL SymCryptInjectError(PBYTE pbData, SIZE_T cbData)
const BYTE SymCryptTestKey32[32]
Definition: selftest.c:10
const BYTE SymCryptTestMsg3[3]
Definition: selftest.c:8
_Analysis_noreturn_ VOID SYMCRYPT_CALL SymCryptFatal(UINT32 fatalCode)
#define SYMCRYPT_HMAC_SHA3_512_RESULT_SIZE
Definition: symcrypt.h:3374
SYMCRYPT_HMAC_SHA3_512_EXPANDED_KEY
unsigned char BYTE
Definition: xxhash.c:193

◆ SymCryptHmacSha3_512StateCopy()

Definition at line 41 of file hmacsha3_512.c.

45{
46 SymCryptHmacStateCopy(&pSrc->generic, pExpandedKey == NULL ? NULL : &pExpandedKey->generic, &pDst->generic);
47}
#define NULL
Definition: types.h:112
VOID SYMCRYPT_CALL SymCryptHmacStateCopy(_In_ PCSYMCRYPT_HMAC_STATE pSrc, _In_opt_ PCSYMCRYPT_HMAC_EXPANDED_KEY pExpandedKey, _Out_ PSYMCRYPT_HMAC_STATE pDst)
Definition: hmac.c:10

Variable Documentation

◆ hmacSha3_512Kat

const BYTE hmacSha3_512Kat[64]
static
Initial value:
=
{
0x83, 0x3b, 0x31, 0xe7, 0x77, 0xd6, 0xb3, 0x3d,
0x75, 0x23, 0xa5, 0x79, 0xcc, 0x3b, 0xeb, 0x27,
0x6f, 0xd6, 0x52, 0x57, 0x54, 0xc4, 0xc5, 0x4b,
0x2d, 0x5a, 0x34, 0x7d, 0x36, 0x24, 0x07, 0x91,
0x7a, 0x3c, 0x62, 0x6e, 0x7e, 0xdb, 0x8e, 0x49,
0x3b, 0x42, 0xc8, 0xe5, 0xa6, 0x96, 0xd5, 0xe6,
0x6b, 0xa7, 0xad, 0x20, 0x00, 0xeb, 0x6c, 0xff,
0x76, 0xcb, 0x1e, 0xc0, 0x30, 0x13, 0x0e, 0x81
}

Definition at line 93 of file hmacsha3_512.c.

Referenced by SymCryptHmacSha3_512Selftest().

◆ SymCryptHmacSha3_512Algorithm

Definition at line 90 of file hmacsha3_512.c.

◆ SymCryptHmacSha3_512Algorithm_default

const SYMCRYPT_MAC SymCryptHmacSha3_512Algorithm_default
Initial value:
= {
}
VOID SYMCRYPT_CALL SymCryptHmacSha3_512Result(_Inout_ PSYMCRYPT_HMAC_SHA3_512_STATE pState, _Out_writes_(SYMCRYPT_HMAC_SHA3_512_RESULT_SIZE) PBYTE pbResult)
Definition: hmacsha3_512.c:70
VOID SYMCRYPT_CALL SymCryptHmacSha3_512Append(_Inout_ PSYMCRYPT_HMAC_SHA3_512_STATE pState, _In_reads_(cbData) PCBYTE pbData, SIZE_T cbData)
Definition: hmacsha3_512.c:60
VOID SYMCRYPT_CALL SymCryptHmacSha3_512Init(_Out_ PSYMCRYPT_HMAC_SHA3_512_STATE pState, _In_ PCSYMCRYPT_HMAC_SHA3_512_EXPANDED_KEY pExpandedKey)
Definition: hmacsha3_512.c:51
@ generic
Definition: optimize.h:97
SYMCRYPT_HMAC_SHA3_512_STATE
#define SYMCRYPT_FIELD_OFFSET(type, field)

Definition at line 78 of file hmacsha3_512.c.