advapi32: Remove tests for the sha context structure.
This commit is contained in:
parent
ca625836de
commit
35c0511d2b
|
@ -33,8 +33,6 @@ typedef struct {
|
||||||
UCHAR Buffer[64];
|
UCHAR Buffer[64];
|
||||||
} SHA_CTX, *PSHA_CTX;
|
} SHA_CTX, *PSHA_CTX;
|
||||||
|
|
||||||
#define ctxcmp(a,b) memcmp((char*)a, (char*)b, FIELD_OFFSET(SHA_CTX, Buffer))
|
|
||||||
|
|
||||||
static void test_sha_ctx(void)
|
static void test_sha_ctx(void)
|
||||||
{
|
{
|
||||||
FARPROC pA_SHAInit, pA_SHAUpdate, pA_SHAFinal;
|
FARPROC pA_SHAInit, pA_SHAUpdate, pA_SHAFinal;
|
||||||
|
@ -45,9 +43,6 @@ static void test_sha_ctx(void)
|
||||||
ULONG test_buffer_size = strlen(test_buffer);
|
ULONG test_buffer_size = strlen(test_buffer);
|
||||||
HMODULE hmod;
|
HMODULE hmod;
|
||||||
SHA_CTX ctx;
|
SHA_CTX ctx;
|
||||||
SHA_CTX ctx_initialized = {{0, 0, 0, 0, 0}, {0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0}, {0, 0}};
|
|
||||||
SHA_CTX ctx_update1 = {{0, 0, 0, 0, 0}, {0xdbe5eba8, 0x6b4335ca, 0xf7c94abe, 0xc9f34e31, 0x311023f0}, {0, 0x67}};
|
|
||||||
SHA_CTX ctx_update2 = {{0, 0, 0, 0, 0}, {0x5ecc818d, 0x52498169, 0xf6758559, 0xd035a164, 0x871dd125}, {0, 0xce}};
|
|
||||||
ULONG result[5];
|
ULONG result[5];
|
||||||
ULONG result_correct[5] = {0xe014f93, 0xe09791ec, 0x6dcf96c8, 0x8e9385fc, 0x1611c1bb};
|
ULONG result_correct[5] = {0xe014f93, 0xe09791ec, 0x6dcf96c8, 0x8e9385fc, 0x1611c1bb};
|
||||||
|
|
||||||
|
@ -64,16 +59,9 @@ static void test_sha_ctx(void)
|
||||||
|
|
||||||
RtlZeroMemory(&ctx, sizeof(ctx));
|
RtlZeroMemory(&ctx, sizeof(ctx));
|
||||||
pA_SHAInit(&ctx);
|
pA_SHAInit(&ctx);
|
||||||
ok(!ctxcmp(&ctx, &ctx_initialized), "invalid initialization\n");
|
|
||||||
|
|
||||||
pA_SHAUpdate(&ctx, test_buffer, test_buffer_size);
|
pA_SHAUpdate(&ctx, test_buffer, test_buffer_size);
|
||||||
ok(!ctxcmp(&ctx, &ctx_update1), "update doesn't work correctly\n");
|
|
||||||
|
|
||||||
pA_SHAUpdate(&ctx, test_buffer, test_buffer_size);
|
pA_SHAUpdate(&ctx, test_buffer, test_buffer_size);
|
||||||
ok(!ctxcmp(&ctx, &ctx_update2), "update doesn't work correctly\n");
|
|
||||||
|
|
||||||
pA_SHAFinal(&ctx, result);
|
pA_SHAFinal(&ctx, result);
|
||||||
ok(!ctxcmp(&ctx, &ctx_initialized), "context hasn't been reinitialized\n");
|
|
||||||
ok(!memcmp(result, result_correct, sizeof(result)), "incorrect result\n");
|
ok(!memcmp(result, result_correct, sizeof(result)), "incorrect result\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue