ReactOS 0.4.17-dev-1005-g171e1de
hmacsha512_224.c
Go to the documentation of this file.
1//
2// HmacSha512_224.c
3//
4// Copyright (c) Microsoft Corporation. Licensed under the MIT license.
5//
6
7#include "precomp.h"
8
9#define SymCryptSha512_224AppendBlocks SymCryptSha512AppendBlocks
10
11#define ALG SHA512_224
12#define Alg Sha512_224
13#define SET_DATALENGTH( state, len ) {state.dataLengthL = len; state.dataLengthH = 0;}
14#include "hmac_pattern.c"
15#undef SET_DATALENGTH
16#undef Alg
17#undef ALG
18
29};
30
32
33static const BYTE hmacSha512_224Kat[28] = {
34 0x62, 0xc9, 0x59, 0xc7, 0x5b, 0x3c, 0xb2, 0xaf,
35 0x95, 0xf5, 0x59, 0x73, 0x2c, 0x46, 0x1d, 0x72,
36 0x06, 0x9e, 0xf9, 0x52, 0x9a, 0x8d, 0x84, 0x1a,
37 0x73, 0x97, 0xa6, 0x9c
38};
39
40
41VOID
44{
47
50
51 SymCryptInjectError( res, sizeof( res ) );
52
53 if( memcmp( res, hmacSha512_224Kat, 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_224Kat[28]
const SYMCRYPT_MAC SymCryptHmacSha512_224Algorithm_default
const PCSYMCRYPT_MAC SymCryptHmacSha512_224Algorithm
VOID SYMCRYPT_CALL SymCryptHmacSha512_224Selftest(void)
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_224Append(_Inout_ PSYMCRYPT_HMAC_SHA512_224_STATE pState, _In_reads_(cbData) PCBYTE pbData, SIZE_T cbData)
VOID SYMCRYPT_CALL SymCryptHmacSha512_224Init(_Out_ PSYMCRYPT_HMAC_SHA512_224_STATE pState, _In_ PCSYMCRYPT_HMAC_SHA512_224_EXPANDED_KEY pExpandedKey)
_Analysis_noreturn_ VOID SYMCRYPT_CALL SymCryptFatal(UINT32 fatalCode)
VOID SYMCRYPT_CALL SymCryptHmacSha512_224Result(_Inout_ PSYMCRYPT_HMAC_SHA512_224_STATE pState, _Out_writes_(SYMCRYPT_HMAC_SHA512_224_RESULT_SIZE) PBYTE pbResult)
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptHmacSha512_224ExpandKey(_Out_ PSYMCRYPT_HMAC_SHA512_224_EXPANDED_KEY pExpandedKey, _In_reads_opt_(cbKey) PCBYTE pbKey, SIZE_T cbKey)
const PCSYMCRYPT_HASH SymCryptSha512_224Algorithm
Definition: sha512.c:171
#define SYMCRYPT_HMAC_SHA512_224_RESULT_SIZE
Definition: symcrypt.h:3050
VOID SYMCRYPT_CALL SymCryptHmacSha512_224(_In_ PCSYMCRYPT_HMAC_SHA512_224_EXPANDED_KEY pExpandedKey, _In_reads_(cbData) PCBYTE pbData, SIZE_T cbData, _Out_writes_(SYMCRYPT_HMAC_SHA512_224_RESULT_SIZE) PBYTE pbResult)
SYMCRYPT_MAGIC_FIELD SYMCRYPT_HMAC_SHA512_224_EXPANDED_KEY
#define SYMCRYPT_CALL
SYMCRYPT_MD5_CHAINING_STATE outerState
#define SYMCRYPT_FIELD_OFFSET(type, field)
SYMCRYPT_MAGIC_FIELD SYMCRYPT_HMAC_SHA512_224_STATE
unsigned char BYTE
Definition: xxhash.c:193