mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 04:43:21 +00:00
[NTDLL][ADVAPI32][ADVAPI32_APITEST][CRYPTLIB] Add hash API exports for NT6+ and apitests with small fixes
- For NT6.0+, NTDLL exports those hash APIs that ADVAPI32 thunks forward to - Fix undocumented context structure layout and content - Add apitests to verify both of hash result and structure content
This commit is contained in:
parent
14beaec1d9
commit
f61e14f554
10 changed files with 342 additions and 22 deletions
|
@ -152,6 +152,7 @@ VOID NTAPI MD4Final( MD4_CTX *ctx )
|
|||
MD4Transform( ctx->buf, (unsigned int *)ctx->in );
|
||||
byteReverse( (unsigned char *)ctx->buf, 4 );
|
||||
memcpy( ctx->digest, ctx->buf, 16 );
|
||||
memset(ctx->in, 0, sizeof(ctx->in));
|
||||
}
|
||||
|
||||
/* The three core functions */
|
||||
|
|
|
@ -152,6 +152,7 @@ VOID NTAPI MD5Final( MD5_CTX *ctx )
|
|||
MD5Transform( ctx->buf, (unsigned int *)ctx->in );
|
||||
byteReverse( (unsigned char *)ctx->buf, 4 );
|
||||
memcpy( ctx->digest, ctx->buf, 16 );
|
||||
memset(ctx->in, 0, sizeof(ctx->in));
|
||||
}
|
||||
|
||||
/* The four core functions - F1 is optimized somewhat */
|
||||
|
|
|
@ -194,5 +194,6 @@ A_SHAFinal(PSHA_CTX Context, PULONG Result)
|
|||
for (Index = 0; Index < 5; Index++)
|
||||
Result[Index] = DWORD2BE(Context->State[Index]);
|
||||
|
||||
memset(Context->Buffer, 0, sizeof(Context->Buffer));
|
||||
A_SHAInit(Context);
|
||||
}
|
||||
|
|
|
@ -11,10 +11,9 @@ extern "C" {
|
|||
/* SHA Context Structure Declaration */
|
||||
typedef struct
|
||||
{
|
||||
ULONG Unknown[6];
|
||||
ULONG State[5];
|
||||
ULONG Count[2];
|
||||
UCHAR Buffer[64];
|
||||
UCHAR Buffer[64];
|
||||
ULONG State[5];
|
||||
ULONG Count[2];
|
||||
} SHA_CTX, *PSHA_CTX;
|
||||
|
||||
VOID NTAPI
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue