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

Go to the source code of this file.

Macros

#define ALG   SHA256
 
#define Alg   Sha256
 
#define SET_DATALENGTH(state, len)   {state.dataLengthL = len;}
 

Functions

VOID SYMCRYPT_CALL SymCryptHmacSha256Selftest (void)
 

Variables

const SYMCRYPT_MAC SymCryptHmacSha256Algorithm_default
 
const PCSYMCRYPT_MAC SymCryptHmacSha256Algorithm = &SymCryptHmacSha256Algorithm_default
 
static const BYTE hmacSha256Kat [32]
 

Macro Definition Documentation

◆ ALG

#define ALG   SHA256

Definition at line 9 of file hmacsha256.c.

◆ Alg

#define Alg   Sha256

Definition at line 10 of file hmacsha256.c.

◆ SET_DATALENGTH

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

Definition at line 11 of file hmacsha256.c.

Function Documentation

◆ SymCryptHmacSha256Selftest()

VOID SYMCRYPT_CALL SymCryptHmacSha256Selftest ( void  )

Definition at line 41 of file hmacsha256.c.

42{
45
48
49 SymCryptInjectError( res, sizeof( res ) );
50
51 if( memcmp( res, hmacSha256Kat, sizeof( res ) ) != 0 )
52 {
53 SymCryptFatal( 'hsh2' );
54 }
55
56 //
57 // Normally we would wipe the expanded key structure here,
58 // but as this is a selftest with known data this is not needed.
59 //
60}
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2807
GLuint res
Definition: glext.h:9613
static const BYTE hmacSha256Kat[32]
Definition: hmacsha256.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
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptHmacSha256ExpandKey(_Out_ PSYMCRYPT_HMAC_SHA256_EXPANDED_KEY pExpandedKey, _In_reads_opt_(cbKey) PCBYTE pbKey, SIZE_T cbKey)
_Analysis_noreturn_ VOID SYMCRYPT_CALL SymCryptFatal(UINT32 fatalCode)
#define SYMCRYPT_HMAC_SHA256_RESULT_SIZE
Definition: symcrypt.h:2856
VOID SYMCRYPT_CALL SymCryptHmacSha256(_In_ PCSYMCRYPT_HMAC_SHA256_EXPANDED_KEY pExpandedKey, _In_reads_(cbData) PCBYTE pbData, SIZE_T cbData, _Out_writes_(SYMCRYPT_HMAC_SHA256_RESULT_SIZE) PBYTE pbResult)
SYMCRYPT_MAGIC_FIELD SYMCRYPT_HMAC_SHA256_EXPANDED_KEY
unsigned char BYTE
Definition: xxhash.c:193

Variable Documentation

◆ hmacSha256Kat

const BYTE hmacSha256Kat[32]
static
Initial value:
= {
0xd6, 0x01, 0xcc, 0x17, 0x75, 0x59, 0xb0, 0x24,
0x84, 0x59, 0x78, 0x7f, 0x7e, 0x80, 0x4e, 0xd7,
0xf2, 0x76, 0x89, 0xb5, 0x99, 0x5c, 0x59, 0xb6,
0x61, 0x80, 0x2d, 0x96, 0x82, 0xfd, 0xf8, 0xd2,
}

Definition at line 31 of file hmacsha256.c.

Referenced by SymCryptHmacSha256Selftest().

◆ SymCryptHmacSha256Algorithm

◆ SymCryptHmacSha256Algorithm_default

const SYMCRYPT_MAC SymCryptHmacSha256Algorithm_default
Initial value:
= {
}
const PCSYMCRYPT_HASH SymCryptSha256Algorithm
Definition: sha256.c:46
VOID SYMCRYPT_CALL SymCryptHmacSha256Result(_Inout_ PSYMCRYPT_HMAC_SHA256_STATE pState, _Out_writes_(SYMCRYPT_HMAC_SHA256_RESULT_SIZE) PBYTE pbResult)
VOID SYMCRYPT_CALL SymCryptHmacSha256Init(_Out_ PSYMCRYPT_HMAC_SHA256_STATE pState, _In_ PCSYMCRYPT_HMAC_SHA256_EXPANDED_KEY pExpandedKey)
VOID SYMCRYPT_CALL SymCryptHmacSha256Append(_Inout_ PSYMCRYPT_HMAC_SHA256_STATE pState, _In_reads_(cbData) PCBYTE pbData, SIZE_T cbData)
SYMCRYPT_MD5_CHAINING_STATE outerState
SYMCRYPT_MAGIC_FIELD SYMCRYPT_HMAC_SHA256_STATE
#define SYMCRYPT_FIELD_OFFSET(type, field)

Definition at line 17 of file hmacsha256.c.