rsaenh/tests: Add SHA-256 tests.

This commit is contained in:
Bruno Jesus 2014-08-05 00:14:01 -03:00 committed by Alexandre Julliard
parent e38d1c9aa1
commit edb5e2b7d5
1 changed files with 73 additions and 0 deletions

View File

@ -3555,6 +3555,79 @@ static void test_key_derivation(const char *prov)
"\xE1\x6C\xA8\x54\x0E\x24\x67\x6D\xCA\xA2\xFE\x84\xF0\x9B\x78\x66", "\xE1\x6C\xA8\x54\x0E\x24\x67\x6D\xCA\xA2\xFE\x84\xF0\x9B\x78\x66",
/* 47 */ /* 47 */
}, },
/* ================================================================== */
{ CALG_DES, CALG_SHA_256, 8, 32, CRYPT_MODE_CBC, 0,
"\x20\x34\xf7\xbb\x7a\x3a\x79\xf0\xb9\x65\x18\x11\xaa\xfd\x26\x6b"
"\x60\x5c\x6d\x4c\x81\x7c\x3f\xc4\xce\x94\xe3\x67\xdf\xf2\x16\xd8",
"\x86\x0d\x8c\xf4\xc0\x22\x4a\xdd",
/* 48 */
},
{ CALG_3DES_112, CALG_SHA_256, 8, 32, CRYPT_MODE_CBC, 0,
"\x09\x6e\x7f\xd5\xf2\x72\x4e\x18\x70\x09\xc1\x35\xf4\xd1\x3a\xe8"
"\xe6\x1f\x91\xae\x2f\xfd\xa8\x8c\xce\x47\x0f\x7a\xf5\xef\xfd\xbe",
"\x2d\xe7\x63\xf6\x58\x4d\x9a\xa6",
/* 49 */
},
{ CALG_3DES, CALG_SHA_256, 8, 32, CRYPT_MODE_CBC, 0,
"\x54\x7f\x84\x7f\xfe\x83\xc6\x50\xbc\xd9\x92\x78\x32\x67\x50\x7d"
"\xdf\x44\x55\x7d\x87\x74\xd2\x56\xff\xd9\x74\x44\xd5\x07\x9e\xdc",
"\x20\xaa\x66\xd0\xac\x83\x9d\x99",
/* 50 */
},
{ CALG_RC2, CALG_SHA_256, 8, 32, CRYPT_MODE_CBC, 0,
"\xc6\x22\x46\x15\xa1\x27\x38\x23\x91\xf2\x29\xda\x15\xc9\x5d\x92"
"\x7c\x34\x4a\x1f\xb0\x8a\x81\xd6\x17\x09\xda\x52\x1f\xb9\x64\x60",
"\x8c\x01\x19\x47\x7e\xd2\x10\x2c",
/* 51 */
},
{ CALG_RC4, CALG_SHA_256, 4, 32, 0, 0,
"\xcd\x53\x95\xa6\xb6\x6e\x25\x92\x78\xac\xe6\x7e\xfc\xd3\x8d\xaa"
"\xc3\x15\x83\xb5\xe6\xaf\xf9\x32\x4c\x17\xb8\x82\xdf\xc0\x45\x9e",
"\xfa\x54\x13\x9c",
/* 52 */
},
{ CALG_RC5, CALG_SHA_256, 0, 32, 0, NTE_BAD_ALGID,
"\x2a\x3b\x08\xe1\xec\xa7\x04\xf9\xc9\x42\x74\x9a\x82\xad\x99\xd2"
"\x10\x51\xe3\x51\x6c\x67\xa4\xf2\xca\x99\x21\x43\xdf\xa0\xfc\xa1",
NULL,
/* 53 */
},
{ CALG_RSA_SIGN, CALG_SHA_256, 0, 32, 0, NTE_BAD_ALGID,
"\x10\x1d\x36\xc7\x38\x73\xc3\x80\xf0\x7a\x4e\x25\x52\x8a\x5c\x3f"
"\xfc\x41\xa7\xe5\x20\xed\xd5\x1d\x00\x6e\x77\xf4\xa7\x71\x81\x6b",
NULL,
/* 54 */
},
{ CALG_RSA_KEYX, CALG_SHA_256, 0, 32, CRYPT_MODE_CBC, NTE_BAD_ALGID,
"\x0a\x74\xde\x4f\x07\xce\x73\xd6\xd9\xa3\xba\xbb\x7c\x98\xe1\x94"
"\x13\x93\xb1\xfd\x26\x31\x4b\xfc\x61\x27\xef\x4d\xd0\x48\x76\x67",
NULL,
/* 55 */
},
{ CALG_AES, CALG_SHA_256, 0, 32, 0, NTE_BAD_ALGID,
"\xf0\x13\xbc\x25\x2a\x2f\xba\xf1\x39\xe5\x7d\xb8\x5f\xaa\xd0\x19"
"\xbd\x1c\xd8\x7b\x39\x5a\xb3\x85\x84\x80\xbd\xe0\x4a\x65\x03\xdd",
NULL,
/* 56 */
},
{ CALG_AES_128, CALG_SHA_256, 16, 32, CRYPT_MODE_CBC, NTE_BAD_ALGID,
"\xc8\xc2\x6f\xe2\xbe\xa7\x38\x87\x04\xc7\x39\xcb\x9f\x57\xfc\xde"
"\x14\x81\x46\xa4\xbb\xa7\x0f\x01\x1d\xc2\x6d\x7a\x43\x5f\x38\xc3",
"\xf8\x75\xc6\x71\x8b\xb6\x54\xd3\xdc\xff\x0e\x84\x8a\x3f\x19\x46",
/* 57 */
},
{ CALG_AES_192, CALG_SHA_256, 16, 32, CRYPT_MODE_CBC, NTE_BAD_ALGID,
"\xb7\x3a\x43\x0f\xea\x90\x4f\x0f\xb9\x82\xf6\x1e\x07\xc4\x25\x4e"
"\xdb\xe7\xf7\x1d\x7c\xd0\xe5\x51\xd8\x1b\x97\xc8\xc2\x46\xb9\xfe",
"\x35\xf2\x20\xc7\x6c\xb2\x8e\x51\x3e\xc7\x6b\x3e\x64\xa5\x05\xdf",
/* 58 */
},
{ CALG_AES_256, CALG_SHA_256, 16, 32, CRYPT_MODE_CBC, NTE_BAD_ALGID,
"\xbd\xcc\x0c\x59\x99\x29\xa7\x24\xf3\xdc\x20\x40\x4e\xe8\xe5\x48"
"\xdd\x27\x0e\xdf\x7e\x50\x65\x17\x34\x50\x47\x78\x9a\x23\x1b\x40",
"\x8c\xeb\x1f\xd3\x78\x77\xf5\xbf\x7a\xde\x8d\x2c\xa5\x16\xcc\xe9",
/* 59 */
},
}; };
/* Due to differences between encryption from <= 2000 and >= XP some tests need to be skipped */ /* Due to differences between encryption from <= 2000 and >= XP some tests need to be skipped */
int old_broken[sizeof(tests)/sizeof(tests[0])]; int old_broken[sizeof(tests)/sizeof(tests[0])];