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

Go to the source code of this file.

Macros

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

Functions

VOID SYMCRYPT_CALL SymCryptHmacSha1Selftest (void)
 

Variables

const SYMCRYPT_MAC SymCryptHmacSha1Algorithm_default
 
const PCSYMCRYPT_MAC SymCryptHmacSha1Algorithm = &SymCryptHmacSha1Algorithm_default
 
static const BYTE hmacSha1Kat [20]
 

Macro Definition Documentation

◆ ALG

#define ALG   SHA1

Definition at line 16 of file hmacsha1.c.

◆ Alg

#define Alg   Sha1

Definition at line 17 of file hmacsha1.c.

◆ SET_DATALENGTH

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

Definition at line 18 of file hmacsha1.c.

Function Documentation

◆ SymCryptHmacSha1Selftest()

VOID SYMCRYPT_CALL SymCryptHmacSha1Selftest ( void  )

Definition at line 46 of file hmacsha1.c.

47{
50
53
54 SymCryptInjectError( res, sizeof( res ) );
55
56 if( memcmp( res, hmacSha1Kat, sizeof( res ) ) != 0 )
57 {
58 SymCryptFatal( 'hSh1' );
59 }
60
61 //
62 // Normally we would wipe the expanded key structure here,
63 // but as this is a selftest with known data this is not needed.
64 //
65}
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2807
GLuint res
Definition: glext.h:9613
static const BYTE hmacSha1Kat[20]
Definition: hmacsha1.c:38
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 SymCryptHmacSha1(_In_ PCSYMCRYPT_HMAC_SHA1_EXPANDED_KEY pExpandedKey, _In_reads_(cbData) PCBYTE pbData, SIZE_T cbData, _Out_writes_(SYMCRYPT_HMAC_SHA1_RESULT_SIZE) PBYTE pbResult)
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptHmacSha1ExpandKey(_Out_ PSYMCRYPT_HMAC_SHA1_EXPANDED_KEY pExpandedKey, _In_reads_opt_(cbKey) PCBYTE pbKey, SIZE_T cbKey)
#define SYMCRYPT_HMAC_SHA1_RESULT_SIZE
Definition: symcrypt.h:2725
SYMCRYPT_MAGIC_FIELD SYMCRYPT_HMAC_SHA1_EXPANDED_KEY
unsigned char BYTE
Definition: xxhash.c:193

Variable Documentation

◆ hmacSha1Kat

const BYTE hmacSha1Kat[20]
static
Initial value:
= {
0x2a, 0x29, 0x85, 0x40, 0x23, 0xba, 0x2e, 0xf1,
0x49, 0x0f, 0x8c, 0xd8, 0x97, 0xa8, 0xcc, 0x6b,
0x55, 0x7b, 0x2a, 0x12,
}

Definition at line 38 of file hmacsha1.c.

Referenced by SymCryptHmacSha1Selftest().

◆ SymCryptHmacSha1Algorithm

◆ SymCryptHmacSha1Algorithm_default

const SYMCRYPT_MAC SymCryptHmacSha1Algorithm_default
Initial value:
= {
}
VOID SYMCRYPT_CALL SymCryptHmacSha1Result(_Inout_ PSYMCRYPT_HMAC_SHA1_STATE pState, _Out_writes_(SYMCRYPT_HMAC_SHA1_RESULT_SIZE) PBYTE pbResult)
VOID SYMCRYPT_CALL SymCryptHmacSha1Init(_Out_ PSYMCRYPT_HMAC_SHA1_STATE pState, _In_ PCSYMCRYPT_HMAC_SHA1_EXPANDED_KEY pExpandedKey)
const PCSYMCRYPT_HASH SymCryptSha1Algorithm
Definition: sha1.c:29
VOID SYMCRYPT_CALL SymCryptHmacSha1Append(_Inout_ PSYMCRYPT_HMAC_SHA1_STATE pState, _In_reads_(cbData) PCBYTE pbData, SIZE_T cbData)
SYMCRYPT_MD5_CHAINING_STATE outerState
SYMCRYPT_MAGIC_FIELD SYMCRYPT_HMAC_SHA1_STATE
#define SYMCRYPT_FIELD_OFFSET(type, field)

Definition at line 24 of file hmacsha1.c.