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

Go to the source code of this file.

Macros

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

Functions

VOID SYMCRYPT_CALL SymCryptHmacSha512Selftest (void)
 

Variables

const SYMCRYPT_MAC SymCryptHmacSha512Algorithm_default
 
const PCSYMCRYPT_MAC SymCryptHmacSha512Algorithm = &SymCryptHmacSha512Algorithm_default
 
static const BYTE hmacSha512Kat [64]
 

Macro Definition Documentation

◆ ALG

#define ALG   SHA512

Definition at line 9 of file hmacsha512.c.

◆ Alg

#define Alg   Sha512

Definition at line 10 of file hmacsha512.c.

◆ SET_DATALENGTH

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

Definition at line 11 of file hmacsha512.c.

Function Documentation

◆ SymCryptHmacSha512Selftest()

VOID SYMCRYPT_CALL SymCryptHmacSha512Selftest ( void  )

Definition at line 41 of file hmacsha512.c.

42{
45
48
49 SymCryptInjectError( res, sizeof( res ) );
50 if( memcmp( res, hmacSha512Kat, sizeof( res ) ) != 0 )
51 {
52 SymCryptFatal( 'hsh5' );
53 }
54
55 //
56 // Normally we would wipe the expanded key structure here,
57 // but as this is a selftest with known data this is not needed.
58 //
59}
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2807
GLuint res
Definition: glext.h:9613
static const BYTE hmacSha512Kat[64]
Definition: hmacsha512.c:31
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)
VOID SYMCRYPT_CALL SymCryptHmacSha512(_In_ PCSYMCRYPT_HMAC_SHA512_EXPANDED_KEY pExpandedKey, _In_reads_(cbData) PCBYTE pbData, SIZE_T cbData, _Out_writes_(SYMCRYPT_HMAC_SHA512_RESULT_SIZE) PBYTE pbResult)
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptHmacSha512ExpandKey(_Out_ PSYMCRYPT_HMAC_SHA512_EXPANDED_KEY pExpandedKey, _In_reads_opt_(cbKey) PCBYTE pbKey, SIZE_T cbKey)
#define SYMCRYPT_HMAC_SHA512_RESULT_SIZE
Definition: symcrypt.h:2984
SYMCRYPT_MAGIC_FIELD SYMCRYPT_HMAC_SHA512_EXPANDED_KEY
unsigned char BYTE
Definition: xxhash.c:193

Variable Documentation

◆ hmacSha512Kat

const BYTE hmacSha512Kat[64]
static
Initial value:
= {
0x07, 0x64, 0xa6, 0x58, 0xeb, 0x3e, 0x2f, 0xb0, 0x2c, 0x06, 0x72, 0x93, 0xcd, 0xaa, 0x3c, 0x05,
0x28, 0x73, 0x15, 0xf2, 0xd3, 0xb4, 0x5a, 0x28, 0x10, 0x20, 0x1e, 0x26, 0xc3, 0x89, 0x35, 0x48,
0xe9, 0xea, 0xca, 0x72, 0xf0, 0x2e, 0x04, 0x19, 0x20, 0x31, 0x71, 0x68, 0xb5, 0x7a, 0x86, 0x40,
0x29, 0x1b, 0x3b, 0xb7, 0xaa, 0x4a, 0x5f, 0xaf, 0x80, 0x26, 0xb4, 0xad, 0x23, 0x5a, 0xc4, 0x25,
}

Definition at line 31 of file hmacsha512.c.

Referenced by SymCryptHmacSha512Selftest().

◆ SymCryptHmacSha512Algorithm

Definition at line 29 of file hmacsha512.c.

Referenced by SymCryptSp800_108_HmacSha512SelfTest().

◆ SymCryptHmacSha512Algorithm_default

const SYMCRYPT_MAC SymCryptHmacSha512Algorithm_default
Initial value:
= {
}
VOID SYMCRYPT_CALL SymCryptHmacSha512Append(_Inout_ PSYMCRYPT_HMAC_SHA512_STATE pState, _In_reads_(cbData) PCBYTE pbData, SIZE_T cbData)
VOID SYMCRYPT_CALL SymCryptHmacSha512Init(_Out_ PSYMCRYPT_HMAC_SHA512_STATE pState, _In_ PCSYMCRYPT_HMAC_SHA512_EXPANDED_KEY pExpandedKey)
VOID SYMCRYPT_CALL SymCryptHmacSha512Result(_Inout_ PSYMCRYPT_HMAC_SHA512_STATE pState, _Out_writes_(SYMCRYPT_HMAC_SHA512_RESULT_SIZE) PBYTE pbResult)
const PCSYMCRYPT_HASH SymCryptSha512Algorithm
Definition: sha512.c:170
SYMCRYPT_MD5_CHAINING_STATE outerState
#define SYMCRYPT_FIELD_OFFSET(type, field)
SYMCRYPT_MAGIC_FIELD SYMCRYPT_HMAC_SHA512_STATE

Definition at line 17 of file hmacsha512.c.