ReactOS 0.4.17-dev-1005-g171e1de
hmacmd5.c
Go to the documentation of this file.
1//
2// HmacMd5.c
3//
4// Copyright (c) Microsoft Corporation. Licensed under the MIT license.
5//
6
7#include "precomp.h"
8
9#define ALG MD5
10#define Alg Md5
11#define SET_DATALENGTH( state, len ) {state.dataLengthL = len;}
12#include "hmac_pattern.c"
13#undef SET_DATALENGTH
14#undef Alg
15#undef ALG
16
26 0,
27};
28
30
31static const BYTE hmacMd5Kat[16] = {
32 0x77, 0x33, 0x69, 0x79, 0x9e, 0x54, 0xeb, 0x49, 0xff, 0x21, 0xe6, 0xf9, 0x63, 0xe5, 0xbb, 0x49,
33};
34
35VOID
38{
41
44
45 SymCryptInjectError( res, sizeof( res ) );
46
47 if( memcmp( res, hmacMd5Kat, sizeof( res ) ) != 0 )
48 {
49 SymCryptFatal( 'hmd5');
50 }
51
52 //
53 // Normally we would wipe the expanded key structure here,
54 // but as this is a selftest with known data this is not needed.
55 //
56}
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2807
GLuint res
Definition: glext.h:9613
const SYMCRYPT_MAC SymCryptHmacMd5Algorithm_default
Definition: hmacmd5.c:17
const PCSYMCRYPT_MAC SymCryptHmacMd5Algorithm
Definition: hmacmd5.c:29
static const BYTE hmacMd5Kat[16]
Definition: hmacmd5.c:31
VOID SYMCRYPT_CALL SymCryptHmacMd5Selftest(void)
Definition: hmacmd5.c:37
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
#define SYMCRYPT_HMAC_MD5_RESULT_SIZE
Definition: symcrypt.h:2660
_Analysis_noreturn_ VOID SYMCRYPT_CALL SymCryptFatal(UINT32 fatalCode)
VOID SYMCRYPT_CALL SymCryptHmacMd5Init(_Out_ PSYMCRYPT_HMAC_MD5_STATE pState, _In_ PCSYMCRYPT_HMAC_MD5_EXPANDED_KEY pExpandedKey)
const PCSYMCRYPT_HASH SymCryptMd5Algorithm
Definition: md5.c:43
VOID SYMCRYPT_CALL SymCryptHmacMd5Append(_Inout_ PSYMCRYPT_HMAC_MD5_STATE pState, _In_reads_(cbData) PCBYTE pbData, SIZE_T cbData)
VOID SYMCRYPT_CALL SymCryptHmacMd5Result(_Inout_ PSYMCRYPT_HMAC_MD5_STATE pState, _Out_writes_(SYMCRYPT_HMAC_MD5_RESULT_SIZE) PBYTE pbResult)
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptHmacMd5ExpandKey(_Out_ PSYMCRYPT_HMAC_MD5_EXPANDED_KEY pExpandedKey, _In_reads_opt_(cbKey) PCBYTE pbKey, SIZE_T cbKey)
VOID SYMCRYPT_CALL SymCryptHmacMd5(_In_ PCSYMCRYPT_HMAC_MD5_EXPANDED_KEY pExpandedKey, _In_reads_(cbData) PCBYTE pbData, SIZE_T cbData, _Out_writes_(SYMCRYPT_HMAC_MD5_RESULT_SIZE) PBYTE pbResult)
#define SYMCRYPT_CALL
SYMCRYPT_MAGIC_FIELD SYMCRYPT_HMAC_MD5_STATE
SYMCRYPT_MAGIC_FIELD SYMCRYPT_HMAC_MD5_EXPANDED_KEY
unsigned char BYTE
Definition: xxhash.c:193