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

Go to the source code of this file.

Functions

SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptHmacSha3_384ExpandKey (_Out_ PSYMCRYPT_HMAC_SHA3_384_EXPANDED_KEY pExpandedKey, _In_reads_opt_(cbKey) PCBYTE pbKey, SIZE_T cbKey)
 
VOID SYMCRYPT_CALL SymCryptHmacSha3_384KeyCopy (_In_ PCSYMCRYPT_HMAC_SHA3_384_EXPANDED_KEY pSrc, _Out_ PSYMCRYPT_HMAC_SHA3_384_EXPANDED_KEY pDst)
 
VOID SYMCRYPT_CALL SymCryptHmacSha3_384 (_In_ PCSYMCRYPT_HMAC_SHA3_384_EXPANDED_KEY pExpandedKey, _In_reads_(cbData) PCBYTE pbData, SIZE_T cbData, _Out_writes_(SYMCRYPT_HMAC_SHA3_384_RESULT_SIZE) PBYTE pbResult)
 
VOID SYMCRYPT_CALL SymCryptHmacSha3_384StateCopy (_In_ PCSYMCRYPT_HMAC_SHA3_384_STATE pSrc, _In_opt_ PCSYMCRYPT_HMAC_SHA3_384_EXPANDED_KEY pExpandedKey, _Out_ PSYMCRYPT_HMAC_SHA3_384_STATE pDst)
 
VOID SYMCRYPT_CALL SymCryptHmacSha3_384Init (_Out_ PSYMCRYPT_HMAC_SHA3_384_STATE pState, _In_ PCSYMCRYPT_HMAC_SHA3_384_EXPANDED_KEY pExpandedKey)
 
VOID SYMCRYPT_CALL SymCryptHmacSha3_384Append (_Inout_ PSYMCRYPT_HMAC_SHA3_384_STATE pState, _In_reads_(cbData) PCBYTE pbData, SIZE_T cbData)
 
VOID SYMCRYPT_CALL SymCryptHmacSha3_384Result (_Inout_ PSYMCRYPT_HMAC_SHA3_384_STATE pState, _Out_writes_(SYMCRYPT_HMAC_SHA3_384_RESULT_SIZE) PBYTE pbResult)
 
VOID SYMCRYPT_CALL SymCryptHmacSha3_384Selftest (void)
 

Variables

const SYMCRYPT_MAC SymCryptHmacSha3_384Algorithm_default
 
const PCSYMCRYPT_MAC SymCryptHmacSha3_384Algorithm = &SymCryptHmacSha3_384Algorithm_default
 
static const BYTE hmacSha3_384Kat [48]
 

Function Documentation

◆ SymCryptHmacSha3_384()

Definition at line 30 of file hmacsha3_384.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_384Selftest().

◆ SymCryptHmacSha3_384Append()

VOID SYMCRYPT_CALL SymCryptHmacSha3_384Append ( _Inout_ PSYMCRYPT_HMAC_SHA3_384_STATE  pState,
_In_reads_(cbData) PCBYTE  pbData,
SIZE_T  cbData 
)

Definition at line 60 of file hmacsha3_384.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_384ExpandKey()

SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptHmacSha3_384ExpandKey ( _Out_ PSYMCRYPT_HMAC_SHA3_384_EXPANDED_KEY  pExpandedKey,
_In_reads_opt_(cbKey) PCBYTE  pbKey,
SIZE_T  cbKey 
)

Definition at line 11 of file hmacsha3_384.c.

15{
17}
const PCSYMCRYPT_HASH SymCryptSha3_384Algorithm
Definition: sha3_384.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_384Selftest().

◆ SymCryptHmacSha3_384Init()

VOID SYMCRYPT_CALL SymCryptHmacSha3_384Init ( _Out_ PSYMCRYPT_HMAC_SHA3_384_STATE  pState,
_In_ PCSYMCRYPT_HMAC_SHA3_384_EXPANDED_KEY  pExpandedKey 
)

Definition at line 51 of file hmacsha3_384.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_384KeyCopy()

Definition at line 21 of file hmacsha3_384.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_384Result()

