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

Go to the source code of this file.

Macros

#define SymCryptSha512_256AppendBlocks   SymCryptSha512AppendBlocks
 
#define ALG   SHA512_256
 
#define Alg   Sha512_256
 
#define SET_DATALENGTH(state, len)   {state.dataLengthL = len; state.dataLengthH = 0;}
 

Functions

VOID SYMCRYPT_CALL SymCryptHmacSha512_256Selftest (void)
 

Variables

const SYMCRYPT_MAC SymCryptHmacSha512_256Algorithm_default
 
const PCSYMCRYPT_MAC SymCryptHmacSha512_256Algorithm = &SymCryptHmacSha512_256Algorithm_default
 
static const BYTE hmacSha512_256Kat [32]
 

Macro Definition Documentation

◆ ALG

#define ALG   SHA512_256

Definition at line 11 of file hmacsha512_256.c.

◆ Alg

#define Alg   Sha512_256

Definition at line 12 of file hmacsha512_256.c.

◆ SET_DATALENGTH

#define SET_DATALENGTH (   state,
  len 
)    {state.dataLengthL = len; state.dataLengthH = 0;}

Definition at line 13 of file hmacsha512_256.c.

◆ SymCryptSha512_256AppendBlocks

#define SymCryptSha512_256AppendBlocks   SymCryptSha512AppendBlocks

Definition at line 9 of file hmacsha512_256.c.

Function Documentation

◆ SymCryptHmacSha512_256Selftest()

VOID SYMCRYPT_CALL SymCryptHmacSha512_256Selftest ( void  )

Definition at line 43 of file hmacsha512_256.c.

44{
47
50
51 SymCryptInjectError( res, sizeof( res ) );
52
53 if( memcmp( res, hmacSha512_256Kat, sizeof( res ) ) != 0 )
54 {
55 SymCryptFatal( 'hsh4' );
56 }
57
58 //
59 // Normally we would wipe the expanded key structure here,
60 // but as this is a selftest with known data this is not needed.
61 //
62}
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2807
GLuint res
Definition: glext.h:9613
static const BYTE hmacSha512_256Kat[32]
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
VOID SYMCRYPT_CALL SymCryptHmacSha512_256(_In_ PCSYMCRYPT_HMAC_SHA512_256_EXPANDED_KEY pExpandedKey, _In_reads_(cbData) PCBYTE pbData, SIZE_T cbData, _Out_writes_(SYMCRYPT_HMAC_SHA512_256_RESULT_SIZE) PBYTE pbResult)
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptHmacSha512_256ExpandKey(_Out_ PSYMCRYPT_HMAC_SHA512_256_EXPANDED_KEY pExpandedKey, _In_reads_opt_(cbKey) PCBYTE pbKey, SIZE_T cbKey)
_Analysis_noreturn_ VOID SYMCRYPT_CALL SymCryptFatal(UINT32 fatalCode)
#define SYMCRYPT_HMAC_SHA512_256_RESULT_SIZE
Definition: symcrypt.h:3116
SYMCRYPT_MAGIC_FIELD SYMCRYPT_HMAC_SHA512_256_EXPANDED_KEY
unsigned char BYTE
Definition: xxhash.c:193

Variable Documentation

◆ hmacSha512_256Kat

const BYTE hmacSha512_256Kat[32]
static
Initial value:
= {
0x79, 0x44, 0xb9, 0x97, 0xc0, 0xaa, 0xf7, 0x11,
0xdd, 0xb3, 0x78, 0x60, 0x68, 0xdb, 0x2b, 0xa1,
0x40, 0x80, 0x4f, 0xdc, 0xb7, 0x02, 0x7b, 0x6a,
0xe9, 0x9f, 0x5a, 0x38, 0xc8, 0x28, 0x67, 0x4c
}

Definition at line 33 of file hmacsha512_256.c.

Referenced by SymCryptHmacSha512_256Selftest().

◆ SymCryptHmacSha512_256Algorithm

const PCSYMCRYPT_MAC SymCryptHmacSha512_256Algorithm = &SymCryptHmacSha512_256Algorithm_default

Definition at line 31 of file hmacsha512_256.c.

◆ SymCryptHmacSha512_256Algorithm_default

const SYMCRYPT_MAC SymCryptHmacSha512_256Algorithm_default
Initial value:
= {
}
const PCSYMCRYPT_HASH SymCryptSha512_256Algorithm
Definition: sha512.c:172
VOID SYMCRYPT_CALL SymCryptHmacSha512_256Append(_Inout_ PSYMCRYPT_HMAC_SHA512_256_STATE pState, _In_reads_(cbData) PCBYTE pbData, SIZE_T cbData)
VOID SYMCRYPT_CALL SymCryptHmacSha512_256Result(_Inout_ PSYMCRYPT_HMAC_SHA512_256_STATE pState, _Out_writes_(SYMCRYPT_HMAC_SHA512_256_RESULT_SIZE) PBYTE pbResult)
VOID SYMCRYPT_CALL SymCryptHmacSha512_256Init(_Out_ PSYMCRYPT_HMAC_SHA512_256_STATE pState, _In_ PCSYMCRYPT_HMAC_SHA512_256_EXPANDED_KEY pExpandedKey)
SYMCRYPT_MAGIC_FIELD SYMCRYPT_HMAC_SHA512_256_STATE
SYMCRYPT_MD5_CHAINING_STATE outerState
#define SYMCRYPT_FIELD_OFFSET(type, field)

Definition at line 19 of file hmacsha512_256.c.