Definition at line 70 of file hmacsha3_384.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_384Selftest()

VOID SYMCRYPT_CALL SymCryptHmacSha3_384Selftest ( void  )

Definition at line 105 of file hmacsha3_384.c.

106{
109
112
113 SymCryptInjectError( res, sizeof( res ) );
114
115 if( memcmp( res, hmacSha3_384Kat, sizeof( res ) ) != 0 )
116 {
117 SymCryptFatal( 'hsh3' );
118 }
119
120 //
121 // Normally we would wipe the expanded key structure here,
122 // but as this is a selftest with known data this is not needed.
123 //
124}
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2807
GLuint res
Definition: glext.h:9613
static const BYTE hmacSha3_384Kat[48]
Definition: hmacsha3_384.c:93
VOID SYMCRYPT_CALL SymCryptHmacSha3_384(_In_ PCSYMCRYPT_HMAC_SHA3_384_EXPANDED_KEY pExpandedKey, _In_reads_(cbData) PCBYTE pbData, SIZE_T cbData, _Out_writes_(SYMCRYPT_HMAC_SHA3_384_RESULT_SIZE) PBYTE pbResult)
Definition: hmacsha3_384.c:30
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptHmacSha3_384ExpandKey(_Out_ PSYMCRYPT_HMAC_SHA3_384_EXPANDED_KEY pExpandedKey, _In_reads_opt_(cbKey) PCBYTE pbKey, SIZE_T cbKey)
Definition: hmacsha3_384.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_384_RESULT_SIZE
Definition: symcrypt.h:3310
SYMCRYPT_HMAC_SHA3_384_EXPANDED_KEY
unsigned char BYTE
Definition: xxhash.c:193

◆ SymCryptHmacSha3_384StateCopy()

Definition at line 41 of file hmacsha3_384.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_384Kat

const BYTE hmacSha3_384Kat[48]
static
Initial value:
=
{
0x8f, 0xc4, 0x8a, 0x84, 0xb5, 0xa7, 0xa1, 0x36,
0x3c, 0x3b, 0x4b, 0x21, 0x3c, 0xfb, 0x65, 0x36,
0xa6, 0x2b, 0xa3, 0x4c, 0x12, 0x33, 0xa1, 0x27,
0xbc, 0xfc, 0xb2, 0xd7, 0xae, 0xaf, 0x30, 0x6b,
0xc9, 0xe6, 0x90, 0xfd, 0xf1, 0xfa, 0x12, 0x61,
0xa4, 0x7e, 0xb2, 0x27, 0x1a, 0xeb, 0xf1, 0x34
}

Definition at line 93 of file hmacsha3_384.c.

Referenced by SymCryptHmacSha3_384Selftest().

◆ SymCryptHmacSha3_384Algorithm

Definition at line 90 of file hmacsha3_384.c.

◆ SymCryptHmacSha3_384Algorithm_default

const SYMCRYPT_MAC SymCryptHmacSha3_384Algorithm_default
Initial value:
= {
}
VOID SYMCRYPT_CALL SymCryptHmacSha3_384Append(_Inout_ PSYMCRYPT_HMAC_SHA3_384_STATE pState, _In_reads_(cbData) PCBYTE pbData, SIZE_T cbData)
Definition: hmacsha3_384.c:60
VOID SYMCRYPT_CALL SymCryptHmacSha3_384Init(_Out_ PSYMCRYPT_HMAC_SHA3_384_STATE pState, _In_ PCSYMCRYPT_HMAC_SHA3_384_EXPANDED_KEY pExpandedKey)
Definition: hmacsha3_384.c:51
VOID SYMCRYPT_CALL SymCryptHmacSha3_384Result(_Inout_ PSYMCRYPT_HMAC_SHA3_384_STATE pState, _Out_writes_(SYMCRYPT_HMAC_SHA3_384_RESULT_SIZE) PBYTE pbResult)
Definition: hmacsha3_384.c:70
@ generic
Definition: optimize.h:97
#define SYMCRYPT_FIELD_OFFSET(type, field)
SYMCRYPT_HMAC_SHA3_384_STATE

Definition at line 78 of file hmacsha3_384.c.