23#define WIN32_NO_STATUS
71 else win_skip(
"BCryptGenRandom pseudo handles are not available\n");
84 L"System\\CurrentControlSet\\Control\\Lsa\\FIPSAlgorithmPolicy", &hkey) ==
ERROR_SUCCESS &&
98 ok(0,
"Neither XP or Vista key is present\n");
121#define test_object_length(a) _test_object_length(__LINE__,a)
153 ok_(__FILE__,
line)(
len != 0xdeadbeef,
"len not set\n");
157#define test_hash_length(a,b) _test_hash_length(__LINE__,a,b)
166 ok_(__FILE__,
line)(
len == exlen,
"len = %lu, expected %lu\n",
len, exlen);
169#define test_hash_block_length(a,b) _test_hash_block_length(__LINE__,a,b)
178 ok_(__FILE__,
line)(
len == exlen,
"len = %lu, expected %lu\n",
len, exlen);
181#define test_alg_name(a,b) _test_alg_name(__LINE__,a,b)
211 UCHAR buf[512], buf_hmac[1024], hash_buf[128], hmac_hash[128];
219 ok(alg !=
NULL,
"alg not set\n");
241 memset(hash_buf, 0,
sizeof(hash_buf));
259 memset(hash_buf, 0,
sizeof(hash_buf));
269 memset(hash_buf, 0,
sizeof(hash_buf));
285 ok(alg !=
NULL,
"alg not set\n");
288 len =
sizeof(buf_hmac);
299 memset(hmac_hash, 0,
sizeof(hmac_hash));
309 len =
sizeof(buf_hmac);
317 memset(hmac_hash, 0,
sizeof(hmac_hash));
327 memset(hmac_hash, 0,
sizeof(hmac_hash));
375 "961fa64958818f767707072755d7018dcd278e94",
376 "9314f62ff64197143c91fc86de37e9ae776a3fb8",
377 "2472cf65d0e090618d769d3e46f0d9446cf212da",
378 "b2d2ba8cfd714d474cf0d9622cc5d15e1f53d53f",
381 "ceb73749c899693706ede1e30c9929b3fd5dd926163831c2fb8bd41e6efb1126",
382 "ea0938c118a7b15954f41b85195f2b42aec3a9429c63f593cfa65c137ffaa986",
383 "34c1aa473a4468a91d06e7cdbc75bc4f93b830ccfc2a47ffd74e8e6ed29e4c72",
384 "55feb7052060bd99e33f36eb0982c7f4856eb6a84fbefe19a1afd9faafc3af6f",
386 {
L"SHA384", 48, 128,
387 "62b21e90c9022b101671ba1f808f8631a8149f0f12904055839a35c1ca78ae53"
388 "63eed1e743a692d70e0504b0cfd12ef9",
389 "724db7c0bbc51ef1ac3fc793083fc54c0e5c423faec9b11378c01c236b19aaaf"
390 "a45177ad055feaf003968cc40ece44c7",
391 "4b3e6d6ff2da121790ab7e7b9247583e3a7eed2db5bd4dabc680303b1608f37d"
392 "fdc836d96a704c03283bc05b4f6c5eb8",
393 "03e1818e5c165a0e54619e513acb06c393e1a6cb0ddbb4036b5f29617b334642"
394 "e6e0be8b214d8508595b17a8c4b4e7db",
396 {
L"SHA512", 64, 128,
397 "d55ced17163bf5386f2cd9ff21d6fd7fe576a915065c24744d09cfae4ec84ee1"
398 "ef6ef11bfbc5acce3639bab725b50a1fe2c204f8c820d6d7db0df0ecbc49c5ca",
399 "7752d707b54d2b00e7d1c09120d189475b0fd2e31ebb988cf0a01fc8492ddc0b"
400 "3ca9c9ca61d9d7d1fb65ca7665e87f043c1d5bc9f786f8345e951c2d91ac594f",
401 "415fb6b10018ca03b38a1b1399c42ac0be5e8aceddb9a73103f5e543bf2d888f"
402 "2eecf91373941f9315dd730a77937fa92444450fbece86f409d9cb5ec48c6513",
403 "1487bcecba46ae677622fa499e4cb2f0fdf92f6f3427cba76382d537a06e49c3"
404 "3e70a2fc1fc730092bf21128c3704cc6387f6dfbf7e2f9f315bbb894505a1205",
407 "1bb33606ba908912a84221109d29cd7e",
408 "b9a6ad9323b17e2d0cd389dddd6ef78a",
409 "7f05b0638d77f4a27f3a9c4d353cd648",
410 "05980873e6bfdd05dd7b30078de7e42a",
413 "74b5db93c0b41e36ca7074338fc0b637",
414 "a14a9ff2059a8c28f47b01e6bc48a1bf",
415 "bc2e8ac4d8248ed21b8d26227a30ea3a",
416 "b609db0eb4b8669db74f2c20099701e4",
419 "e2a3e68d23ce348b8f68b3079de3d4c9",
420 "bcdd7ca574342aa9db0e212348eacb16",
421 "7bda029b93fa8d817fcc9e13d6bdf092",
422 "dd636ab8e9592c5088e57c37d44c5bb3",
434 "e2a3e68d23ce348b8f68b3079de3d4c9";
435 static const char expected_hmac[] =
436 "7bda029b93fa8d817fcc9e13d6bdf092";
444 win_skip(
"BCryptHash is not available\n");
470 memset(md5_hmac, 0,
sizeof(md5_hmac));
475 ret = pBCryptHash(
alg, (
UCHAR *)
"key",
sizeof(
"key"), (
UCHAR *)
"test",
sizeof(
"test"), md5_hmac,
sizeof(md5_hmac));
501static UCHAR dk1[] =
"0c60c80f961f0e71f3a9b524af6012062fe037a6";
502static UCHAR dk2[] =
"ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957";
503static UCHAR dk3[] =
"4b007901b765489abead49d926f721d065a429c1";
504static UCHAR dk4[] =
"364dd6bc200ec7d197f1b85f4a61769010717124";
505static UCHAR dk5[] =
"3d2eec4fe41c849b80c8d83662c0e44a8b291a964cf2f07038";
506static UCHAR dk6[] =
"56fa6aa75548099dcc37d7f03425e0c3";
507static UCHAR dk7[] =
"8754c32c64b0f524fc50c00f788135de";
618 ok(
len,
"expected non-zero len\n");
645 memset(&key_lengths, 0,
sizeof(key_lengths));
648 ok(
size ==
sizeof(key_lengths),
"got %lu\n",
size);
725 ok(
len,
"expected non-zero len\n");
752 memset(&key_lengths, 0,
sizeof(key_lengths));
755 ok(
size ==
sizeof(key_lengths),
"got %lu\n",
size);
773 {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f};
775 {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f};
777 {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f};
779 {0xc6,0xa1,0x3b,0x37,0x87,0x8f,0x5b,0x82,0x6f,0x4f,0x81,0x62,0xa1,0xc8,0xd8,0x79};
780 static UCHAR expected2[] =
781 {0xb5,0x8a,0x10,0x64,0xd8,0xac,0xa9,0x9b,0xd9,0xb0,0x40,0x5b,0x85,0x45,0xf5,0xbb};
782 static UCHAR expected3[] =
783 {0xe3,0x7c,0xd3,0x63,0xdd,0x7c,0x87,0xa0,0x9a,0xff,0x0e,0x3e,0x60,0xe0,0x9c,0x82};
786 UCHAR *
buf, ciphertext[16], plaintext[16], ivbuf[16],
mode[64];
800 key = (
void *)0xdeadbeef;
803 ok(
key == (
void *)0xdeadbeef,
"got %p\n",
key);
825 ok(
size ==
sizeof(keylen),
"got %lu\n",
size);
826 ok(keylen == 128,
"got %lu\n", keylen);
868 memcpy(ivbuf, iv,
sizeof(iv));
872 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
875 memcpy(ivbuf, iv,
sizeof(iv));
876 memset(ciphertext, 0,
sizeof(ciphertext));
881 for (
i = 0;
i < 16;
i++)
883 ok(!
memcmp(ivbuf, ciphertext,
sizeof(iv)),
"wrong iv data.\n");
886 memset(ciphertext, 0,
sizeof(ciphertext));
890 ok(!
memcmp(ciphertext, expected2,
sizeof(expected2)),
"wrong data\n");
893 memcpy(ivbuf, iv,
sizeof(iv));
895 memset(ciphertext, 0,
sizeof(ciphertext));
899 ok(!
memcmp(ciphertext, expected3,
sizeof(expected3)),
"wrong data\n");
900 for (
i = 0;
i < 16;
i++)
901 ok(ciphertext[
i] == expected3[
i],
"%lu: %02x != %02x\n",
i, ciphertext[
i], expected3[
i]);
902 ok(!
memcmp(ivbuf, ciphertext,
sizeof(iv)),
"wrong iv data.\n");
904 key2 = (
void *)0xdeadbeef;
907 ok(
key2 == (
void *)0xdeadbeef,
"got %p\n",
key2);
915 key2 = (
void *)0xdeadbeef;
922 memcpy(ivbuf, iv,
sizeof(iv));
923 memset(ciphertext, 0,
sizeof(ciphertext));
928 for (
i = 0;
i < 16;
i++)
930 ok(!
memcmp(ivbuf, ciphertext,
sizeof(iv)),
"wrong iv data.\n");
942 memcpy(ivbuf, iv,
sizeof(iv));
948 memcpy(ivbuf, iv,
sizeof(iv));
949 memset(plaintext, 0,
sizeof(plaintext));
954 ok(!
memcmp(ivbuf, ciphertext,
sizeof(iv)),
"wrong iv data.\n");
969 memset(&key_lengths, 0,
sizeof(key_lengths));
972 ok(
size ==
sizeof(key_lengths),
"got %lu\n",
size);
993#define RACE_TEST_COUNT 200
999 {0x11,0x20,0x30,0x40,0x50,0x60,0x10,0x20,0x30,0x40,0x50,0x60};
1000 static UCHAR auth_data[] =
1001 {0x61,0x50,0x40,0x30,0x20,0x10,0x60,0x50,0x40,0x30,0x20,0x10};
1003 {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
1004 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10};
1005 static UCHAR expected4[] =
1006 {0xb2,0x27,0x19,0x09,0xc7,0x89,0xdc,0x52,0x24,0x83,0x3a,0x55,0x34,0x76,0x2c,0xbf,
1007 0x15,0xa1,0xcb,0x40,0x78,0x11,0xba,0xbc,0xa4,0x76,0x69,0x7c,0x75,0x4f,0x11,0xba};
1008 static UCHAR expected_tag3[] =
1009 {0xef,0xee,0x75,0x99,0xb8,0x12,0xe9,0xf0,0xb4,0xcc,0x65,0x11,0x67,0x60,0x2d,0xe6};
1014 unsigned int i,
test;
1018 memset(&auth_info, 0,
sizeof(auth_info));
1019 auth_info.
cbSize =
sizeof(auth_info);
1035 memset(ciphertext, 0xff,
sizeof(ciphertext));
1040 ok(!
memcmp(ciphertext, expected4,
sizeof(expected4)),
"wrong data\n");
1041 ok(!
memcmp(
tag, expected_tag3,
sizeof(expected_tag3)),
"wrong tag\n");
1042 for (
i = 0;
i < 32;
i++)
1043 ok(ciphertext[
i] == expected4[
i],
"%u: %02x != %02x\n",
i, ciphertext[
i], expected4[
i]);
1044 for (
i = 0;
i < 16;
i++)
1045 ok(
tag[
i] == expected_tag3[
i],
"%u: %02x != %02x\n",
i,
tag[
i], expected_tag3[
i]);
1054 {0x10,0x20,0x30,0x40,0x50,0x60,0x10,0x20,0x30,0x40,0x50,0x60};
1055 static UCHAR auth_data[] =
1056 {0x60,0x50,0x40,0x30,0x20,0x10,0x60,0x50,0x40,0x30,0x20,0x10};
1058 {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f};
1059 static UCHAR secret256[] =
1060 {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
1061 0x0f,0x0e,0x0d,0x0c,0x0b,0x0a,0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01,0x00};
1063 {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f};
1065 {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10};
1067 {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
1068 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10};
1070 {0xc6,0xa1,0x3b,0x37,0x87,0x8f,0x5b,0x82,0x6f,0x4f,0x81,0x62,0xa1,0xc8,0xd8,0x79};
1071 static UCHAR expected2[] =
1072 {0xc6,0xa1,0x3b,0x37,0x87,0x8f,0x5b,0x82,0x6f,0x4f,0x81,0x62,0xa1,0xc8,0xd8,0x79,
1073 0x28,0x73,0x3d,0xef,0x84,0x8f,0xb0,0xa6,0x5d,0x1a,0x51,0xb7,0xec,0x8f,0xea,0xe9};
1074 static UCHAR expected3[] =
1075 {0xc6,0xa1,0x3b,0x37,0x87,0x8f,0x5b,0x82,0x6f,0x4f,0x81,0x62,0xa1,0xc8,0xd8,0x79,
1076 0xb1,0xa2,0x92,0x73,0xbe,0x2c,0x42,0x07,0xa5,0xac,0xe3,0x93,0x39,0x8c,0xb6,0xfb,
1077 0x87,0x5d,0xea,0xa3,0x7e,0x0f,0xde,0xfa,0xd9,0xec,0x6c,0x4e,0x3c,0x76,0x86,0xe4};
1078 static UCHAR expected4[] =
1079 {0xe1,0x82,0xc3,0xc0,0x24,0xfb,0x86,0x85,0xf3,0xf1,0x2b,0x7d,0x09,0xb4,0x73,0x67,
1080 0x86,0x64,0xc3,0xfe,0xa3,0x07,0x61,0xf8,0x16,0xc9,0x78,0x7f,0xe7,0xb1,0xc4,0x94};
1081 static UCHAR expected5[] =
1082 {0x0a,0x94,0x0b,0xb5,0x41,0x6e,0xf0,0x45,0xf1,0xc3,0x94,0x58,0xc6,0x53,0xea,0x5a};
1083 static UCHAR expected6[] =
1084 {0x0a,0x94,0x0b,0xb5,0x41,0x6e,0xf0,0x45,0xf1,0xc3,0x94,0x58,0xc6,0x53,0xea,0x5a,
1085 0x84,0x07,0x66,0xb7,0x49,0xc0,0x9b,0x49,0x74,0x28,0x8c,0x10,0xb9,0xc2,0x09,0x70};
1086 static UCHAR expected7[] =
1087 {0x0a,0x94,0x0b,0xb5,0x41,0x6e,0xf0,0x45,0xf1,0xc3,0x94,0x58,0xc6,0x53,0xea,0x5a,
1088 0x95,0x4f,0x64,0xf2,0xe4,0xe8,0x6e,0x9e,0xee,0x82,0xd2,0x02,0x16,0x68,0x48,0x99,
1089 0x95,0x4f,0x64,0xf2,0xe4,0xe8,0x6e,0x9e,0xee,0x82,0xd2,0x02,0x16,0x68,0x48,0x99};
1090 static UCHAR expected8[] =
1091 {0xb5,0x8a,0x10,0x64,0xd8,0xac,0xa9,0x9b,0xd9,0xb0,0x40,0x5b,0x85,0x45,0xf5,0xbb};
1092 static UCHAR expected9[] =
1093 {0x0a,0x94,0x0b,0xb5,0x41,0x6e,0xf0,0x45,0xf1,0xc3,0x94,0x58,0xc6,0x53,0xea,0x5a};
1094 static UCHAR expected10[] =
1095 {0x66,0xb8,0xbd,0xe5,0x90,0x6c,0xec,0xdf,0xfa,0x8a,0xb2,0xfd,0x92,0x84,0xeb,0xf0,
1096 0x95,0xc4,0xdf,0xa7,0x7a,0x62,0xe4,0xab,0xd4,0x0e,0x94,0x4e,0xd7,0x6e,0xa1,0x47,
1097 0x29,0x4b,0x37,0xfe,0x28,0x6d,0x5f,0x69,0x46,0x30,0x73,0xc0,0xaa,0x42,0xe4,0x46};
1098 static UCHAR expected11[] =
1099 {0x0a,0x22,0xf7,0x96,0xe1,0xb9,0x3e,0x90,0x32,0xcf,0xf8,0x04,0x83,0x8a,0xdf,0xc3};
1100 static UCHAR expected12[] =
1101 {0xb5,0x9d,0xe7,0x8e,0x0f,0x80,0x16,0xc3,0xf6,0x80,0xad,0xf8,0xac,0xef,0xf9,0x9f};
1102 static UCHAR expected13[] =
1103 {0xc6,0x41,0x37,0xd8,0x6f,0x65,0x64,0x1d,0x2b,0xa0,0xad,0xee,0x67,0xba,0x9b,0x5f};
1104 static UCHAR expected14[] =
1105 {0x0a,0x22,0xf7,0x96,0xe1,0xb9,0x3e,0x90,0x32,0xcf,0xf8,0x04,0x83,0x8a,0xdf,0xc3,
1106 0xa5,0xfa,0x54,0xd7,0x62,0x9d,0x8b,0x11,0x3d,0xd8,0xe2,0x95,0xc2,0x23,0x3f,0x29};
1107 static UCHAR expected15[] =
1108 {0x0a,0x22,0xf7,0x96,0xe1,0xb9,0x3e,0x90,0x32,0xcf,0xf8,0x04,0x83,0x8a,0xdf,0xc3,
1109 0xa5,0xe5,0xcd,0x29,0x48,0x37,0x3f,0x92,0x6f,0x09,0x84,0x5a,0xb8,0x88,0xda,0xfd,
1110 0x65,0x00,0x20,0x9a,0xc6,0xdb,0xfa,0x82,0xdb,0xbc,0xf4,0x70,0x7d,0x88,0x86,0xb5};
1111 static UCHAR expected16[] =
1112 {0x64,0xff,0xc6,0x97,0x14,0x5e,0x21,0xfa,0xe8,0x6e,0xba,0xc1,0x0c,0xb1,0x72,0x64,
1113 0x5d,0xf0,0x22,0x72,0xef,0x39,0xe3,0x2f,0x80,0x3e,0x53,0x00,0xc1,0xcf,0x3f,0xbb,
1114 0xea,0x30,0x01,0x78,0x3b,0xba,0x4d,0xca,0xa0,0x2e,0x83,0x5e,0x0e,0xe2,0x65,0xcb};
1115 static UCHAR expected_tag[] =
1116 {0x89,0xb3,0x92,0x00,0x39,0x20,0x09,0xb4,0x6a,0xd6,0xaf,0xca,0x4b,0x5b,0xfd,0xd0};
1117 static UCHAR expected_tag2[] =
1118 {0x9a,0x92,0x32,0x2c,0x61,0x2a,0xae,0xef,0x66,0x2a,0xfb,0x55,0xe9,0x48,0xdf,0xbd};
1119 static UCHAR expected_tag3[] =
1120 {0x17,0x9d,0xc0,0x7a,0xf0,0xcf,0xaa,0xd5,0x1c,0x11,0xc4,0x4b,0xd6,0xa3,0x3e,0x77};
1121 static UCHAR expected_tag4[] =
1122 {0x4c,0x42,0x83,0x9e,0x8d,0x40,0xf1,0x19,0xd6,0x2b,0x1c,0x66,0x03,0x2b,0x39,0x63};
1153 memcpy(ivbuf, iv,
sizeof(iv));
1157 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
1160 memcpy(ivbuf, iv,
sizeof(iv));
1161 memset(ciphertext, 0,
sizeof(ciphertext));
1166 for (
i = 0;
i < 16;
i++)
1168 ok(!
memcmp(ivbuf, ciphertext,
sizeof(iv)),
"wrong iv data.\n");
1172 memset(ciphertext, 0,
sizeof(ciphertext));
1176 ok(!
memcmp(ciphertext, expected8,
sizeof(expected8)),
"wrong data\n");
1180 memset(ciphertext, 0,
sizeof(ciphertext));
1181 memset(ivbuf, 0,
sizeof(ivbuf));
1185 ok(!
memcmp(ciphertext, expected9,
sizeof(expected9)),
"wrong data\n");
1186 for (
i = 0;
i < 16;
i++)
1187 ok(ciphertext[
i] == expected9[
i],
"%lu: %02x != %02x\n",
i, ciphertext[
i], expected9[
i]);
1188 ok(!
memcmp(ivbuf, ciphertext,
sizeof(iv)),
"wrong iv data.\n");
1192 memcpy(ivbuf, iv,
sizeof(iv));
1199 memcpy(ivbuf, iv,
sizeof(iv));
1203 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
1206 memcpy(ivbuf, iv,
sizeof(iv));
1207 memset(ciphertext, 0,
sizeof(ciphertext));
1211 ok(!
memcmp(ciphertext, expected2,
sizeof(expected2)),
"wrong data\n");
1212 for (
i = 0;
i < 32;
i++)
1213 ok(ciphertext[
i] == expected2[
i],
"%lu: %02x != %02x\n",
i, ciphertext[
i], expected2[
i]);
1214 ok(!
memcmp(ivbuf, ciphertext + 32 - 16,
sizeof(iv)),
"wrong iv data.\n");
1218 memcpy(ivbuf, iv,
sizeof(iv));
1222 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
1225 memcpy(ivbuf, iv,
sizeof(iv));
1226 memset(ciphertext, 0,
sizeof(ciphertext));
1230 ok(!
memcmp(ciphertext, expected3,
sizeof(expected3)),
"wrong data\n");
1231 for (
i = 0;
i < 48;
i++)
1232 ok(ciphertext[
i] == expected3[
i],
"%lu: %02x != %02x\n",
i, ciphertext[
i], expected3[
i]);
1233 ok(!
memcmp(ivbuf, ciphertext + 48 - 16,
sizeof(iv)),
"wrong iv data.\n");
1237 memcpy(ivbuf, iv,
sizeof(iv));
1238 memset(ciphertext, 0,
sizeof(ciphertext));
1244 memcpy(ivbuf, iv,
sizeof(iv));
1245 memset(ciphertext, 0,
sizeof(ciphertext));
1268 memcpy(ivbuf, iv,
sizeof(iv));
1272 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
1275 memcpy(ivbuf, iv,
sizeof(iv));
1276 memset(ciphertext, 0,
sizeof(ciphertext));
1280 ok(!
memcmp(ciphertext, expected10,
sizeof(expected10)),
"wrong data\n");
1281 for (
i = 0;
i < 48;
i++)
1282 ok(ciphertext[
i] == expected10[
i],
"%lu: %02x != %02x\n",
i, ciphertext[
i], expected10[
i]);
1283 ok(!
memcmp(ivbuf, ciphertext + 48 - 16,
sizeof(iv)),
"wrong iv data.\n");
1303 ok(
size ==
sizeof(tag_length),
"got %lu\n",
size);
1306 memset(&tag_length, 0,
sizeof(tag_length));
1309 ok(
size ==
sizeof(tag_length),
"got %lu\n",
size);
1328 memset(&auth_info, 0,
sizeof(auth_info));
1329 auth_info.
cbSize =
sizeof(auth_info);
1338 memcpy(ivbuf, iv,
sizeof(iv));
1339 memset(ciphertext, 0xff,
sizeof(ciphertext));
1344 ok(!
memcmp(ciphertext, expected4,
sizeof(expected4)),
"wrong data\n");
1345 ok(!
memcmp(
tag, expected_tag,
sizeof(expected_tag)),
"wrong tag\n");
1346 for (
i = 0;
i < 32;
i++)
1347 ok(ciphertext[
i] == expected4[
i],
"%lu: %02x != %02x\n",
i, ciphertext[
i], expected4[
i]);
1348 for (
i = 0;
i < 16;
i++)
1349 ok(
tag[
i] == expected_tag[
i],
"%lu: %02x != %02x\n",
i,
tag[
i], expected_tag[
i]);
1350 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
1357 memset(ciphertext, 0xff,
sizeof(ciphertext));
1362 ok(!
memcmp(ciphertext, expected4,
sizeof(expected4)),
"wrong data\n");
1363 ok(!
memcmp(
tag, expected_tag,
sizeof(expected_tag)),
"wrong tag\n");
1364 for (
i = 0;
i < 32;
i++)
1365 ok(ciphertext[
i] == expected4[
i],
"%lu: %02x != %02x\n",
i, ciphertext[
i], expected4[
i]);
1366 for (
i = 0;
i < 16;
i++)
1367 ok(
tag[
i] == expected_tag[
i],
"%lu: %02x != %02x\n",
i,
tag[
i], expected_tag[
i]);
1371 memset(ciphertext, 0xff,
sizeof(ciphertext));
1373 memset(ivbuf, 0,
sizeof(ivbuf));
1377 ok(!
memcmp(ciphertext, expected4,
sizeof(expected4)),
"wrong data\n");
1378 ok(!
memcmp(
tag, expected_tag,
sizeof(expected_tag)),
"wrong tag\n");
1379 for (
i = 0;
i < 32;
i++)
1380 ok(ciphertext[
i] == expected4[
i],
"%lu: %02x != %02x\n",
i, ciphertext[
i], expected4[
i]);
1381 for (
i = 0;
i < 16;
i++)
1382 ok(
tag[
i] == expected_tag[
i],
"%lu: %02x != %02x\n",
i,
tag[
i], expected_tag[
i]);
1383 memset(ciphertext, 0,
sizeof(iv));
1384 ok(!
memcmp(ivbuf, ciphertext,
sizeof(iv)),
"wrong iv data.\n");
1388 memcpy(ivbuf, iv,
sizeof(iv));
1389 memset(ciphertext, 0xff,
sizeof(ciphertext));
1394 ok(!
memcmp(ciphertext, expected4, 24),
"wrong data\n");
1395 ok(!
memcmp(
tag, expected_tag2,
sizeof(expected_tag2)),
"wrong tag\n");
1396 for (
i = 0;
i < 24;
i++)
1397 ok(ciphertext[
i] == expected4[
i],
"%lu: %02x != %02x\n",
i, ciphertext[
i], expected4[
i]);
1398 for (
i = 0;
i < 16;
i++)
1399 ok(
tag[
i] == expected_tag2[
i],
"%lu: %02x != %02x\n",
i,
tag[
i], expected_tag2[
i]);
1400 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
1407 memcpy(ivbuf, iv,
sizeof(iv));
1408 memset(ciphertext, 0xff,
sizeof(ciphertext));
1413 ok(!
memcmp(ciphertext, expected4,
sizeof(expected4)),
"wrong data\n");
1414 ok(!
memcmp(
tag, expected_tag3,
sizeof(expected_tag3)),
"wrong tag\n");
1415 for (
i = 0;
i < 32;
i++)
1416 ok(ciphertext[
i] == expected4[
i],
"%lu: %02x != %02x\n",
i, ciphertext[
i], expected4[
i]);
1417 for (
i = 0;
i < 16;
i++)
1418 ok(
tag[
i] == expected_tag3[
i],
"%lu: %02x != %02x\n",
i,
tag[
i], expected_tag3[
i]);
1419 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
1425 for (
i = 0;
i < 16;
i++)
1426 ok(
tag[
i] == 0xff,
"%lu: %02x != %02x\n",
i,
tag[
i], 0xff);
1432 ok(!
memcmp(
tag, expected_tag4,
sizeof(expected_tag4)),
"wrong tag\n");
1433 for (
i = 0;
i < 16;
i++)
1434 ok(
tag[
i] == expected_tag4[
i],
"%lu: %02x != %02x\n",
i,
tag[
i], expected_tag4[
i]);
1437 memcpy(ivbuf, iv,
sizeof(iv));
1438 memset(ciphertext, 0,
sizeof(ciphertext));
1442 memcpy(ivbuf, iv,
sizeof(iv));
1443 memset(ciphertext, 0,
sizeof(ciphertext));
1458 memset(ciphertext, 0xff,
sizeof(ciphertext));
1463 ok(!
memcmp(ciphertext, expected4,
sizeof(expected4)),
"wrong data\n");
1464 ok(!
memcmp(
tag, expected_tag3,
sizeof(expected_tag2)),
"wrong tag\n");
1465 for (
i = 0;
i < 32;
i++)
1466 ok(ciphertext[
i] == expected4[
i],
"%lu: %02x != %02x\n",
i, ciphertext[
i], expected4[
i]);
1467 for (
i = 0;
i < 16;
i++)
1468 ok(
tag[
i] == expected_tag3[
i],
"%lu: %02x != %02x\n",
i,
tag[
i], expected_tag3[
i]);
1495 memcpy(ivbuf, iv,
sizeof(iv));
1507 memset(ciphertext, 0,
sizeof(ciphertext));
1511 ok(!
memcmp(ciphertext, expected5,
sizeof(expected5)),
"wrong data\n");
1512 for (
i = 0;
i < 16;
i++)
1513 ok(ciphertext[
i] == expected5[
i],
"%lu: %02x != %02x\n",
i, ciphertext[
i], expected5[
i]);
1528 memset(ciphertext, 0,
sizeof(ciphertext));
1532 ok(!
memcmp(ciphertext, expected6,
sizeof(expected6)),
"wrong data\n");
1533 for (
i = 0;
i < 32;
i++)
1534 ok(ciphertext[
i] == expected6[
i],
"%lu: %02x != %02x\n",
i, ciphertext[
i], expected6[
i]);
1543 memset(ciphertext, 0,
sizeof(ciphertext));
1547 ok(!
memcmp(ciphertext, expected7,
sizeof(expected7)),
"wrong data\n");
1548 for (
i = 0;
i < 48;
i++)
1549 ok(ciphertext[
i] == expected7[
i],
"%lu: %02x != %02x\n",
i, ciphertext[
i], expected7[
i]);
1553 memset(ciphertext, 0,
sizeof(ciphertext));
1559 memset(ciphertext, 0,
sizeof(ciphertext));
1583 memcpy(ivbuf, iv,
sizeof(iv));
1587 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
1590 memcpy(ivbuf, iv,
sizeof(iv));
1591 memset(ciphertext, 0,
sizeof(ciphertext));
1595 ok(!
memcmp(ciphertext, expected11,
sizeof(expected11)),
"wrong data\n");
1596 for (
i = 0;
i < 16;
i++)
1597 ok(ciphertext[
i] == expected11[
i],
"%lu: %02x != %02x\n",
i, ciphertext[
i], expected11[
i]);
1598 ok(!
memcmp(ivbuf, ciphertext,
sizeof(iv)),
"wrong iv data.\n");
1602 memset(ciphertext, 0,
sizeof(ciphertext));
1606 ok(!
memcmp(ciphertext, expected12,
sizeof(expected12)),
"wrong data\n");
1610 memset(ciphertext, 0,
sizeof(ciphertext));
1611 memset(ivbuf, 0,
sizeof(ivbuf));
1615 ok(!
memcmp(ciphertext, expected13,
sizeof(expected13)),
"wrong data\n");
1616 for (
i = 0;
i < 16;
i++)
1617 ok(ciphertext[
i] == expected13[
i],
"%lu: %02x != %02x\n",
i, ciphertext[
i], expected13[
i]);
1618 ok(!
memcmp(ivbuf, ciphertext,
sizeof(iv)),
"wrong iv data.\n");
1622 memcpy(ivbuf, iv,
sizeof(iv));
1629 memcpy(ivbuf, iv,
sizeof(iv));
1633 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
1636 memcpy(ivbuf, iv,
sizeof(iv));
1637 memset(ciphertext, 0,
sizeof(ciphertext));
1641 ok(!
memcmp(ciphertext, expected14,
sizeof(expected14)),
"wrong data\n");
1642 for (
i = 0;
i < 32;
i++)
1643 ok(ciphertext[
i] == expected14[
i],
"%lu: %02x != %02x\n",
i, ciphertext[
i], expected14[
i]);
1644 ok(!
memcmp(ivbuf, ciphertext + 32 - 16,
sizeof(iv)),
"wrong iv data.\n");
1648 memcpy(ivbuf, iv,
sizeof(iv));
1654 memcpy(ivbuf, iv,
sizeof(iv));
1655 memset(ciphertext, 0,
sizeof(ciphertext));
1659 ok(!
memcmp(ciphertext, expected15,
sizeof(expected15)),
"wrong data\n");
1660 for (
i = 0;
i < 48;
i++)
1661 ok(ciphertext[
i] == expected15[
i],
"%lu: %02x != %02x\n",
i, ciphertext[
i], expected15[
i]);
1662 ok(!
memcmp(ivbuf, ciphertext + 48 - 16,
sizeof(iv)),
"wrong iv data.\n");
1666 memcpy(ivbuf, iv,
sizeof(iv));
1667 memset(ciphertext, 0,
sizeof(ciphertext));
1671 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
1674 memcpy(ivbuf, iv,
sizeof(iv));
1675 memset(ciphertext, 0,
sizeof(ciphertext));
1679 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
1699 memcpy(ivbuf, iv,
sizeof(iv));
1703 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
1706 memcpy(ivbuf, iv,
sizeof(iv));
1707 memset(ciphertext, 0,
sizeof(ciphertext));
1711 ok(!
memcmp(ciphertext, expected16,
sizeof(expected16)),
"wrong data\n");
1712 for (
i = 0;
i < 48;
i++)
1713 ok(ciphertext[
i] == expected16[
i],
"%lu: %02x != %02x\n",
i, ciphertext[
i], expected16[
i]);
1714 ok(!
memcmp(ivbuf, ciphertext + 48 - 16,
sizeof(iv)),
"wrong iv data.\n");
1723 {0x10,0x20,0x30,0x40,0x50,0x60,0x10,0x20,0x30,0x40,0x50,0x60};
1724 static UCHAR auth_data[] =
1725 {0x60,0x50,0x40,0x30,0x20,0x10,0x60,0x50,0x40,0x30,0x20,0x10};
1727 {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f};
1729 {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f};
1731 {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f};
1732 static UCHAR expected2[] =
1733 {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10};
1734 static UCHAR expected3[] =
1735 {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
1736 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10};
1737 static UCHAR expected4[] =
1738 {0x28,0x73,0x3d,0xef,0x84,0x8f,0xb0,0xa6,0x5d,0x1a,0x51,0xb7,0xec,0x8f,0xea,0xe9,
1739 0x10,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f};
1740 static UCHAR expected5[] =
1741 {0x29,0x73,0x3d,0xef,0x84,0x8f,0xb0,0xa6,0x5d,0x1a,0x51,0xb7,0xec,0x8f,0xea,0xe9,
1742 0x10,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f};
1743 static UCHAR ciphertext[32] =
1744 {0xc6,0xa1,0x3b,0x37,0x87,0x8f,0x5b,0x82,0x6f,0x4f,0x81,0x62,0xa1,0xc8,0xd8,0x79,
1745 0x28,0x73,0x3d,0xef,0x84,0x8f,0xb0,0xa6,0x5d,0x1a,0x51,0xb7,0xec,0x8f,0xea,0xe9};
1746 static UCHAR ciphertext2[] =
1747 {0xc6,0xa1,0x3b,0x37,0x87,0x8f,0x5b,0x82,0x6f,0x4f,0x81,0x62,0xa1,0xc8,0xd8,0x79,
1748 0x28,0x73,0x3d,0xef,0x84,0x8f,0xb0,0xa6,0x5d,0x1a,0x51,0xb7,0xec,0x8f,0xea,0xe9};
1749 static UCHAR ciphertext3[] =
1750 {0xc6,0xa1,0x3b,0x37,0x87,0x8f,0x5b,0x82,0x6f,0x4f,0x81,0x62,0xa1,0xc8,0xd8,0x79,
1751 0xb1,0xa2,0x92,0x73,0xbe,0x2c,0x42,0x07,0xa5,0xac,0xe3,0x93,0x39,0x8c,0xb6,0xfb,
1752 0x87,0x5d,0xea,0xa3,0x7e,0x0f,0xde,0xfa,0xd9,0xec,0x6c,0x4e,0x3c,0x76,0x86,0xe4};
1753 static UCHAR ciphertext4[] =
1754 {0xe1,0x82,0xc3,0xc0,0x24,0xfb,0x86,0x85,0xf3,0xf1,0x2b,0x7d,0x09,0xb4,0x73,0x67,
1755 0x86,0x64,0xc3,0xfe,0xa3,0x07,0x61,0xf8,0x16,0xc9,0x78,0x7f,0xe7,0xb1,0xc4,0x94};
1756 static UCHAR ciphertext5[] =
1757 {0x0a,0x94,0x0b,0xb5,0x41,0x6e,0xf0,0x45,0xf1,0xc3,0x94,0x58,0xc6,0x53,0xea,0x5a,
1758 0x84,0x07,0x66,0xb7,0x49,0xc0,0x9b,0x49,0x74,0x28,0x8c,0x10,0xb9,0xc2,0x09,0x70};
1759 static UCHAR ciphertext6[] =
1760 {0x0a,0x94,0x0b,0xb5,0x41,0x6e,0xf0,0x45,0xf1,0xc3,0x94,0x58,0xc6,0x53,0xea,0x5a,
1761 0x95,0x4f,0x64,0xf2,0xe4,0xe8,0x6e,0x9e,0xee,0x82,0xd2,0x02,0x16,0x68,0x48,0x99,
1762 0x95,0x4f,0x64,0xf2,0xe4,0xe8,0x6e,0x9e,0xee,0x82,0xd2,0x02,0x16,0x68,0x48,0x99};
1764 {0x89,0xb3,0x92,0x00,0x39,0x20,0x09,0xb4,0x6a,0xd6,0xaf,0xca,0x4b,0x5b,0xfd,0xd0};
1765 static UCHAR tag2[] =
1766 {0x17,0x9d,0xc0,0x7a,0xf0,0xcf,0xaa,0xd5,0x1c,0x11,0xc4,0x4b,0xd6,0xa3,0x3e,0x77};
1772 UCHAR *
buf, plaintext[48], ivbuf[16];
1780 memset(&key_lengths, 0,
sizeof(key_lengths));
1783 ok(
size ==
sizeof(key_lengths),
"got %lu\n",
size);
1805 memcpy(ivbuf, iv,
sizeof(iv));
1809 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
1812 memcpy(ivbuf, iv,
sizeof(iv));
1813 memset(plaintext, 0,
sizeof(plaintext));
1818 ok(!
memcmp(ivbuf, ciphertext +
size -
sizeof(iv),
sizeof(iv)),
"wrong iv data.\n");
1822 memset(plaintext, 0,
sizeof(plaintext));
1827 ok(!
memcmp(ivbuf, ciphertext + 32 - 16,
sizeof(iv)),
"wrong iv data.\n");
1830 memset(plaintext, 0,
sizeof(plaintext));
1834 ok(!
memcmp(plaintext, expected4,
sizeof(expected4)),
"wrong data\n");
1838 memcpy(ivbuf, iv,
sizeof(iv));
1842 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
1845 memcpy(ivbuf, iv,
sizeof(iv));
1846 memset(plaintext, 0,
sizeof(plaintext));
1850 ok(!
memcmp(plaintext, expected2,
sizeof(expected2)),
"wrong data\n");
1851 ok(!
memcmp(ivbuf, ciphertext2 + 32 -
sizeof(iv),
sizeof(iv)),
"wrong iv data.\n");
1854 memset(plaintext, 0,
sizeof(plaintext));
1858 ok(!
memcmp(plaintext, expected4,
size),
"wrong data\n");
1859 ok(!
memcmp(ivbuf, ciphertext2 + 32 - 16,
sizeof(iv)),
"wrong iv data.\n");
1863 memcpy(ivbuf, iv,
sizeof(iv));
1867 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
1870 memcpy(ivbuf, iv,
sizeof(iv));
1871 memset(plaintext, 0,
sizeof(plaintext));
1875 ok(!
memcmp(plaintext, expected3,
sizeof(expected3)),
"wrong data\n");
1876 ok(!
memcmp(ivbuf, ciphertext3 + 48 - 16,
sizeof(iv)),
"wrong iv data.\n");
1880 memcpy(ivbuf, iv,
sizeof(iv));
1886 memcpy(ivbuf, iv,
sizeof(iv));
1892 memcpy(ivbuf, iv,
sizeof(iv));
1898 memcpy(ivbuf, iv,
sizeof(iv));
1905 memcpy(ivbuf, iv,
sizeof(iv));
1912 memcpy(ivbuf, iv,
sizeof(iv));
1937 memset(&auth_info, 0,
sizeof(auth_info));
1938 auth_info.
cbSize =
sizeof(auth_info);
1947 memcpy(ivbuf, iv,
sizeof(iv));
1948 memset(plaintext, 0,
sizeof(plaintext));
1952 ok(!
memcmp(plaintext, expected3,
sizeof(expected3)),
"wrong data\n");
1953 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv.\n");
1966 memset(plaintext, 0,
sizeof(plaintext));
1970 ok(!
memcmp(plaintext, expected3,
sizeof(expected3)),
"wrong data\n");
1973 memcpy(ivbuf, iv,
sizeof(iv));
1975 memset(plaintext, 0,
sizeof(plaintext));
1979 ok(!
memcmp(plaintext, expected3,
sizeof(expected3)),
"wrong data\n");
1980 ok(!
memcmp(ivbuf + 1, iv + 1,
sizeof(iv) - 1),
"wrong iv data.\n");
1981 ok(ivbuf[0] == iv[0] + 1,
"wrong iv data.\n");
1986 auth_info.
pbTag = tag2;
1987 auth_info.
cbTag =
sizeof(tag2);
1990 memcpy(ivbuf, iv,
sizeof(iv));
1991 memset(plaintext, 0,
sizeof(plaintext));
1995 ok(!
memcmp(plaintext, expected3,
sizeof(expected3)),
"wrong data\n");
1996 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv.\n");
1999 memcpy(ivbuf, iv,
sizeof(iv));
2000 auth_info.
pbTag = iv;
2004 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
2028 memcpy(ivbuf, iv,
sizeof(iv));
2040 memset(plaintext, 0,
sizeof(plaintext));
2053 memset(plaintext, 0,
sizeof(plaintext));
2057 ok(!
memcmp(plaintext, expected2,
sizeof(expected2)),
"wrong data\n");
2066 memset(plaintext, 0,
sizeof(plaintext));
2070 ok(!
memcmp(plaintext, expected3,
sizeof(expected3)),
"wrong data\n");
2129 static const UCHAR encrypted_blob[40] = {0x33,0x6e,0x51,0x10,
2130 0x25,0xba,0xdb,0xce,0xcb,0x25,0x00,0x85,0x51,0xc0,0xfa,0x21,
2131 0x66,0xdd,0x6d,0x67,0x46,0x76,0x0f,0x8a,0x44,0xe5,0x65,0x31,
2132 0xcb,0x02,0x52,0x9c,0x69,0x59,0x1a,0xec,0x67,0x27,0x11,0xaa};
2148 key_data1->cbKeyData = 16;
2149 memset(&key_data1[1], 0x11, 16);
2159 memset(&key_data2[1], 0x22, 32);
2168 ok(
size ==
sizeof(buffer3),
"got %lu\n",
size);
2172 ok(!
memcmp(buffer3, encrypted_blob,
sizeof(encrypted_blob)),
"blobs didn't match\n");
2177 ok(key3 !=
NULL,
"key not set\n");
2180 memset(buffer4, 0xff,
sizeof(buffer4));
2183 ok(
size ==
sizeof(buffer2),
"Got %lu\n",
size);
2184 ok(!
memcmp(buffer4, buffer2,
sizeof(buffer2)),
"Expected exported key to match imported key\n");
2192 ok(
size ==
sizeof(buffer1),
"got %lu\n",
size);
2195 memset(buffer2, 0xff,
sizeof(buffer2));
2198 ok(
size ==
sizeof(buffer1),
"Got %lu\n",
size);
2199 ok(!
memcmp(buffer1, buffer2,
sizeof(buffer1)),
"Expected exported key to match imported key\n");
2205 ok(
size > 0,
"got zero\n");
2237 0x26, 0xff, 0x0e, 0xf9, 0x71, 0x93, 0xf8, 0xed, 0x59, 0xfa, 0x24, 0xec, 0x18, 0x13, 0xfe, 0xf5,
2238 0x0b, 0x4a, 0xb1, 0x27, 0xb7, 0xab, 0x3e, 0x4f, 0xc5, 0x5a, 0x91, 0xa3, 0x6e, 0x21, 0x61, 0x65,
2240 0x62, 0x7b, 0x8b, 0x30, 0x7a, 0x63, 0x4c, 0x1a, 0xf4, 0x54, 0x54, 0xbb, 0x75, 0x59, 0x68, 0x36,
2241 0xfe, 0x49, 0x95, 0x75, 0x9e, 0x20, 0x3e, 0x69, 0x58, 0xb9, 0x7a, 0x84, 0x03, 0x45, 0x5c, 0x10,
2243 0xb9, 0xcd, 0xbe, 0xd4, 0x75, 0x5d, 0x05, 0xe5, 0x83, 0x0c, 0xd3, 0x37, 0x34, 0x15, 0xe3, 0x2c,
2244 0xe5, 0x85, 0x15, 0xa9, 0xee, 0xba, 0x94, 0x03, 0x03, 0x0b, 0x86, 0xea, 0x85, 0x40, 0xbd, 0x35,
2249 0x00, 0x5f, 0xea, 0x1e, 0x01, 0xae, 0x69, 0xc3, 0x88, 0x1c, 0xbf, 0x7f, 0x86, 0x1a, 0x48, 0x20,
2250 0xd3, 0xba, 0xac, 0x9f, 0x1c, 0xc9, 0x99, 0xfa, 0x7d, 0x39, 0xf6, 0xe0, 0xd6, 0x92, 0x97, 0xee,
2251 0xf6, 0xca, 0x65, 0x40, 0x24, 0xa6, 0xf7, 0x97, 0x17, 0x8c, 0xe1, 0x81, 0x6c, 0x10, 0x92, 0xcd,
2252 0x41, 0xbc, 0x1c, 0xde, 0x37, 0x4a, 0x21, 0xb9, 0xbc, 0x46, 0x40, 0xa9, 0x91, 0xd9, 0x61, 0x84,
2255 0x00, 0x31, 0xde, 0xe9, 0x64, 0x9d, 0xb8, 0x43, 0x3a, 0x93, 0x5d, 0xc8, 0x82, 0xec, 0xe4, 0x7f,
2256 0x83, 0x8d, 0x2c, 0xc7, 0xe8, 0x24, 0x38, 0x5a, 0x81, 0x3d, 0xe6, 0x8d, 0xd4, 0xb1, 0xa0, 0x37,
2257 0x89, 0xae, 0x1f, 0x81, 0x23, 0x22, 0x8f, 0xd1, 0xe0, 0xc4, 0x6a, 0x99, 0xcc, 0xc8, 0xe4, 0xa0,
2258 0x65, 0x42, 0x9e, 0xbd, 0xaf, 0x07, 0x79, 0xe8, 0x88, 0xc2, 0xfe, 0xc0, 0x2d, 0x88, 0xd5, 0x3a,
2261 0x00, 0x8b, 0xc5, 0xd5, 0x06, 0x3a, 0x1d, 0xd2, 0xf8, 0x26, 0x8e, 0xa2, 0xd3, 0x69, 0x5a, 0xf9,
2262 0xb6, 0x42, 0x8b, 0x1a, 0x9c, 0x34, 0x04, 0xa6, 0x1d, 0xfc, 0x67, 0xe5, 0x23, 0x71, 0x8e, 0xad,
2263 0x61, 0x45, 0x4f, 0x00, 0x3e, 0x8f, 0x61, 0xa3, 0xfb, 0xb6, 0x7a, 0x98, 0xf8, 0x27, 0x2c, 0x1b,
2264 0xa8, 0xda, 0xb7, 0x78, 0xe9, 0xf5, 0x9d, 0xff, 0x6a, 0x07, 0xb0, 0xe2, 0xae, 0x64, 0x15, 0x03,
2270 0x3b, 0x3c, 0x34, 0xc8, 0x3f, 0x15, 0xea, 0x02, 0x68, 0x46, 0x69, 0xdf, 0x0c, 0xa6, 0xee, 0x7a,
2271 0xd9, 0x82, 0x08, 0x9b, 0x37, 0x53, 0x42, 0xf3, 0x13, 0x63, 0xda, 0x65, 0x79, 0xe8, 0x04, 0x9e,
2273 0x8c, 0x77, 0xc4, 0x33, 0x77, 0xd9, 0x5a, 0x7f, 0x60, 0x7b, 0x98, 0xce, 0xf3, 0x96, 0x56, 0xd6,
2274 0xb5, 0x8d, 0x87, 0x7a, 0x00, 0x2b, 0xf3, 0x70, 0xb3, 0x90, 0x73, 0xa0, 0x56, 0x06, 0x3b, 0x22,
2278 0x28, 0x19, 0x0f, 0x15, 0x6d, 0x75, 0xcc, 0xcf, 0x62, 0xf1, 0x5e, 0xe6, 0x8a, 0xc3, 0xf0, 0x5d,
2279 0x89, 0x28, 0x2d, 0x48, 0xd8, 0x73, 0x7c, 0x05, 0x05, 0x8e, 0xbc, 0xce, 0x28, 0xb7, 0xba, 0xc9,
2284 0xd7, 0x29, 0xce, 0x5a, 0xef, 0x74, 0x85, 0xd1, 0x18, 0x5f, 0x6e, 0xf1, 0xba, 0x53, 0xd4, 0xcd,
2285 0xdd, 0xe0, 0x5d, 0xf1, 0x5e, 0x48, 0x51, 0xea, 0x63, 0xc0, 0xe8, 0xe2, 0xf6, 0xfa, 0x4c, 0xaf,
2287 0xe3, 0x94, 0x15, 0x3b, 0x6c, 0x71, 0x6e, 0x44, 0x22, 0xcb, 0xa0, 0x88, 0xcd, 0x0a, 0x5a, 0x50,
2288 0x29, 0x7c, 0x5c, 0xd6, 0x6c, 0xd2, 0xe0, 0x7f, 0xcd, 0x02, 0x92, 0x21, 0x4c, 0x2c, 0x92, 0xee,
2292 0x01, 0x6b, 0xd6, 0xca, 0xac, 0x28, 0xa8, 0xa9, 0x83, 0x9d, 0xca, 0x13, 0x08, 0xd6, 0xf2, 0x9c,
2293 0x94, 0x6b, 0x28, 0x6b, 0x93, 0x58, 0x3c, 0x65, 0x54, 0xb4, 0xa6, 0xb8, 0x0d, 0x55, 0xed, 0x4e,
2294 0xc9, 0x98, 0x26, 0x96, 0x1a, 0xbb, 0x9f, 0x9e, 0x5c, 0xb1, 0x1e, 0x8b, 0x04, 0x82, 0xe6, 0x32,
2295 0x15, 0x92, 0xcb, 0xfe, 0xe7, 0x53, 0xfc, 0x17, 0xe0, 0xc9, 0x44, 0xf5, 0x1d, 0x37, 0x33, 0x02,
2296 0xbb, 0x75, 0x01, 0x65, 0x84, 0xab, 0x89, 0xb3, 0x69, 0x56, 0xf4, 0x18, 0xb0, 0xdd, 0xfd, 0x69,
2297 0xe6, 0x52, 0x1e, 0x75, 0x4f, 0x98, 0xa8, 0x49, 0x88, 0x84, 0x15, 0x58, 0x23, 0x9f, 0x89, 0x06,
2298 0x73, 0x6b, 0x8c, 0xf9, 0x9a, 0x85, 0x1d, 0xd2, 0xf4, 0x06, 0x65, 0xa5, 0x88, 0x12, 0xa3, 0x4e,
2299 0xcd, 0x99, 0x06, 0x1b, 0xf8, 0x17, 0xe0, 0xeb, 0xb8, 0x7f, 0x6b, 0x89, 0x47, 0xd2, 0x5d, 0x30,
2300 0xf4, 0xf6, 0x5f, 0x83,
2306 {0x7e, 0xe3, 0x74, 0xe7, 0xc5, 0x0b, 0x6b, 0x70, 0xdb, 0xab, 0x32, 0x6d, 0x1d, 0x51, 0xd6,
2307 0x74, 0x79, 0x8e, 0x5b, 0x4b};
2353 ok(
size ==
sizeof(keylen),
"got %lu\n",
size);
2354 ok(keylen == 256,
"got %lu\n", keylen);
2424 ok(
size ==
sizeof(keylen),
"got %lu\n",
size);
2425 ok(keylen == 521,
"got %lu\n", keylen);
2475 win_skip(
"generic ECDSA provider not found\n");
2503 ok(strength == 256,
"got %lu\n", strength);
2531 ok(strength == 256,
"got %lu\n", strength);
2549 0x52, 0x53, 0x41, 0x31, 0x00, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
2550 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0xad, 0x41, 0x09, 0xa2, 0x56,
2551 0x3a, 0x7b, 0x75, 0x4b, 0x72, 0x9b, 0x28, 0x72, 0x3b, 0xae, 0x9f, 0xd8, 0xa8, 0x25, 0x4a, 0x4c,
2552 0x19, 0xf5, 0xa6, 0xd0, 0x05, 0x1c, 0x59, 0x8f, 0xe3, 0xf3, 0x2d, 0x29, 0x47, 0xf8, 0x80, 0x25,
2553 0x25, 0x21, 0x58, 0xc2, 0xac, 0xa1, 0x9e, 0x93, 0x8e, 0x82, 0x6d, 0xd7, 0xf3, 0xe7, 0x8f, 0x0b,
2554 0xc0, 0x41, 0x85, 0x29, 0x3c, 0xf1, 0x0b, 0x2c, 0x5d, 0x49, 0xed, 0xb4, 0x30, 0x6e, 0x02, 0x15,
2555 0x4b, 0x9a, 0x08, 0x0d, 0xe1, 0x6f, 0xa8, 0xd3, 0x12, 0xab, 0x66, 0x48, 0x4d, 0xd9, 0x28, 0x03,
2556 0x6c, 0x9d, 0x44, 0x7a, 0xed, 0xc9, 0x43, 0x4f, 0x9d, 0x4e, 0x3c, 0x7d, 0x0e, 0xff, 0x07, 0x87,
2557 0xeb, 0xca, 0xca, 0x65, 0x6d, 0xbe, 0xc5, 0x31, 0x8b, 0xcc, 0x7e, 0x0a, 0x71, 0x4a, 0x4d, 0x9d,
2558 0x3d, 0xfd, 0x7a, 0x56, 0x32, 0x8a, 0x6c, 0x6d, 0x9d, 0x2a, 0xd9, 0x8e, 0x68, 0x89, 0x63, 0xc6,
2559 0x4f, 0x24, 0xd1, 0x2a, 0x72, 0x69, 0x08, 0x77, 0xa0, 0x7f, 0xfe, 0xc6, 0x33, 0x8d, 0xb4, 0x7d,
2560 0x73, 0x91, 0x13, 0x9c, 0x47, 0x53, 0x6a, 0x13, 0xdf, 0x19, 0xc7, 0xed, 0x48, 0x81, 0xed, 0xd8,
2561 0x1f, 0x11, 0x11, 0xbb, 0x41, 0x15, 0x5b, 0xa4, 0xf5, 0xc9, 0x2b, 0x48, 0x5e, 0xd8, 0x4b, 0x52,
2562 0x1f, 0xf7, 0x87, 0xf2, 0x68, 0x25, 0x28, 0x79, 0xee, 0x39, 0x41, 0xc9, 0x0e, 0xc8, 0xf9, 0xf2,
2563 0xd8, 0x24, 0x09, 0xb4, 0xd4, 0xb7, 0x90, 0xba, 0x26, 0xe8, 0x1d, 0xb4, 0xd7, 0x09, 0x00, 0xc4,
2564 0xa0, 0xb6, 0x14, 0xe8, 0x4c, 0x29, 0x60, 0x54, 0x2e, 0x01, 0xde, 0x54, 0x66, 0x40, 0x22, 0x50,
2565 0x27, 0xf1, 0xe7, 0x62, 0xa9, 0x00, 0x5a, 0x61, 0x2e, 0xfa, 0xfe, 0x16, 0xd8, 0xe0, 0xe7, 0x66,
2566 0x17, 0xda, 0xb8, 0x0c, 0xa6, 0x04, 0x8d, 0xf8, 0x21, 0x68, 0x39
2571 0x96, 0x1f, 0xa6, 0x49, 0x58, 0x81, 0x8f, 0x76, 0x77, 0x07, 0x07, 0x27, 0x55, 0xd7, 0x01, 0x8d,
2572 0xcd, 0x27, 0x8e, 0x94
2577 0xa8, 0x3a, 0x9d, 0xaf, 0x92, 0x94, 0xa4, 0x4d, 0x34, 0xba, 0x41, 0x0c, 0xc1, 0x23, 0x91, 0xc7,
2578 0x91, 0xa8, 0xf8, 0xfc, 0x94, 0x87, 0x4d, 0x05, 0x85, 0x63, 0xe8, 0x7d, 0xea, 0x7f, 0x6b, 0x8d,
2579 0xbb, 0x9a, 0xd4, 0x46, 0xa6, 0xc0, 0xd6, 0xdc, 0x91, 0xba, 0xd3, 0x1a, 0xbf, 0xf4, 0x52, 0xa0,
2580 0xc7, 0x15, 0x87, 0xe9, 0x1e, 0x60, 0x49, 0x9c, 0xee, 0x5a, 0x9c, 0x6c, 0xbd, 0x7a, 0x3e, 0xc3,
2581 0x48, 0xb3, 0xee, 0xca, 0x68, 0x40, 0x9b, 0xa1, 0x4c, 0x6e, 0x20, 0xd6, 0xca, 0x6c, 0x72, 0xaf,
2582 0x2b, 0x6b, 0x62, 0x7c, 0x78, 0x06, 0x94, 0x4c, 0x02, 0xf3, 0x8d, 0x49, 0xe0, 0x11, 0xc4, 0x9b,
2583 0x62, 0x5b, 0xc2, 0xfd, 0x68, 0xf4, 0x07, 0x15, 0x71, 0x11, 0x4c, 0x35, 0x97, 0x5d, 0xc0, 0xe6,
2584 0x22, 0xc9, 0x8a, 0x7b, 0x96, 0xc9, 0xc3, 0xe4, 0x2b, 0x1e, 0x88, 0x17, 0x4f, 0x98, 0x9b, 0xf3,
2585 0x42, 0x23, 0x0c, 0xa0, 0xfa, 0x19, 0x03, 0x2a, 0xf7, 0x13, 0x2d, 0x27, 0xac, 0x9f, 0xaf, 0x2d,
2586 0xa3, 0xce, 0xf7, 0x63, 0xbb, 0x39, 0x9f, 0x72, 0x80, 0xdd, 0x6c, 0x73, 0x00, 0x85, 0x70, 0xf2,
2587 0xed, 0x50, 0xed, 0xa0, 0x74, 0x42, 0xd7, 0x22, 0x46, 0x24, 0xee, 0x67, 0xdf, 0xb5, 0x45, 0xe8,
2588 0x49, 0xf4, 0x9c, 0xe4, 0x00, 0x83, 0xf2, 0x27, 0x8e, 0xa2, 0xb1, 0xc3, 0xc2, 0x01, 0xd7, 0x59,
2589 0x2e, 0x4d, 0xac, 0x49, 0xa2, 0xc1, 0x8d, 0x88, 0x4b, 0xfe, 0x28, 0xe5, 0xac, 0xa6, 0x85, 0xc4,
2590 0x1f, 0xf8, 0xc5, 0xc5, 0x14, 0x4e, 0xa3, 0xcb, 0x17, 0xb7, 0x64, 0xb3, 0xc2, 0x12, 0xf8, 0xf8,
2591 0x36, 0x99, 0x1c, 0x91, 0x9b, 0xbd, 0xed, 0x55, 0x0f, 0xfd, 0x49, 0x85, 0xbb, 0x32, 0xad, 0x78,
2592 0xc1, 0x74, 0xe6, 0x7c, 0x18, 0x0f, 0x2b, 0x3b, 0xaa, 0xd1, 0x9d, 0x40, 0x71, 0x1d, 0x19, 0x53
2597 0x52, 0x53, 0x41, 0x32, 0x00, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
2598 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0xa6, 0x8b, 0x46, 0x26, 0xb5,
2599 0xa9, 0x69, 0x83, 0x94, 0x66, 0xa7, 0xf3, 0x33, 0x95, 0x74, 0xe9, 0xeb, 0xc8, 0xcd, 0xd7, 0x81,
2600 0x9e, 0x45, 0x66, 0xb2, 0x48, 0x8b, 0x1f, 0xfe, 0xb3, 0x62, 0xc4, 0x0d, 0xa2, 0xf9, 0xf3, 0xe2,
2601 0xa6, 0x86, 0xd1, 0x1e, 0x8a, 0xbb, 0x1d, 0xa5, 0xc5, 0xe8, 0xa7, 0x50, 0x37, 0xfd, 0x69, 0x1f,
2602 0x6f, 0x99, 0x99, 0xca, 0x39, 0x13, 0xea, 0x5b, 0x6b, 0xe3, 0x91, 0xc0, 0xd2, 0x2c, 0x0b, 0x21,
2603 0xb1, 0xac, 0xa9, 0xe8, 0xa0, 0x6d, 0xa4, 0x1f, 0x1b, 0x34, 0xcb, 0x88, 0x7f, 0x2e, 0xeb, 0x7d,
2604 0x91, 0x38, 0x48, 0xce, 0x05, 0x73, 0x05, 0xdd, 0x22, 0x94, 0xc3, 0xdd, 0x1c, 0xfd, 0xc5, 0x41,
2605 0x2e, 0x94, 0xf9, 0xed, 0xe5, 0x92, 0x5f, 0x3f, 0x06, 0xf8, 0x49, 0x60, 0xb8, 0x92, 0x52, 0x6a,
2606 0x56, 0x6e, 0xd7, 0x04, 0x1a, 0xb5, 0xb5, 0x1c, 0x31, 0xd1, 0x1b,
2611 0x52, 0x53, 0x41, 0x33, 0x00, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
2612 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0xa6, 0x8b, 0x46, 0x26, 0xb5,
2613 0xa9, 0x69, 0x83, 0x94, 0x66, 0xa7, 0xf3, 0x33, 0x95, 0x74, 0xe9, 0xeb, 0xc8, 0xcd, 0xd7, 0x81,
2614 0x9e, 0x45, 0x66, 0xb2, 0x48, 0x8b, 0x1f, 0xfe, 0xb3, 0x62, 0xc4, 0x0d, 0xa2, 0xf9, 0xf3, 0xe2,
2615 0xa6, 0x86, 0xd1, 0x1e, 0x8a, 0xbb, 0x1d, 0xa5, 0xc5, 0xe8, 0xa7, 0x50, 0x37, 0xfd, 0x69, 0x1f,
2616 0x6f, 0x99, 0x99, 0xca, 0x39, 0x13, 0xea, 0x5b, 0x6b, 0xe3, 0x91, 0xc0, 0xd2, 0x2c, 0x0b, 0x21,
2617 0xb1, 0xac, 0xa9, 0xe8, 0xa0, 0x6d, 0xa4, 0x1f, 0x1b, 0x34, 0xcb, 0x88, 0x7f, 0x2e, 0xeb, 0x7d,
2618 0x91, 0x38, 0x48, 0xce, 0x05, 0x73, 0x05, 0xdd, 0x22, 0x94, 0xc3, 0xdd, 0x1c, 0xfd, 0xc5, 0x41,
2619 0x2e, 0x94, 0xf9, 0xed, 0xe5, 0x92, 0x5f, 0x3f, 0x06, 0xf8, 0x49, 0x60, 0xb8, 0x92, 0x52, 0x6a,
2620 0x56, 0x6e, 0xd7, 0x04, 0x1a, 0xb5, 0xb5, 0x1c, 0x31, 0xd1, 0x1b, 0xa3, 0xf3, 0xd1, 0x69, 0x61,
2621 0xab, 0xfe, 0xc1, 0xb6, 0x40, 0x7b, 0x19, 0xbb, 0x2d, 0x59, 0xf5, 0xda, 0x49, 0x32, 0x6f, 0x20,
2622 0x24, 0xd3, 0xb3, 0xec, 0x21, 0xec, 0x0c, 0xc7, 0x5b, 0xf9, 0x1b, 0xba, 0x6e, 0xe9, 0x61, 0xda,
2623 0x55, 0xc6, 0x72, 0xfd, 0x2d, 0x66, 0x3f, 0x3c, 0xcb, 0x49, 0xa9, 0xc5, 0x0d, 0x9b, 0x02, 0x36,
2624 0x7a, 0xee, 0x36, 0x09, 0x55, 0xe4, 0x03, 0xf2, 0xe3, 0xe6, 0x25, 0x14, 0x89, 0x7f, 0x2b, 0xfb,
2625 0x27, 0x0e, 0x8d, 0x37, 0x84, 0xfd, 0xad, 0x10, 0x79, 0x43, 0x4e, 0x38, 0x4a, 0xd4, 0x5e, 0xfa,
2626 0xda, 0x9f, 0x88, 0x21, 0x7c, 0xb4, 0x98, 0xb6, 0x6e, 0x1c, 0x24, 0x09, 0xe5, 0xe7, 0x22, 0x6f,
2627 0xd3, 0x84, 0xc0, 0xdc, 0x36, 0x09, 0xaf, 0x4b, 0x96, 0x8b, 0x5f, 0x47, 0xb3, 0x24, 0x80, 0xb5,
2628 0x64, 0x69, 0xad, 0x83, 0xd5, 0x09, 0xe7, 0xb9, 0xe4, 0x81, 0x6f, 0x1a, 0xe2, 0x6d, 0xf1, 0x5e,
2629 0x2b, 0xb3, 0x7a, 0xd0, 0x77, 0xef, 0x82, 0xcd, 0x55, 0x2e, 0xd5, 0xb1, 0xa7, 0x72, 0xec, 0x02,
2630 0x9d, 0xe2, 0xcc, 0x5a, 0xf1, 0x68, 0x30, 0xe5, 0xbc, 0x8d, 0xad,
2650 0x91, 0xe3, 0x6b, 0x5b, 0xea, 0x13, 0x39, 0xca, 0x99, 0x99, 0x6f, 0x1f, 0x69, 0xfd, 0x37, 0x50,
2651 0xa7, 0xe8, 0xc5, 0xa5, 0x1d, 0xbb, 0x8a, 0x1e, 0xd1, 0x86, 0xa6, 0xe2, 0xf3, 0xf9, 0xa2, 0x0d,
2652 0xc4, 0x62, 0xb3, 0xfe, 0x1f, 0x8b, 0x48, 0xb2, 0x66, 0x45, 0x9e, 0x81, 0xd7, 0xcd, 0xc8, 0xeb,
2653 0xe9, 0x74, 0x95, 0x33, 0xf3, 0xa7, 0x66, 0x94, 0x83, 0x69, 0xa9, 0xb5, 0x26, 0x46, 0x8b, 0xa6
2656 0xc3, 0x94, 0x22, 0xdd, 0x05, 0x73, 0x05, 0xce, 0x48, 0x38, 0x91, 0x7d, 0xeb, 0x2e, 0x7f, 0x88,
2657 0xcb, 0x34, 0x1b, 0x1f, 0xa4, 0x6d, 0xa0, 0xe8, 0xa9, 0xac, 0xb1, 0x21, 0x0b, 0x2c, 0xd2, 0xc0
2660 0x1b, 0xd1, 0x31, 0x1c, 0xb5, 0xb5, 0x1a, 0x04, 0xd7, 0x6e, 0x56, 0x6a, 0x52, 0x92, 0xb8, 0x60,
2661 0x49, 0xf8, 0x06, 0x3f, 0x5f, 0x92, 0xe5, 0xed, 0xf9, 0x94, 0x2e, 0x41, 0xc5, 0xfd, 0x1c, 0xdd
2664 0x1b, 0xf9, 0x5b, 0xc7, 0x0c, 0xec, 0x21, 0xec, 0xb3, 0xd3, 0x24, 0x20, 0x6f, 0x32, 0x49, 0xda,
2665 0xf5, 0x59, 0x2d, 0xbb, 0x19, 0x7b, 0x40, 0xb6, 0xc1, 0xfe, 0xab, 0x61, 0x69, 0xd1, 0xf3, 0xa3
2668 0x25, 0xe6, 0xe3, 0xf2, 0x03, 0xe4, 0x55, 0x09, 0x36, 0xee, 0x7a, 0x36, 0x02, 0x9b, 0x0d, 0xc5,
2669 0xa9, 0x49, 0xcb, 0x3c, 0x3f, 0x66, 0x2d, 0xfd, 0x72, 0xc6, 0x55, 0xda, 0x61, 0xe9, 0x6e, 0xba
2672 0x24, 0x1c, 0x6e, 0xb6, 0x98, 0xb4, 0x7c, 0x21, 0x88, 0x9f, 0xda, 0xfa, 0x5e, 0xd4, 0x4a, 0x38,
2673 0x4e, 0x43, 0x79, 0x10, 0xad, 0xfd, 0x84, 0x37, 0x8d, 0x0e, 0x27, 0xfb, 0x2b, 0x7f, 0x89, 0x14
2676 0xad, 0x8d, 0xbc, 0xe5, 0x30, 0x68, 0xf1, 0x5a, 0xcc, 0xe2, 0x9d, 0x02, 0xec, 0x72, 0xa7, 0xb1,
2677 0xd5, 0x2e, 0x55, 0xcd, 0x82, 0xef, 0x77, 0xd0, 0x7a, 0xb3, 0x2b, 0x5e, 0xf1, 0x6d, 0xe2, 0x1a,
2678 0x6f, 0x81, 0xe4, 0xb9, 0xe7, 0x09, 0xd5, 0x83, 0xad, 0x69, 0x64, 0xb5, 0x80, 0x24, 0xb3, 0x47,
2679 0x5f, 0x8b, 0x96, 0x4b, 0xaf, 0x09, 0x36, 0xdc, 0xc0, 0x84, 0xd3, 0x6f, 0x22, 0xe7, 0xe5, 0x09
2686 0x52, 0x53, 0x41, 0x31, 0x00, 0x04, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00,
2687 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2688 0x01, 0x00, 0x01, 0xc7, 0x8f, 0xac, 0x2a, 0xce, 0xbf, 0xc9, 0x6c, 0x7b,
2689 0x85, 0x74, 0x71, 0xbb, 0xff, 0xbb, 0x9b, 0x20, 0x03, 0x79, 0x17, 0x34,
2690 0xe7, 0x26, 0x91, 0x5c, 0x1f, 0x1b, 0x03, 0x3d, 0x46, 0xdf, 0xb6, 0xf2,
2691 0x10, 0x55, 0xf0, 0x39, 0x55, 0x0a, 0xe3, 0x9c, 0x0c, 0x63, 0xc2, 0x14,
2692 0x03, 0x94, 0x51, 0x0d, 0xb4, 0x22, 0x09, 0xf2, 0x5c, 0xb2, 0xd1, 0xc3,
2693 0xac, 0x6f, 0xa8, 0xc4, 0xac, 0xb8, 0xbc, 0x59, 0xe7, 0xed, 0x77, 0x6e,
2694 0xb1, 0x80, 0x58, 0x7d, 0xb2, 0x94, 0x46, 0xe5, 0x00, 0xe2, 0xb7, 0x33,
2695 0x48, 0x7a, 0xd3, 0x78, 0xe9, 0x26, 0x01, 0xc7, 0x00, 0x7b, 0x41, 0x6d,
2696 0x94, 0x3a, 0xe1, 0x50, 0x2b, 0x9f, 0x6b, 0x1c, 0x08, 0xa3, 0xfc, 0x0a,
2697 0x44, 0x81, 0x09, 0x41, 0x80, 0x23, 0x7b, 0xf6, 0x3f, 0xaf, 0x91, 0xa1,
2698 0x87, 0x75, 0x33, 0x15, 0xb8, 0xde, 0x32, 0x30, 0xb4, 0x5e, 0xfd
2703 0x4a, 0xc1, 0xfa, 0x4f, 0xe0, 0x3f, 0x36, 0x9a, 0x64, 0xbf, 0x2e, 0x00, 0xb4, 0xb5, 0x40, 0xbe,
2704 0x2d, 0x9a, 0x14, 0xf6, 0x8f, 0xa5, 0xc2, 0xe2, 0x20, 0xaf, 0x21, 0x79, 0xc6, 0x32, 0x7e, 0xea,
2705 0x73, 0x00, 0x01, 0xbb, 0x9a, 0x19, 0x73, 0x41, 0x96, 0xae, 0x88, 0x6e, 0x36, 0x56, 0xe9, 0x9c,
2706 0xac, 0x04, 0x82, 0xa8, 0x00, 0xdb, 0x4e, 0x29, 0x61, 0x7e, 0xaf, 0x64, 0xdb, 0xa2, 0x70, 0x0f,
2711 UCHAR input[] =
"Hello World!", input_no_padding[64] = { 0 }, encrypted[64], decrypted[64];
2715 DWORD encrypted_size, decrypted_size;
2742 memset(input_no_padding, 0,
sizeof(input_no_padding));
2747 ok(encrypted_size == 64,
"got size of %ld\n", encrypted_size);
2749 strcpy((
char *)input_no_padding,
"Hello World");
2753 ok(encrypted_size == 64,
"got size of %ld\n", encrypted_size);
2755 encrypted_a =
malloc(encrypted_size);
2756 memset(encrypted_a, 0, encrypted_size);
2757 encrypted_b =
malloc(encrypted_size);
2758 memset(encrypted_b, 0xff, encrypted_size);
2765 ok(encrypted_size == 64,
"got size of %ld\n", encrypted_size);
2769 ok(encrypted_size == 64,
"got size of %ld\n", encrypted_size);
2773 ok(!
memcmp(encrypted_a, encrypted_b, encrypted_size),
"Both outputs should be the same\n");
2779 ok(decrypted_size ==
sizeof(input_no_padding),
"got %lu\n", decrypted_size);
2783 ok(decrypted_size ==
sizeof(input_no_padding),
"got %lu\n", decrypted_size);
2784 ok(!
memcmp(decrypted, input_no_padding,
sizeof(input_no_padding)),
"unexpected output\n");
2790 ok(encrypted_size == 64,
"got size of %ld\n", encrypted_size);
2792 encrypted_a =
realloc(encrypted_a, encrypted_size);
2793 memset(encrypted_a, 0, encrypted_size);
2794 encrypted_b =
realloc(encrypted_b, encrypted_size);
2795 memset(encrypted_b, 0, encrypted_size);
2799 ok(encrypted_size == 64,
"got size of %ld\n", encrypted_size);
2803 ok(encrypted_size == 64,
"got size of %ld\n", encrypted_size);
2804 ok(
memcmp(encrypted_a, encrypted_b, encrypted_size),
"Both outputs are the same\n");
2809 ok(decrypted_size ==
sizeof(
input),
"got size of %ld\n", decrypted_size);
2813 ok(decrypted_size ==
sizeof(
input),
"got size of %ld\n", decrypted_size);
2823 ok(encrypted_size == 64,
"got size of %ld\n", encrypted_size);
2825 memset(decrypted, 0,
sizeof(decrypted));
2829 ok(decrypted_size ==
sizeof(
input),
"got size of %ld\n", decrypted_size);
2844 ok(encrypted_size == 80,
"got size of %ld\n", encrypted_size);
2849 ok(encrypted_size == 80,
"got size of %ld\n", encrypted_size);
2851 encrypted_a =
realloc(encrypted_a, encrypted_size);
2852 memset(encrypted_a, 0, encrypted_size);
2853 encrypted_b =
realloc(encrypted_b, encrypted_size);
2854 memset(encrypted_b, 0, encrypted_size);
2859 ok(encrypted_size == 80,
"got size of %ld\n", encrypted_size);
2863 ok(encrypted_size == 80,
"got size of %ld\n", encrypted_size);
2867 ok(encrypted_size == 80,
"got size of %ld\n", encrypted_size);
2868 ok(
memcmp(encrypted_a, encrypted_b, encrypted_size),
"Both outputs are the same\n");
2871 memset(decrypted, 0,
sizeof(decrypted));
2876 memset(decrypted, 0,
sizeof(decrypted));
2879 ok(decrypted_size ==
sizeof(
input),
"got %lu\n", decrypted_size);
2883 ok(decrypted_size ==
sizeof(
input),
"got %lu\n", decrypted_size);
2890 DWORD roundtrip_size;
2900 encrypted_a =
realloc(encrypted_a, encrypted_size);
2907 ok(roundtrip_size ==
sizeof(
input),
"decrypted size %lu, expected %lu\n", roundtrip_size, (
unsigned long)
sizeof(
input));
2911 ok(!
memcmp(roundtrip_plain,
input,
sizeof(
input)),
"roundtrip plaintext mismatch\n");
2919 DWORD encrypted_null_size = 0;
2926 encrypted_null =
malloc(encrypted_null_size);
2930 "unexpected OAEP(NULL) encrypt status %lx\n",
ret);
2932 free(encrypted_null);
2952 0x07, 0x02, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x52, 0x53, 0x41, 0x32, 0x00, 0x02, 0x00, 0x00,
2953 0x01, 0x00, 0x00, 0x00, 0xab, 0xef, 0xfa, 0xc6, 0x7d, 0xe8, 0xde, 0xfb, 0x68, 0x38, 0x09, 0x92,
2954 0xd9, 0x42, 0x7e, 0x6b, 0x89, 0x9e, 0x21, 0xd7, 0x52, 0x1c, 0x99, 0x3c, 0x17, 0x48, 0x4e, 0x3a,
2955 0x44, 0x02, 0xf2, 0xfa, 0x74, 0x57, 0xda, 0xe4, 0xd3, 0xc0, 0x35, 0x67, 0xfa, 0x6e, 0xdf, 0x78,
2956 0x4c, 0x75, 0x35, 0x1c, 0xa0, 0x74, 0x49, 0xe3, 0x20, 0x13, 0x71, 0x35, 0x65, 0xdf, 0x12, 0x20,
2957 0xf5, 0xf5, 0xf5, 0xc1, 0xed, 0x5c, 0x91, 0x36, 0x75, 0xb0, 0xa9, 0x9c, 0x04, 0xdb, 0x0c, 0x8c,
2958 0xbf, 0x99, 0x75, 0x13, 0x7e, 0x87, 0x80, 0x4b, 0x71, 0x94, 0xb8, 0x00, 0xa0, 0x7d, 0xb7, 0x53,
2959 0xdd, 0x20, 0x63, 0xee, 0xf7, 0x83, 0x41, 0xfe, 0x16, 0xa7, 0x6e, 0xdf, 0x21, 0x7d, 0x76, 0xc0,
2960 0x85, 0xd5, 0x65, 0x7f, 0x00, 0x23, 0x57, 0x45, 0x52, 0x02, 0x9d, 0xea, 0x69, 0xac, 0x1f, 0xfd,
2961 0x3f, 0x8c, 0x4a, 0xd0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2962 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2963 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2964 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2965 0x00, 0x00, 0x00, 0x00, 0x64, 0xd5, 0xaa, 0xb1, 0xa6, 0x03, 0x18, 0x92, 0x03, 0xaa, 0x31, 0x2e,
2966 0x48, 0x4b, 0x65, 0x20, 0x99, 0xcd, 0xc6, 0x0c, 0x15, 0x0c, 0xbf, 0x3e, 0xff, 0x78, 0x95, 0x67,
2967 0xb2, 0x74, 0x5b, 0x60, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2968 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2969 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2970 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2971 0x00, 0x00, 0x00, 0x00,
2977 {0x7e,0xe3,0x74,0xe7,0xc5,0x0b,0x6b,0x70,0xdb,0xab,0x32,0x6d,0x1d,0x51,0xd6,0x74,0x79,0x8e,0x5b,0x4b};
2978 static UCHAR hash48[] =
2979 {0x62,0xb2,0x1e,0x90,0xc9,0x02,0x2b,0x10,0x16,0x71,0xba,0x1f,0x80,0x8f,0x86,0x31,0xa8,0x14,0x9f,0x0f,
2980 0x12,0x90,0x40,0x55,0x83,0x9a,0x35,0xc1,0xca,0x78,0xae,0x53,0x1b,0xb3,0x36,0x06,0xba,0x90,0x89,0x12,
2981 0xa8,0x42,0x21,0x10,0x9d,0x29,0xcd,0x7e};
2987 UCHAR sig[256], sig_pss[256];
2999 ok(schemes,
"schemes not set\n");
3000 ok(
size ==
sizeof(schemes),
"got %lu\n",
size);
3003 ok(!
ret,
"BCryptImportKeyPair failed: %#lx\n",
ret);
3007 ok(!
ret,
"BCryptImportKeyPair failed: %#lx\n",
ret);
3012 ok(
size ==
sizeof(keylen),
"got %lu\n",
size);
3013 ok(keylen == 2048,
"got %lu\n", keylen);
3023 ok(!
ret,
"BCryptVerifySignature failed: %#lx\n",
ret);
3044 ok(!
ret,
"BCryptDestroyKey failed: %#lx\n",
ret);
3062 ok(
size ==
sizeof(keylen),
"got %lu\n",
size);
3063 ok(keylen == 2048,
"got %lu\n", keylen);
3069 memset(sig, 0,
sizeof(sig));
3076 ok(!
ret,
"BCryptVerifySignature failed: %#lx\n",
ret);
3079 memset(sig, 0,
sizeof(sig));
3086 ok(!
ret,
"BCryptVerifySignature failed: %#lx\n",
ret);
3089 memset(sig, 0,
sizeof(sig));
3101 ok(!
ret,
"BCryptVerifySignature failed: %#lx, len %ld\n",
ret,
len);
3105 memset(sig_pss, 0,
sizeof(sig_pss));
3115 ok(
size,
"size not set\n");
3128 ok(
size == size2,
"got %lu expected %lu\n", size2,
size);
3134 ok(
size,
"size not set\n");
3147 ok(
size == size2,
"got %lu expected %lu\n", size2,
size);
3154 ok(
size,
"size not set\n");
3235 ok(!
ret,
"BCryptImportKeyPair failed: %#lx\n",
ret);
3237 memset(buf2, 0xcc,
sizeof(buf2));
3248 ok(
size == size2,
"got %lu expected %lu\n", size2,
size);
3259 ok(!
ret,
"BCryptVerifySignature failed: %#lx\n",
ret);
3280 ok(!
ret,
"BCryptDestroyKey failed: %#lx\n",
ret);
3298 ok(
size,
"size not set\n");
3311 ok(
size == size2,
"got %lu expected %lu\n", size2,
size);
3317 ok(
size,
"size not set\n");
3330 ok(
size == size2,
"got %lu expected %lu\n", size2,
size);
3335 ok(!
ret,
"BCryptCloseAlgorithmProvider failed: %#lx\n",
ret);
3395 hash_param_buffers_prepended,
3419 ok(
size,
"size not set\n");
3426 ok(ecckey->
cbKey == (
t->bitlen + 7) / 8,
"got %lu\n", ecckey->
cbKey);
3440 ok(
size,
"size not set\n");
3447 ok(ecckey->
cbKey == (
t->bitlen + 7) / 8,
"got %lu\n", ecckey->
cbKey);
3463 ok(
size,
"size not set\n");
3482 win_skip(
"BCRYPT_KDF_RAW_SECRET not supported\n");
3483 goto raw_secret_end;
3488 ok(
size == (
t->bitlen + 7) / 8,
"size of secret key incorrect, got %lu, expected 32\n",
size);
3499 ok(
size == (
t->bitlen + 7) / 8,
"size of secret key incorrect, got %lu, expected 32\n",
size);
3534 hash_param_buffers[0].
pvBuffer = (
void*)
L"INVALID";
3535 hash_param_buffers[0].
cbBuffer =
sizeof(
L"INVALID");
3554 static BYTE ecc256privkey[] =
3556 0x45, 0x43, 0x4b, 0x32, 0x20, 0x00, 0x00, 0x00,
3557 0xfb, 0xbd, 0x3d, 0x20, 0x1b, 0x6d, 0x66, 0xb3, 0x7c, 0x9f, 0x89, 0xf3, 0xe4, 0x41, 0x16, 0xa5,
3558 0x68, 0x52, 0x77, 0xac, 0xab, 0x55, 0xb2, 0x6c, 0xb0, 0x23, 0x55, 0xcb, 0x96, 0x14, 0xfd, 0x0b,
3559 0x1c, 0xef, 0xdf, 0x07, 0x6d, 0x31, 0xaf, 0x39, 0xce, 0x8c, 0x8f, 0x9d, 0x75, 0xd0, 0x7b, 0xea,
3560 0x81, 0xdc, 0x40, 0x21, 0x1f, 0x58, 0x22, 0x5f, 0x72, 0x55, 0xfc, 0x58, 0x8a, 0xeb, 0x88, 0x5d,
3561 0x02, 0x09, 0x90, 0xd2, 0xe3, 0x36, 0xac, 0xfe, 0x83, 0x13, 0x6c, 0x88, 0x1a, 0xab, 0x9b, 0xdd,
3562 0xaa, 0x8a, 0xee, 0x69, 0x9a, 0x6a, 0x62, 0x86, 0x6a, 0x13, 0x69, 0x88, 0xb7, 0xd5, 0xa3, 0xcd
3564 static BYTE ecdh256_pubkey[] =
3566 0x45, 0x43, 0x4b, 0x31, 0x20, 0x00, 0x00, 0x00,
3567 0x07, 0x61, 0x9d, 0x49, 0x63, 0x6b, 0x96, 0x94, 0xd1, 0x8f, 0xd1, 0x48, 0xcc, 0xcf, 0x72, 0x4d,
3568 0xff, 0x43, 0xf4, 0x97, 0x0f, 0xa3, 0x8a, 0x72, 0xe9, 0xe0, 0xba, 0x87, 0x6d, 0xc3, 0x62, 0x15,
3569 0xae, 0x65, 0xdd, 0x31, 0x51, 0xfc, 0x3b, 0xc9, 0x59, 0xa1, 0x0a, 0x92, 0x17, 0x2b, 0x64, 0x55,
3570 0x03, 0x3e, 0x62, 0x1d, 0xac, 0x3e, 0x37, 0x40, 0x6a, 0x4c, 0xb6, 0x21, 0x3f, 0x73, 0x5c, 0xf5
3572 static BYTE ecdh256_secret[] =
3574 0x48, 0xb0, 0x11, 0xdb, 0x69, 0x4e, 0xb4, 0xf4, 0xf5, 0x3e, 0xe1, 0x9b, 0xca, 0x00, 0x04, 0xc8,
3575 0x9b, 0x69, 0xaf, 0xd1, 0xaf, 0x1f, 0xc2, 0xd7, 0x83, 0x0a, 0xb7, 0xf8, 0x4f, 0x24, 0x32, 0x8e,
3577 static BYTE hashed256_secret[] =
3579 0x1b, 0xe7, 0xbf, 0x0f, 0x65, 0x1e, 0xd0, 0x07, 0xf9, 0xf4, 0x77, 0x48, 0x48, 0x39, 0xd0, 0xf8,
3580 0xf3, 0xce, 0xfc, 0x89
3582 static BYTE hashed256_secret_prepended[] =
3584 0x10, 0x99, 0x5f, 0x01, 0xef, 0xa8, 0x18, 0x82, 0xd2, 0x62, 0x37, 0xab, 0xe0, 0x7c, 0x62, 0xc7,
3585 0x50, 0x7f, 0xa6, 0xa0,
3588 static BYTE ecc384privkey[] =
3590 0x45, 0x43, 0x4b, 0x34, 0x30, 0x00, 0x00, 0x00,
3591 0xc9, 0xcb, 0x38, 0x54, 0xa1, 0xe2, 0xb6, 0x60, 0x13, 0xd9, 0x45, 0x0d, 0x76, 0x90, 0xf9, 0x49,
3592 0x75, 0x81, 0x76, 0xac, 0x43, 0x96, 0xc1, 0x04, 0x04, 0xda, 0x76, 0x72, 0xb1, 0x19, 0x38, 0xbd,
3593 0xaf, 0x96, 0x0c, 0x4e, 0xc3, 0x29, 0x67, 0x91, 0x6c, 0xac, 0xcc, 0x33, 0x51, 0x1f, 0x82, 0xd5,
3594 0x17, 0xbf, 0xa2, 0x94, 0xd7, 0x15, 0x4f, 0x83, 0xe7, 0xa3, 0xb8, 0x6d, 0xd0, 0x7f, 0xbc, 0x8a,
3595 0x30, 0x09, 0x9e, 0x13, 0xaa, 0x2e, 0xf6, 0xde, 0x1c, 0x02, 0x4a, 0x65, 0xf6, 0x72, 0xb3, 0xf0,
3596 0x4f, 0x7f, 0x1a, 0xce, 0x4e, 0x94, 0xc5, 0x98, 0x89, 0x74, 0xad, 0x51, 0x8f, 0x2b, 0x25, 0x17,
3597 0xdc, 0x4a, 0x54, 0x8a, 0x42, 0xda, 0x30, 0x1a, 0xe3, 0x6d, 0x77, 0x4d, 0x3b, 0x33, 0x9a, 0xe3,
3598 0x37, 0xd4, 0x06, 0x5b, 0xb3, 0x3f, 0x73, 0xb9, 0x7e, 0x0b, 0x37, 0x02, 0x8b, 0xed, 0x08, 0x10,
3599 0x03, 0xf8, 0x69, 0xe3, 0x2a, 0x4f, 0xbb, 0x20, 0x6c, 0x5d, 0x24, 0x09, 0x0d, 0xd9, 0x86, 0x32,
3601 static BYTE ecdh384_pubkey[] =
3603 0x45, 0x43, 0x4b, 0x33, 0x30, 0x00, 0x00, 0x00,
3604 0xd6, 0xc3, 0xef, 0x4a, 0xbb, 0x4c, 0xa2, 0x27, 0xa1, 0x96, 0x03, 0x3b, 0x0a, 0x83, 0x01, 0xff,
3605 0xeb, 0x9a, 0xf1, 0x06, 0xee, 0x83, 0xce, 0x7c, 0xaa, 0x6b, 0x7c, 0x43, 0x1c, 0x8b, 0x30, 0x82,
3606 0x99, 0x8f, 0xc4, 0x86, 0x0d, 0x19, 0x16, 0xb6, 0xab, 0xd1, 0x9f, 0xeb, 0xf9, 0x31, 0xda, 0xcd,
3607 0xb9, 0xf8, 0xea, 0x87, 0xa1, 0x36, 0xaf, 0x10, 0x98, 0x8f, 0x9b, 0xcc, 0x6c, 0xe3, 0x24, 0xb4,
3608 0x82, 0x37, 0xde, 0x1e, 0x04, 0x53, 0x03, 0xc0, 0x2a, 0x41, 0xe9, 0x50, 0x07, 0x87, 0xb2, 0x60,
3609 0xe6, 0x32, 0x53, 0x4c, 0x8e, 0xa7, 0x80, 0x0f, 0xad, 0x25, 0x3b, 0x01, 0xa4, 0xd6, 0xe3, 0x54,
3611 static BYTE ecdh384_secret[] =
3613 0x08, 0x8c, 0xd1, 0xfa, 0x57, 0xb6, 0xf9, 0x79, 0x9e, 0x0c, 0x71, 0xc3, 0xcb, 0xa5, 0xb1, 0xfd,
3614 0xde, 0xbc, 0x6d, 0x7c, 0x8a, 0x5b, 0x26, 0xe8, 0x18, 0x80, 0x61, 0x45, 0x6a, 0x38, 0xf9, 0x13,
3615 0x2a, 0x8f, 0x4b, 0xfe, 0x75, 0x02, 0x62, 0xe9, 0xb3, 0x6e, 0xc5, 0x52, 0xc9, 0x82, 0x38, 0x53,
3617 static BYTE hashed384_secret[] =
3619 0x78, 0xf8, 0x07, 0xab, 0x00, 0x35, 0xaa, 0x8c, 0x22, 0xd0, 0xe7, 0x06, 0xfc, 0x0b, 0x74, 0x41,
3620 0xed, 0xdc, 0x16, 0x6c,
3622 static BYTE hashed384_secret_prepended[] =
3624 0x3d, 0xe0, 0x30, 0xd9, 0xe2, 0xdc, 0x61, 0xad, 0x26, 0x21, 0xad, 0xa3, 0x3e, 0xaf, 0xd5, 0x8e,
3625 0xb6, 0xbc, 0x5a, 0x51,
3628 static BYTE ecc521privkey[] =
3630 0x45, 0x43, 0x4b, 0x36, 0x42, 0x00, 0x00, 0x00,
3631 0x01, 0x96, 0xb0, 0x4e, 0x35, 0x6f, 0xbe, 0x00, 0xb6, 0xc3, 0x83, 0x53, 0x92, 0x18, 0xda, 0x86,
3632 0x9e, 0x4b, 0x0f, 0xb2, 0x0b, 0xc3, 0x9f, 0xd8, 0x9c, 0x18, 0x8a, 0x93, 0x5c, 0x91, 0xb2, 0x4f,
3633 0x56, 0x7d, 0x0e, 0xf7, 0xf4, 0xdf, 0x91, 0xc6, 0x74, 0x00, 0xc7, 0xb8, 0x59, 0xeb, 0x55, 0xc0,
3634 0xb5, 0x26, 0x7f, 0x6d, 0x49, 0x53, 0x02, 0x3b, 0x3c, 0xa0, 0x57, 0x1e, 0x1c, 0x7c, 0x5b, 0x08,
3635 0x23, 0x68, 0x01, 0x47, 0x4d, 0x47, 0xcf, 0x05, 0xfe, 0x18, 0x26, 0x81, 0x9d, 0xb4, 0x34, 0xfa,
3636 0x50, 0x7e, 0x03, 0x29, 0xa3, 0x6e, 0x90, 0x9c, 0x27, 0x69, 0x66, 0x2c, 0x70, 0x7b, 0xf9, 0xe7,
3637 0xef, 0xac, 0x27, 0xbf, 0x15, 0x86, 0xf6, 0xff, 0x2d, 0x99, 0x41, 0x9e, 0x36, 0x1f, 0xe9, 0x3a,
3638 0x99, 0x74, 0x54, 0xf3, 0xc3, 0x08, 0xb1, 0x00, 0x28, 0x84, 0x82, 0x84, 0xe3, 0xf4, 0x32, 0xfd,
3639 0x48, 0x67, 0xae, 0x08, 0x01, 0xe2, 0x08, 0x1d, 0xeb, 0x27, 0xc2, 0x98, 0x45, 0x8b, 0x33, 0x20,
3640 0x3b, 0x21, 0x5c, 0x7f, 0x56, 0xbd, 0xa5, 0x99, 0x58, 0xea, 0x19, 0xf8, 0xbc, 0xf1, 0x9e, 0x39,
3641 0x00, 0xb9, 0x2c, 0x2a, 0xb6, 0x19, 0x3a, 0xaf, 0xea, 0x4b, 0xa6, 0x22, 0xb4, 0x35, 0x09, 0x86,
3642 0x2e, 0x67, 0xe0, 0xfe, 0x81, 0x0e, 0x6a, 0x68, 0x6a, 0xb3, 0x32, 0x3b, 0xf8, 0x89, 0x45, 0x72,
3643 0x69, 0xf1, 0xe1, 0x84, 0xd7, 0xed,
3645 static BYTE ecdh521_pubkey[] =
3647 0x45, 0x43, 0x4b, 0x35, 0x42, 0x00, 0x00, 0x00,
3648 0x00, 0xfd, 0x72, 0xca, 0x31, 0x08, 0x76, 0xd9, 0x08, 0xb7, 0x26, 0x4a, 0x04, 0xbc, 0x73, 0x1a,
3649 0x04, 0xbb, 0x77, 0xf4, 0xe2, 0xfc, 0x3a, 0x88, 0x0a, 0xa8, 0x72, 0x8f, 0xfc, 0xe9, 0xe3, 0x5f,
3650 0x73, 0x05, 0xf1, 0x7f, 0x31, 0xee, 0x15, 0x91, 0x36, 0xe9, 0xeb, 0xed, 0xbe, 0x0e, 0x78, 0xa1,
3651 0x28, 0x4e, 0xc5, 0xcb, 0xba, 0xd8, 0x0c, 0x96, 0x75, 0x44, 0x71, 0x71, 0x00, 0x41, 0x43, 0xdf,
3652 0x27, 0x91, 0x00, 0x81, 0xcc, 0x56, 0x8d, 0x8e, 0x32, 0xae, 0x78, 0xfb, 0x3e, 0x84, 0x7b, 0x3b,
3653 0xf8, 0x8e, 0x7b, 0x27, 0x73, 0xa4, 0x11, 0x61, 0x24, 0x40, 0x9b, 0xbe, 0xd3, 0xc3, 0x0e, 0xbb,
3654 0x26, 0xae, 0x55, 0x58, 0xd1, 0xec, 0x14, 0xd3, 0x13, 0xf2, 0x6b, 0x2b, 0xc3, 0xf9, 0xa4, 0x50,
3655 0x9e, 0xce, 0xfe, 0x18, 0xa0, 0x8b, 0x10, 0x80, 0x68, 0x72, 0x2e, 0x5c, 0xa0, 0xb3, 0x01, 0x6b,
3656 0x43, 0x26, 0xad, 0x58,
3658 static BYTE ecdh521_secret[] =
3660 0x2d, 0xab, 0x9f, 0x38, 0x14, 0x5d, 0x49, 0x65, 0x06, 0x22, 0x04, 0xf9, 0xb3, 0x25, 0xca, 0xf9,
3661 0xe6, 0xdc, 0xc6, 0xe8, 0xf9, 0x0b, 0xbf, 0x3c, 0x9d, 0xf0, 0x08, 0x95, 0x92, 0xdd, 0x92, 0x8a,
3662 0x95, 0x85, 0xe8, 0x1c, 0x6d, 0x41, 0xb9, 0xe4, 0x7b, 0x7a, 0xa5, 0x68, 0x30, 0x48, 0x8e, 0xc0,
3663 0xbc, 0x2b, 0xc6, 0xe9, 0x75, 0x9c, 0xed, 0xc3, 0xf5, 0x3a, 0xa3, 0xd7, 0x41, 0xec, 0x28, 0x82,
3666 static BYTE hashed521_secret[] =
3668 0x72, 0x39, 0x73, 0x5f, 0xc9, 0x26, 0x1f, 0x8e, 0xe3, 0x30, 0x11, 0xe1, 0x4f, 0xc4, 0x65, 0xc0,
3669 0xde, 0xf9, 0xe6, 0x6a,
3671 static BYTE hashed521_secret_prepended[] =
3673 0x2e, 0x6f, 0x51, 0xc9, 0x15, 0xfb, 0x9f, 0xd0, 0xad, 0x92, 0x43, 0xdb, 0xc8, 0x6b, 0xd9, 0xe6,
3674 0x1a, 0x5f, 0x52, 0xa6,
3681 ecdh256_secret,
sizeof(ecdh256_secret), hashed256_secret, hashed256_secret_prepended,
3686 ecdh384_secret,
sizeof(ecdh384_secret), hashed384_secret, hashed384_secret_prepended,
3691 ecdh521_secret,
sizeof(ecdh521_secret), hashed521_secret, hashed521_secret_prepended,
3713 win_skip(
"generic ECDH provider not found\n");
3741 ok(strength == 256,
"got %lu\n", strength);
3767 ok(strength == 253,
"got %lu\n", strength);
3775 ok(
size,
"size not set\n");
3782 ok(
blob->cbKey == 32,
"got %lu\n",
blob->cbKey);
3810 0x44, 0x48, 0x50, 0x42, 0x40, 0x00, 0x00, 0x00,
3812 0xcf, 0x18, 0xe9, 0xa9, 0xb3, 0x97, 0x59, 0xae, 0x0d, 0xac, 0xf0, 0x99, 0x39, 0xdc, 0xd2, 0xfe,
3813 0x1e, 0xf3, 0xfc, 0x2c, 0x49, 0xdf, 0x76, 0x89, 0xff, 0x13, 0x57, 0xc7, 0xe6, 0xbd, 0xed, 0xa7,
3814 0x42, 0xc0, 0xc3, 0xd7, 0x8e, 0x84, 0xa8, 0xdf, 0xcd, 0x52, 0x50, 0x81, 0x73, 0x8a, 0x33, 0x60,
3815 0xde, 0x6d, 0x56, 0xeb, 0xd5, 0xec, 0x1f, 0x9f, 0x9f, 0xd6, 0x2c, 0xe4, 0x8f, 0xab, 0x58, 0x0b,
3817 0x5f, 0xc5, 0x50, 0x9a, 0xde, 0xf6, 0x84, 0x48, 0x39, 0xa9, 0xa7, 0xb1, 0x73, 0x0c, 0x56, 0xd4,
3818 0x28, 0xbb, 0x12, 0x93, 0x51, 0x44, 0x33, 0xdf, 0xa6, 0xe7, 0x7f, 0x0b, 0x3f, 0xe9, 0x41, 0xef,
3819 0x32, 0x80, 0xcd, 0x8e, 0x2b, 0x38, 0x85, 0x49, 0x4d, 0x0c, 0xcc, 0x74, 0x02, 0x07, 0x92, 0xd3,
3820 0xe4, 0x3e, 0x37, 0x84, 0x27, 0x1f, 0xa3, 0xad, 0x94, 0x8c, 0xc1, 0xc2, 0x22, 0x99, 0x36, 0xf0,
3822 0x22, 0xaf, 0x98, 0xeb, 0xd9, 0xc4, 0xb5, 0xbd, 0xe1, 0xab, 0x19, 0x1b, 0xe3, 0x36, 0x20, 0xca,
3823 0xff, 0xe8, 0x6c, 0x30, 0x96, 0x3c, 0x90, 0x77, 0x0e, 0xe0, 0x96, 0xae, 0xb1, 0x47, 0xd1, 0x52,
3824 0x2c, 0xc3, 0x65, 0x5e, 0x9b, 0x41, 0x9a, 0xa6, 0xfe, 0xab, 0x54, 0xa0, 0xf0, 0x71, 0xab, 0x6c,
3825 0xd0, 0x0e, 0x01, 0x08, 0x5b, 0x66, 0xe5, 0x62, 0xd2, 0xe5, 0x5d, 0xae, 0x9c, 0x60, 0xb2, 0xc6,
3831 0x44, 0x48, 0x50, 0x56, 0x40, 0x00, 0x00, 0x00,
3833 0xcf, 0x18, 0xe9, 0xa9, 0xb3, 0x97, 0x59, 0xae, 0x0d, 0xac, 0xf0, 0x99, 0x39, 0xdc, 0xd2, 0xfe,
3834 0x1e, 0xf3, 0xfc, 0x2c, 0x49, 0xdf, 0x76, 0x89, 0xff, 0x13, 0x57, 0xc7, 0xe6, 0xbd, 0xed, 0xa7,
3835 0x42, 0xc0, 0xc3, 0xd7, 0x8e, 0x84, 0xa8, 0xdf, 0xcd, 0x52, 0x50, 0x81, 0x73, 0x8a, 0x33, 0x60,
3836 0xde, 0x6d, 0x56, 0xeb, 0xd5, 0xec, 0x1f, 0x9f, 0x9f, 0xd6, 0x2c, 0xe4, 0x8f, 0xab, 0x58, 0x0b,
3838 0x5f, 0xc5, 0x50, 0x9a, 0xde, 0xf6, 0x84, 0x48, 0x39, 0xa9, 0xa7, 0xb1, 0x73, 0x0c, 0x56, 0xd4,
3839 0x28, 0xbb, 0x12, 0x93, 0x51, 0x44, 0x33, 0xdf, 0xa6, 0xe7, 0x7f, 0x0b, 0x3f, 0xe9, 0x41, 0xef,
3840 0x32, 0x80, 0xcd, 0x8e, 0x2b, 0x38, 0x85, 0x49, 0x4d, 0x0c, 0xcc, 0x74, 0x02, 0x07, 0x92, 0xd3,
3841 0xe4, 0x3e, 0x37, 0x84, 0x27, 0x1f, 0xa3, 0xad, 0x94, 0x8c, 0xc1, 0xc2, 0x22, 0x99, 0x36, 0xf0,
3843 0x22, 0xaf, 0x98, 0xeb, 0xd9, 0xc4, 0xb5, 0xbd, 0xe1, 0xab, 0x19, 0x1b, 0xe3, 0x36, 0x20, 0xca,
3844 0xff, 0xe8, 0x6c, 0x30, 0x96, 0x3c, 0x90, 0x77, 0x0e, 0xe0, 0x96, 0xae, 0xb1, 0x47, 0xd1, 0x52,
3845 0x2c, 0xc3, 0x65, 0x5e, 0x9b, 0x41, 0x9a, 0xa6, 0xfe, 0xab, 0x54, 0xa0, 0xf0, 0x71, 0xab, 0x6c,
3846 0xd0, 0x0e, 0x01, 0x08, 0x5b, 0x66, 0xe5, 0x62, 0xd2, 0xe5, 0x5d, 0xae, 0x9c, 0x60, 0xb2, 0xc6,
3848 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3849 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3850 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x97, 0x71, 0x3e, 0x82,
3851 0x8b, 0xea, 0x11, 0x77, 0xc4, 0xb4, 0x62, 0xc7, 0x4d, 0xff, 0x0f, 0x63, 0xd9, 0xe2, 0xda, 0xab,
3856 0x73, 0x84, 0x62, 0xc1, 0x9a, 0x9c, 0xc2, 0x91, 0x9f, 0xc1, 0xc2, 0x94, 0x0c, 0xa8, 0x2f, 0x58,
3857 0xac, 0x50, 0xcd, 0xd5, 0x29, 0x43, 0x41, 0x8e, 0x5d, 0xca, 0x73, 0x55, 0x4d, 0x46, 0x50, 0xe5,
3858 0xb7, 0x34, 0xa9, 0xcb, 0x3a, 0x18, 0x68, 0x99, 0x30, 0xef, 0x58, 0x26, 0xd3, 0x03, 0x61, 0x02,
3859 0x17, 0xb7, 0xba, 0x01, 0xbc, 0xae, 0xdf, 0x3f, 0xb5, 0xb5, 0x4a, 0xb0, 0x08, 0xe5, 0xea, 0xc3,
3864 0xa7, 0xfc, 0xff, 0x21, 0xb3, 0xd1, 0x46, 0xb8, 0x21, 0x3d, 0xc6, 0xd4, 0xe3, 0x61, 0x97, 0x5e,
3865 0xb5, 0x0a, 0xfe, 0x8f,
3870 0x03, 0x9d, 0x31, 0x52, 0x32, 0xca, 0xfc, 0x12, 0x23, 0x2e, 0x63, 0x0b, 0x7a, 0x1c, 0xaf, 0xee,
3871 0x17, 0xf0, 0x7b, 0xc6,
3946 ok(
size,
"size not set\n");
3964 ok(
size ==
sizeof(*dhkey) + 64 * 4,
"size not set\n");
3987 ok(
size,
"size not set\n");
4003 ok(
size,
"size not set\n");
4027 win_skip(
"BCRYPT_KDF_RAW_SECRET not supported\n");
4106 0x52, 0x53, 0x41, 0x31, 0x00, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
4107 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0xd5, 0xfe, 0xf6, 0x7a, 0x9a, 0xa1, 0x2d, 0xcf, 0x98,
4108 0x60, 0xca, 0x38, 0x60, 0x0b, 0x74, 0x4c, 0x7e, 0xa1, 0x42, 0x64, 0xad, 0x05, 0xa5, 0x29, 0x25, 0xcb, 0xd5,
4109 0x9c, 0xaf, 0x6f, 0x63, 0x85, 0x6d, 0x5b, 0x59, 0xe5, 0x17, 0x8f, 0xf9, 0x18, 0x90, 0xa7, 0x63, 0xae, 0xe0,
4110 0x3a, 0x62, 0xf7, 0x98, 0x57, 0xe9, 0x91, 0xda, 0xfb, 0xd9, 0x36, 0x45, 0xe4, 0x9e, 0x75, 0xf6, 0x73, 0xc4,
4111 0x99, 0x23, 0x21, 0x1b, 0x3d, 0xe1, 0xe0, 0xa6, 0xa0, 0x4a, 0x50, 0x2a, 0xcb, 0x2a, 0x50, 0xf0, 0x8b, 0x70,
4112 0x9c, 0xe4, 0x1a, 0x14, 0x3b, 0xbe, 0x35, 0xa5, 0x5a, 0x91, 0xa3, 0xa1, 0x82, 0xea, 0x84, 0x4d, 0xe8, 0x62,
4113 0x3b, 0x11, 0xec, 0x61, 0x09, 0x6c, 0xfe, 0xb2, 0xcc, 0x4b, 0xa8, 0xff, 0xaf, 0x73, 0x72, 0x05, 0x4e, 0x7e,
4114 0xe5, 0x73, 0xdf, 0x24, 0xcf, 0x7f, 0x5d, 0xaf, 0x8a, 0xf0, 0xd8, 0xcb, 0x08, 0x1e, 0xf2, 0x36, 0x70, 0x8d,
4115 0x1b, 0x9e, 0xc8, 0x98, 0x60, 0x54, 0xeb, 0x45, 0x34, 0x21, 0x43, 0x4d, 0x42, 0x0a, 0x3a, 0x2d, 0x0f, 0x0e,
4116 0xd6, 0x0d, 0xe4, 0x2e, 0x8c, 0x31, 0x87, 0xa8, 0x09, 0x89, 0x61, 0x16, 0xca, 0x5b, 0xbe, 0x76, 0x69, 0xbb,
4117 0xfd, 0x91, 0x63, 0xd2, 0x66, 0x57, 0x08, 0xef, 0xe2, 0x40, 0x67, 0xd7, 0x7f, 0x50, 0x15, 0x42, 0x33, 0x97,
4118 0x54, 0x73, 0x47, 0xe7, 0x9c, 0x14, 0xa8, 0xb0, 0x3d, 0xc9, 0x23, 0xb0, 0x27, 0x3b, 0xe7, 0xdd, 0x5f, 0xd1,
4119 0x4f, 0x31, 0x10, 0x7d, 0xdd, 0x69, 0x8e, 0xde, 0xa3, 0xe8, 0x92, 0x00, 0xfa, 0xa5, 0xa4, 0x40, 0x51, 0x23,
4120 0x82, 0x84, 0xc7, 0xce, 0x19, 0x61, 0x26, 0xf1, 0xae, 0xf3, 0x90, 0x93, 0x98, 0x56, 0x23, 0x9a, 0xd1, 0xbd,
4121 0xf2, 0xdf, 0xfd, 0x13, 0x9c, 0x30, 0x07, 0xf9, 0x5a, 0x2e, 0x00, 0xc6, 0x1f
4127 {0x7e,0xe3,0x74,0xe7,0xc5,0x0b,0x6b,0x70,0xdb,0xab,0x32,0x6d,0x1d,0x51,0xd6,0x74,0x79,0x8e,0x5b,0x4b};
4128 static UCHAR hash_sha256[] =
4129 {0x25,0x2f,0x10,0xc8,0x36,0x10,0xeb,0xca,0x1a,0x05,0x9c,0x0b,0xae,0x82,0x55,0xeb,0xa2,0xf9,0x5b,0xe4,
4130 0xd1,0xd7,0xbC,0xfA,0x89,0xd7,0x24,0x8a,0x82,0xd9,0xf1,0x11};
4173 memset(sig, 0,
sizeof(sig));
4205 memset(sig, 0,
sizeof(sig));
4292 static const UCHAR secret[] = {0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10};
4293 static const UCHAR expect[] = {0xb0,0xcb,0xf5,0x80,0xd4,0xe3,0x55,0x23,0x6e,0x19,0x5b,0xdb,0xfe,0xe0,0x6c,0xd3};
4294 static const UCHAR expect2[] = {0x06,0x0c,0x81,0xab,0xd4,0x28,0x80,0x42,0xce,0x30,0x56,0x17,0x15,0x00,0x9e,0xc1};
4295 static const UCHAR expect3[] = {0x3e,0x99,0xbf,0x02,0xf5,0xd3,0xb8,0x81,0x91,0x4d,0x93,0xea,0xd4,0x92,0x93,0x46};
4296 static UCHAR iv[16],
input[] = {
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'i',
'j',
'k',
'l',
'm',
'n',
'o',
'p'};
4322 memset(output, 0,
sizeof(output));
4330 memset(output, 0,
sizeof(output));
4339 memset(output, 0,
sizeof(output));
4343 ok(!
memcmp(output, expect3,
sizeof(expect3)),
"wrong cipher text\n");
4354 static const UCHAR secret[] = {0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10};
4355 static const UCHAR vector[] = {0x0f,0x0e,0x0d,0x0c,0x0b,0x0a,0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01,0x00};
4356 static const UCHAR expect[] = {0x3e,0xfa,0x1a,0xc8,0x92,0x54,0xe4,0x21,0x1a,0x3d,0xfd,0x42,0x1c,0xc0,0x7d,0x20};
4357 static const UCHAR expect2[] = {0xb0,0xcb,0xf5,0x80,0xd4,0xe3,0x55,0x23,0x6e,0x19,0x5b,0xdb,0xfe,0xe0,0x6c,0xd3};
4358 static UCHAR input[] = {
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'i',
'j',
'k',
'l',
'm',
'n',
'o',
'p'};
4361 UCHAR output[16], iv[16];
4390 memset(output, 0,
sizeof(output));
4401 memset(output, 0,
sizeof(output));
4412 memset(iv, 0,
sizeof(iv));
4413 memset(output, 0,
sizeof(output));
4424 memset(output, 0,
sizeof(output));
4440 {0xda,0x39,0xa3,0xee,0x5e,0x6b,0x4b,0x0d,0x32,0x55,0xbf,0xef,0x95,0x60,0x18,0x90,0xaf,0xd8,0x07,0x09};
4442 {0x9b,0x03,0x17,0x41,0xf4,0x75,0x11,0xac,0xff,0x22,0xee,0x40,0xbb,0xe8,0xf9,0x74,0x17,0x26,0xb6,0xf2,
4443 0xf8,0xc7,0x88,0x02,0x9a,0xdc,0x0d,0xd7,0x83,0x58,0xea,0x65,0x2e,0x8b,0x85,0xc6,0xdb,0xb7,0xed,0x1c};
4520 0x7e,0xe3,0x74,0xe7,0xc5,0x0b,0x6b,0x70,0xdb,0xab,0x32,0x6d,0x1d,0x51,0xd6,0x74,0x79,0x8e,0x5b,0x4b
4525 0x5f,0x95,0x1f,0x08,0x19,0x44,0xa5,0xab,0x28,0x11,0x51,0x68,0x82,0x9b,0xe4,0xc3,0x04,0x1b,0xc9,0xdc,
4526 0x41,0x2a,0x89,0xd4,0x4a,0x8b,0x86,0xaf,0x98,0x2c,0x59,0x0b,0xd2,0x88,0xf6,0xe8,0x29,0x13,0x84,0x49
4531 0x44,0x53,0x50,0x42,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x8f,0xd2,0x92,0xbb,0x92,0xb9,0x00,0xc5,0xed,
4532 0x52,0xcc,0x48,0x4a,0x44,0x1d,0xd3,0x74,0xfb,0x75,0xd1,0x7e,0xb6,0x24,0x9b,0x5d,0x57,0x0a,0x8a,0xc4,
4533 0x5d,0xab,0x9c,0x26,0x86,0xc6,0x25,0x16,0x20,0xf9,0xa9,0x71,0xbc,0x1d,0x30,0xc4,0xef,0x8c,0xc4,0xdf,
4534 0x1a,0xaf,0x96,0xdf,0x90,0xd8,0x85,0x9d,0xf9,0x2c,0x86,0x8c,0x91,0x39,0x6c,0x6d,0x11,0x4e,0x53,0x63,
4535 0x2a,0x2b,0x26,0xa7,0xf9,0x76,0x74,0x51,0xbf,0x08,0x87,0x6f,0xe0,0x71,0x91,0x24,0x8a,0xc2,0x84,0x2d,
4536 0x84,0x9c,0x5f,0x94,0xaa,0x38,0x53,0x77,0x84,0xba,0xbc,0xff,0x49,0x3a,0x08,0x0f,0x38,0xb5,0x91,0x5c,
4537 0x06,0x15,0xa4,0x27,0xf4,0xa5,0x59,0xaa,0x1c,0x41,0xa3,0xa0,0xbb,0xf7,0x32,0x86,0xfb,0x94,0x41,0xff,
4538 0xcd,0xed,0x69,0xeb,0xc6,0x5e,0xb6,0xa8,0x15,0x82,0x3b,0x60,0x1e,0x91,0x55,0xd5,0x2c,0xa5,0x74,0x5a,
4539 0x65,0x8f,0xc6,0x56,0xc4,0x3f,0x4e,0xe3,0x3a,0x71,0xb2,0x63,0x66,0xa4,0x0d,0x0d,0xf9,0xdd,0x1e,0x48,
4540 0x81,0xe9,0xbf,0x8f,0xbb,0x85,0x47,0x81,0x68,0x11,0xb5,0x91,0x6b,0xc4,0x05,0xef,0xa3,0xc7,0xbf,0x26,
4541 0x53,0x4f,0xc4,0x10,0xfd,0xfa,0xed,0x61,0x64,0xd6,0x2e,0xad,0x04,0x3e,0x82,0xed,0xb2,0x22,0x76,0xd0,
4542 0x44,0xad,0xc1,0x4c,0xde,0x33,0xa3,0x61,0x55,0xec,0x24,0xe5,0x79,0x45,0xcf,0x94,0x39,0x92,0x9f,0xd8,
4548 0x07,0x02,0x00,0x00,0x00,0x22,0x00,0x00,0x44,0x53,0x53,0x32,0x00,0x04,0x00,0x00,0x01,0xd1,0xfc,0x7a,
4549 0x70,0x53,0xb2,0x48,0x70,0x23,0x19,0x1f,0x3c,0xe1,0x26,0x14,0x7e,0x9f,0x0f,0x7f,0x33,0x5e,0x2b,0xf7,
4550 0xca,0x01,0x74,0x8c,0xb4,0xfd,0xf6,0x44,0x95,0x35,0x56,0xaa,0x4d,0x62,0x48,0xe2,0xd1,0xa2,0x7e,0x6e,
4551 0xeb,0xd6,0xcc,0x7c,0xe8,0xfd,0x21,0x9a,0xa2,0xfd,0x7a,0x9d,0x1a,0x38,0x69,0x87,0x39,0x5a,0x91,0xc0,
4552 0x52,0x2b,0x9f,0x2a,0x54,0x78,0x37,0x82,0x9a,0x70,0x57,0xab,0xec,0x93,0x8e,0xac,0x73,0x04,0xe8,0x53,
4553 0x72,0x72,0x32,0xc6,0xcb,0xef,0x47,0x98,0x3c,0x56,0x49,0x62,0xcb,0xbb,0xe7,0x34,0x84,0xa6,0x72,0x3a,
4554 0xbe,0x26,0x46,0x86,0xca,0xcb,0x35,0x62,0x4f,0x19,0x18,0x0b,0xb0,0x78,0xae,0xd5,0x42,0xdf,0x26,0xdb,
4555 0x85,0x63,0x77,0x85,0x01,0x3b,0x32,0xbe,0x5c,0xf8,0x05,0xc8,0xde,0x17,0x7f,0xb9,0x03,0x82,0xfa,0xf1,
4556 0x9e,0x32,0x73,0xfa,0x8d,0xea,0xa3,0x30,0x48,0xe2,0xdf,0x5a,0xcb,0x83,0x3d,0xff,0x56,0xe9,0xc0,0x94,
4557 0xf8,0x6d,0xb3,0xaf,0x4a,0x97,0xb9,0x43,0x0e,0xd4,0x28,0x98,0x57,0x2e,0x3a,0xca,0xde,0x6f,0x45,0x0d,
4558 0xfb,0x58,0xec,0x78,0x34,0x2e,0x46,0x4d,0xfe,0x98,0x02,0xbb,0xef,0x07,0x1a,0x13,0xb6,0xc2,0x2c,0x06,
4559 0xd9,0x0c,0xc4,0xb0,0x4c,0x3a,0xfc,0x01,0x63,0xb5,0x5a,0x5d,0x2d,0x9c,0x47,0x04,0x67,0x51,0xf2,0x52,
4560 0xf5,0x82,0x36,0xeb,0x6e,0x66,0x58,0x4c,0x10,0x2c,0x29,0x72,0x4a,0x6f,0x6b,0x6c,0xe0,0x93,0x31,0x42,
4561 0xf6,0xda,0xfa,0x5b,0x22,0x43,0x9b,0x1a,0x98,0x71,0xe7,0x41,0x74,0xe9,0x12,0xa4,0x1f,0x27,0x0a,0x63,
4562 0x94,0x49,0xd7,0xad,0xa5,0xc4,0x5c,0xc3,0xc9,0x70,0xb3,0x7b,0x16,0xb6,0x1d,0xd4,0x09,0xc4,0x9a,0x46,
4563 0x2d,0x0e,0x75,0x07,0x31,0x7b,0xed,0x45,0xcd,0x99,0x84,0x14,0xf1,0x01,0x00,0x00,0x93,0xd5,0xa3,0xe4,
4564 0x34,0x05,0xeb,0x98,0x3b,0x5f,0x2f,0x11,0xa4,0xa5,0xc4,0xff,0xfb,0x22,0x7c,0x54
4572 UCHAR sig[40], schemes;
4590 memset(buf2, 0xcc,
sizeof(buf2));
4615 memset(sig, 0,
sizeof(sig));
4623 ok(
size,
"size not set\n");
4651 ok(
size,
"size not set\n");
4684 static const ULONG dh_private_key[] =
4686 0xc4caf69c, 0x57b4db27, 0x36f7135f, 0x5ccba686, 0xc37b8819, 0x1d35c9b2, 0xbb07a1cf, 0x0c5d1c1b,
4687 0xc79acb10, 0x31dfdabb, 0x702e02b9, 0x1efab345, 0x262a8074, 0x5edf7698, 0x9b9dc630, 0x13c34b93,
4688 0xacbc928b, 0xb79eed8c, 0x7413dce9, 0xa5521280, 0x88d8e695, 0xa310269f, 0xca7c5719, 0xcd0c775b,
4689 0x9a6e2cf2, 0x9e235c51, 0xf49db62d, 0x28e72424, 0x4a44da5a, 0x3d98268d, 0x8e4d2be3, 0x254e44e6,
4691 0x18a67e55, 0x572e13a1, 0x46f81ca8, 0xc331c9b9, 0xf8fe3dd4, 0x8a889e5a, 0x6c0505fd, 0xbd97a121,
4692 0xed2dbd67, 0xf39efa8e, 0x36f9c287, 0xf6bbfa6c, 0x461e42ad, 0x17dc170e, 0xc002dc2e, 0x4813d9a4,
4693 0x0b6fabb8, 0x6a9e1860, 0xa8a8cbd9, 0xb7ed6b5d, 0xabb34d23, 0xf2fbe1fd, 0x8670df1e, 0xba7fa4e6,
4694 0xf7039712, 0x94448f30, 0xe10c812e, 0x3e311976, 0xcfdd72c4, 0xbdbea98f, 0xc9a540d6, 0x89646d57,
4696 0x7ab63b33, 0x03a1e9b6, 0x947f7a9b, 0x5ae59eeb, 0x1d12eb05, 0x3f425d92, 0xe028c6ba, 0xbf90ddc9,
4697 0xb554f55a, 0x7aeb88b6, 0x4a443a5f, 0xbab35111, 0x82c78a0c, 0x298dd482, 0x02937cb1, 0xc94cdc2e,
4698 0x59b010eb, 0x3bbc0a2b, 0xd845fee0, 0x04c1d0db, 0x0c8c9424, 0x1cafd4b2, 0x9aa7aed9, 0x6a478486,
4699 0xa8841fd7, 0xbfeff40a, 0x8fd7bcc5, 0x3bb28977, 0x2b9a7955, 0xa55cd2e4, 0x1b6ad657, 0x067cdf21,
4701 0x06f36920, 0x63280e1b, 0xf17d930f, 0xa06e74a8, 0x463b3a6f, 0x2a464507, 0x93f8a982, 0x8f620a7d,
4702 0xeda32d11, 0x9706a6d4, 0x33dce588, 0x75a1c446, 0x048ab567, 0xd735aafa, 0x806f7c1c, 0xdcb9651a,
4703 0x26acf3b4, 0x45f91cc9, 0x2a0de6fc, 0xf3c03d0c, 0xf5aee0aa, 0x3eeaaf36, 0x18ccee61, 0x83faa783,
4704 0x4b2b5250, 0xf4ccea22, 0x5ac0714b, 0x3f0b2bc6, 0x481b13ce, 0x12040ea7, 0x66e0bbed, 0x158e1a67,
4706 static const ULONG dh_private_key2[] =
4708 0xffffffff, 0xffffffff, 0xa2da0fc9, 0x34c26821, 0x8b62c6c4, 0xd11cdc80, 0x084e0229, 0x74cc678a,
4709 0xa6be0b02, 0x229b133b, 0x79084a51, 0xdd04348e, 0xb31995ef, 0x1b433acd, 0x6d0a2b30, 0x37145ff2,
4710 0x6d35e14f, 0x45c2516d, 0x76b585e4, 0xc67e5e62, 0xe9424cf4, 0x6bed37a6, 0xb65cff0b, 0xedb706f4,
4711 0xfb6b38ee, 0xa59f895a, 0x11249fae, 0xe61f4b7c, 0x51662849, 0x8153e6ec, 0xffffffff, 0xffffffff,
4713 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4714 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4715 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4716 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000000,
4718 0xa0c3c734, 0xc130c92d, 0x5265abf8, 0xff409f17, 0xbcdce187, 0xff64dae3, 0x170560aa, 0xb2423ed8,
4719 0x9ee5a8b9, 0x92548030, 0x02bba1f9, 0x823e39a4, 0x69c438f5, 0xf91016ac, 0x89bfd166, 0x7f996446,
4720 0x86224203, 0x15bf689c, 0x619354a4, 0x0c1d3a1f, 0x11bcf3d2, 0x58aae029, 0x41c69824, 0x3fafc179,
4721 0xa742747c, 0x60658c7a, 0xd3b0bde4, 0x78d3f08b, 0x6cefa061, 0x33752536, 0xe84d4901, 0x48cd73f4,
4723 0x8d449700, 0x1f95120e, 0xceb31745, 0x3663177b, 0xbd9bb2d5, 0x9c23c0d9, 0x814d34f8, 0xbc54edb0,
4724 0xb874659a, 0x3bac8a30, 0xa1f3dd46, 0x1705c900, 0xbc46fefe, 0x7d13875b, 0x3064351a, 0x4bd89a1c,
4725 0x9e938761, 0x931949db, 0x34490719, 0x84fb08ca, 0xa9dd355a, 0x5b3f5061, 0x2ac96663, 0xc594429e,
4726 0xbe58395d, 0x2f7d872a, 0x303d37b3, 0xa3a9b606, 0x735a6732, 0xa095bd95, 0x3d55a7c3, 0x00e54635,
4728 static const ULONG dh_peer_key[] =
4730 0xffffffff, 0xffffffff, 0xa2da0fc9, 0x34c26821, 0x8b62c6c4, 0xd11cdc80, 0x084e0229, 0x74cc678a,
4731 0xa6be0b02, 0x229b133b, 0x79084a51, 0xdd04348e, 0xb31995ef, 0x1b433acd, 0x6d0a2b30, 0x37145ff2,
4732 0x6d35e14f, 0x45c2516d, 0x76b585e4, 0xc67e5e62, 0xe9424cf4, 0x6bed37a6, 0xb65cff0b, 0xedb706f4,
4733 0xfb6b38ee, 0xa59f895a, 0x11249fae, 0xe61f4b7c, 0x51662849, 0x8153e6ec, 0xffffffff, 0xffffffff,
4735 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4736 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4737 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4738 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000000,
4740 0x3bf7404b, 0x6284fffe, 0x97c0d565, 0xd830c658, 0xcc21bf39, 0xcae45bb6, 0x019df7df, 0xbf4cd293,
4741 0x6bf1989d, 0x78a81f52, 0xa4ed861c, 0x6bacf493, 0xa3e700d1, 0xd06cc206, 0x411b9727, 0x01e9c9ab,
4742 0x9b7e6efa, 0xf46bb25d, 0xd1027242, 0x6130787c, 0xa7b87d8b, 0xfee41492, 0x50db6213, 0x321199b6,
4743 0x7dace53a, 0xe8b1ec51, 0x2181b113, 0x3b33e3c0, 0x5b3a2d67, 0xbd34f0c1, 0x7037c542, 0x4a8d5540,
4745 static const ULONG dh_shared_secret_raw[] =
4747 0x375d89b5, 0x35a9c270, 0xfbc5ba82, 0x09eb3069, 0xd50965b0, 0xace510f7, 0x981e8731, 0x80a76115,
4748 0xf386d348, 0xca17b8df, 0x0b0e84ec, 0xf81f756e, 0x5030fa20, 0x03113b71, 0x97b7e879, 0x899b5fae,
4749 0xe6913299, 0x09270076, 0x39bc813a, 0xde3ef070, 0x65ad5b3a, 0x2b7c4ba4, 0x86c98ef9, 0x3236feaf,
4750 0x3e0253f7, 0x0489d2dd, 0x97669a3d, 0x50242fca, 0x5d4aecb1, 0xcf2d805f, 0x2258afff, 0x750e92cd,
4752 static const ULONG dh_shared_secret_raw2[] =
4754 0x0815f37d, 0x19ee74ab, 0x9f63f123, 0xe1b3f10c, 0xbcc9be83, 0xaddf5b9d, 0x28174e72, 0xf8a33825,
4755 0xfc74e47d, 0x2c950888, 0xf5b776d9, 0xfc712fef, 0x5b213b32, 0x489a9829, 0xfc0a4d1d, 0x6e641d3b,
4756 0x3bb2ff57, 0x63500318, 0x081ee54f, 0xf33a2805, 0xb3759e98, 0xa9a64afe, 0x964b8897, 0x04691bbc,
4757 0x80f4aae1, 0x617405ee, 0xab71724d, 0x6c10c214, 0x6f60b96f, 0xdc777b0b, 0x22f40d4f, 0x8a1c4eb5,
4759 static const ULONG dh_shared_secret_sha1[] =
4761 0x0babba9c, 0x0bdeacbd, 0x04e36574, 0xdd504dcd, 0x0cd88db0,
4763 static const ULONG dh_shared_secret_sha256[] =
4765 0x3213db5b, 0x8cc8250b, 0xc829eaab, 0x00933709, 0x68160aa9, 0xfb9f1e20, 0xf92368e6, 0x2b8e18eb,
4922 ok(dh_header->
cbLength ==
sizeof(*dh_header) +
length / 8 * 2,
"Got unexpected length %lu.\n", dh_header->
cbLength);
4932 memcpy(dh_key_blob + 1, dh_private_key,
sizeof(dh_private_key));
4936 size =
sizeof(*dh_key_blob) +
length / 8 * 4;
4952 ok(dh_key_blob->
cbKey ==
length / 8,
"Got unexpected length %lu.\n", dh_key_blob->
cbKey);
4953 ok(!
memcmp(dh_key_blob + 1, dh_private_key,
length / 8 * 3),
"Key data does not match.\n");
4971 ok(dh_key_blob->
cbKey ==
length / 8,
"Got unexpected length %lu.\n", dh_key_blob->
cbKey);
4972 ok(!
memcmp(dh_key_blob + 1, dh_private_key,
length / 8 * 2),
"DH parameters do not match.\n");
4974 "Random public key data matches.\n");
4982 ok(dh_key_blob->
cbKey ==
length / 8,
"Got unexpected length %lu.\n", dh_key_blob->
cbKey);
4983 ok(!
memcmp(dh_key_blob + 1, dh_private_key,
length / 8 * 4),
"Private key data does not match.\n");
5009 ok(
size == 20,
"Got unexpected size %lu.\n",
size);
5019 ok(!
memcmp(
buffer, dh_shared_secret_raw,
size),
"Raw shared secret data does not match.\n");
5025 ok(
size == 20,
"Got unexpected size %lu.\n",
size);
5026 ok(!
memcmp(
buffer, dh_shared_secret_sha1,
sizeof(dh_shared_secret_sha1)),
5027 "sha1 shared secret data does not match.\n");
5032 ok(
size == 32,
"Got unexpected size %lu.\n",
size);
5033 ok(!
memcmp(
buffer, dh_shared_secret_sha256,
sizeof(dh_shared_secret_sha256)),
5034 "sha256 shared secret data does not match.\n");
5067 memcpy(dh_key_blob + 1, dh_private_key2,
sizeof(dh_private_key2));
5069 size =
sizeof(*dh_key_blob) +
length / 8 * 4;
5076 memcpy(dh_key_blob + 1, dh_peer_key,
sizeof(dh_peer_key));
5078 size =
sizeof(*dh_key_blob) +
length / 8 * 3;
5088 ok(!
memcmp(
buffer, dh_shared_secret_raw2,
size),
"Raw shared secret data does not match.\n");
5113 ok(
len,
"expected non-zero len\n");
5132 static char salt[] =
"cCxuHMEHLibcglJOG88dIw==";
5149 (
void *)&iter_count,
5156 pbkdf2_param_buffers,
5158 static UCHAR pbkdf2_hash[] =
5160 0x18, 0xf2, 0x58, 0x0b, 0x92, 0x6e, 0x6d, 0xfe,
5161 0x55, 0xbb, 0x62, 0x87, 0x5b, 0x1f, 0x61, 0x83,
5162 0x4d, 0x16, 0xe4, 0x04, 0xcd, 0xab, 0x43, 0x77,
5163 0x25, 0x3e, 0x1d, 0xb4, 0x95, 0x5f, 0xf7, 0x01,
5175 win_skip(
"PBKDF2 not available\n");
5190 memset(&key_lengths, 0xfe,
sizeof(key_lengths));
5194 ok(
size ==
sizeof(key_lengths),
"got %lu\n",
size);
5214 ok(
buf[0] == pbkdf2_hash[0],
"buf[0] = %x\n",
buf[0]);
5215 ok(
buf[1] ==
'x',
"buf[1] = %x\n",
buf[1]);
5221 ok(!
memcmp(
buf, pbkdf2_hash,
sizeof(pbkdf2_hash)),
5239 0x28,0xd2,0xfd,0xb7,0x19,0x56,0x47,0x9d,0x88,0xd1,0x13,0x50,0x01,0x08,0x40,0x8e,
5240 0xfa,0xb3,0x92,0x80,0xe4,0xe2,0x6a,0x2a,0xd0,0xe6,0xac,0x39,0x80,0x18,0xeb,0x30
5244 0x33,0x63,0x83,0x14,0x8c,0x50,0x48,0x99,0x63,0x7b,0xc0,0x33,0x81,0xb1,0x0e,0x4f,
5245 0x5c,0x27,0xe3,0xe8,0x23,0xa8,0xb3,0xe8,0x52,0x96,0x47,0xa5,0xf8,0xca,0x17,0x24
5247 static UCHAR label[32] =
"label", seed[32] =
"seed",
buf[32];
5281 win_skip(
"BCRYPT_TLS1_1_KDF_ALGORITHM not available\n");
5296 memset(&key_lengths, 0xfe,
sizeof(key_lengths));
5300 ok(
size ==
sizeof(key_lengths),
"got %lu\n",
size);
5321 ok(
buf[1] ==
'x',
"buf[1] = %x\n",
buf[1]);
5349 ok(
buf[1] ==
'x',
"buf[1] = %x\n",
buf[1]);
5378 0x9e,0xc7,0x96,0xeb,0x03,0xf9,0xbd,0xaa,0xfa,0x68,0x90,0x1c,0x7b,0x71,0x20,0xda,
5379 0x88,0xf1,0xc2,0x15,0x07,0xaf,0xc6,0xde,0x1a,0x86,0xb5,0x6e,0x96,0xe9,0x7d,0x7a
5383 0x54,0xe0,0x42,0xd2,0x92,0xc8,0x02,0x02,0x14,0xae,0x57,0xe8,0x7e,0x67,0x32,0xd7,
5384 0x46,0x90,0xca,0x7b,0xef,0x5a,0x62,0x74,0x90,0x8f,0x1e,0x99,0x20,0x04,0x1e,0x27
5386 static const UCHAR expect3[] =
5388 0xb5,0x12,0x7d,0x38,0x03,0x6a,0x64,0xd0,0x76,0xde,0x48,0xe2,0xa0,0x7a,0x4f,0x3d,
5389 0x6f,0xc8,0x55,0xab,0xf5,0x14,0x66,0x5d,0xd6,0x02,0x1c,0x28,0x75,0xe7,0xdc,0x96
5415 win_skip(
"BCRYPT_HKDF_ALGORITHM not available\n");
5430 memset(&key_lengths, 0xfe,
sizeof(key_lengths));
5434 ok(
size ==
sizeof(key_lengths),
"got %lu\n",
size);
5463 ok(
buf[1] ==
'x',
"buf[1] = %x\n",
buf[1]);
5498 ok(
buf[1] ==
'x',
"buf[1] = %x\n",
buf[1]);
5532 ok(
buf[0] == expect3[0],
"buf[0] = %x\n",
buf[0]);
5533 ok(
buf[1] ==
'x',
"buf[1] = %x\n",
buf[1]);
5556 win_skip(
"CHACHA20_POLY1305 not supported\n");
5564 ok(
len,
"expected non-zero len\n");
5588 win_skip(
"bcrypt.dll not found\n");
static unsigned char bytes[4]
#define InterlockedIncrement
static void test_BCryptDecrypt(void)
static void test_HKDF(void)
static void test_key_import_export(void)
static UCHAR long_password[]
static UCHAR rsaFullPrivateBlob[]
static BYTE dh_hashed_secret_prepended[]
static void test_DH(void)
static void test_aes_vector_property(void)
static BYTE cert521Signature[]
static BYTE ecc521Privkey[]
static void test_ECDH(void)
static void test_BCryptEnumAlgorithms(void)
static LONG encrypt_race_start_barrier
static struct @1910 rsaLegacyPrivateBlob
static void test_BCryptGenRandom(void)
static void test_aes_vector(void)
#define test_hash_block_length(a, b)
BCryptBuffer dh_hash_param_buffers_prepended[]
static void test_ECDSA(void)
static void test_BcryptHash(void)
BCryptBufferDesc dh_hash_params
static void test_DSA(void)
static UCHAR dsaSignature[]
static void test_BCryptGetFipsAlgorithmMode(void)
static void test_ECDH_alg(const struct ecdh_test *t)
#define test_alg_name(a, b)
static BYTE certSignature[]
static void test_BCryptSignHash(void)
static UCHAR rsaPrivateBlob[]
static void test_RSA(void)
BCryptBufferDesc dh_hash_params_prepended
static void test_CHACHA20_POLY1305(void)
static void test_BcryptDeriveKeyPBKDF2(void)
static void test_hash(const struct hash_test *test)
static void test_BCryptEnumContextFunctions(void)
static const UCHAR rsa_encrypted_no_padding[]
static void test_rsa_encrypt(void)
static UCHAR rsaPublicBlobWithInvalidPublicExpSize[]
static const struct @1909 rfc6070[]
static UCHAR password_NUL[]
static UCHAR rsaPublicBlob[]
static void _test_alg_name(unsigned line, void *handle, const WCHAR *exname)
#define test_hash_length(a, b)
BCryptBuffer dh_hash_param_buffers[]
static UCHAR dsaPublicBlob[]
static void test_aes(void)
static void test_RSA_SIGN(void)
static void format_hash(const UCHAR *bytes, ULONG size, char *buf)
static const UCHAR hash_prepend[][2]
static void test_BcryptDeriveKeyCapi(void)
static void _test_object_length(unsigned line, void *handle)
static UCHAR rsaSignature[]
static void _test_hash_block_length(unsigned line, void *handle, ULONG exlen)
#define test_object_length(a)
static void test_BCryptEncrypt(void)
static UCHAR legacy_rsa_key[]
static void test_rng(void)
static BYTE dh_hashed_secret[]
static void test_3des(void)
static void test_SecretAgreement(void)
static void test_RC4(void)
static void test_BCryptGenerateSymmetricKey(void)
static void _test_hash_length(unsigned line, void *handle, ULONG exlen)
static DWORD WINAPI encrypt_race_thread(void *parameter)
static void test_hashes(void)
static void test_TLS_PRF(void)
static void test_PBKDF2(void)
#define BCRYPT_KEY_LENGTHS
#define LEGACY_RSAPRIVATE_BLOB
#define BCRYPT_RSAPUBLIC_BLOB
#define BCRYPT_RNG_ALG_HANDLE
#define LEGACY_DSA_V2_PRIVATE_BLOB
#define BCRYPT_HKDF_HASH_ALGORITHM
#define BCRYPT_ECDH_P384_ALGORITHM
#define BCRYPT_SECRET_AGREEMENT_OPERATION
#define BCRYPT_3DES_ALGORITHM
#define BCRYPT_CHAIN_MODE_GCM
#define BCRYPT_SIGNATURE_OPERATION
struct _BCRYPT_DSA_KEY_BLOB BCRYPT_DSA_KEY_BLOB
#define BCRYPT_DH_PUBLIC_MAGIC
#define BCRYPT_ECDH_PRIVATE_P256_MAGIC
#define BCRYPT_KEY_DATA_BLOB_MAGIC
#define BCRYPT_HMAC_SHA1_ALG_HANDLE
#define BCRYPT_ECDSA_PUBLIC_P256_MAGIC
#define BCRYPT_SIGNATURE_LENGTH
#define BCRYPT_ECCPUBLIC_BLOB
#define BCRYPT_RSA_ALGORITHM
#define BCRYPT_ECDH_PUBLIC_P384_MAGIC
#define BCRYPT_HKDF_ALGORITHM
#define BCRYPT_ECDH_P521_ALGORITHM
#define BCRYPT_HASH_BLOCK_LENGTH
#define BCRYPT_OBJECT_LENGTH
#define BCRYPT_RC4_ALGORITHM
#define BCRYPT_ECDSA_ALGORITHM
#define BCRYPT_KEY_LENGTH
#define BCRYPT_AUTH_TAG_LENGTH
#define BCRYPT_CHAINING_MODE
#define BCRYPT_CHAIN_MODE_CFB
#define BCRYPT_CHAIN_MODE_CBC
#define KDF_ITERATION_COUNT
#define BCRYPT_RSA_ALG_HANDLE
#define BCRYPT_KEY_DATA_BLOB
#define BCRYPT_ALGORITHM_NAME
#define BCRYPT_DH_PARAMETERS
#define BCRYPT_DSA_ALGORITHM
#define BCRYPT_KEY_STRENGTH
#define BCRYPT_ECC_CURVE_NAME
#define BCRYPT_ECC_CURVE_25519
#define BCRYPTBUFFER_VERSION
#define BCRYPT_RNG_USE_ENTROPY_IN_BUFFER
#define BCRYPT_DH_ALG_HANDLE
#define BCRYPT_AES_ALGORITHM
#define BCRYPT_PBKDF2_ALGORITHM
#define BCRYPT_ECC_CURVE_BRAINPOOLP256R1
struct _BCRYPT_KEY_DATA_BLOB_HEADER BCRYPT_KEY_DATA_BLOB_HEADER
#define BCRYPT_RSAFULLPRIVATE_MAGIC
#define BCRYPT_BLOCK_LENGTH
#define BCRYPT_PUBLIC_KEY_BLOB
#define BCRYPT_SHA256_ALGORITHM
#define BCRYPT_CHAIN_MODE_NA
#define BCRYPT_RSAPRIVATE_MAGIC
struct _BCRYPT_ECCKEY_BLOB BCRYPT_ECCKEY_BLOB
#define BCRYPT_RSAPRIVATE_BLOB
#define KDF_SECRET_PREPEND
#define BCRYPT_DSA_PUBLIC_BLOB
#define BCRYPT_ECDH_PUBLIC_P256_MAGIC
#define BCRYPT_ALG_HANDLE_HMAC_FLAG
#define BCRYPT_ECCPRIVATE_BLOB
#define KDF_HASH_ALGORITHM
#define BCRYPT_ECDSA_PRIVATE_P521_MAGIC
#define BCRYPT_CIPHER_OPERATION
#define BCRYPT_ECDSA_P256_ALGORITHM
#define BCRYPT_HKDF_PRK_AND_FINALIZE
#define BCRYPT_RNG_ALGORITHM
#define BCRYPT_AES_WRAP_KEY_BLOB
struct _BCRYPT_RSAKEY_BLOB BCRYPT_RSAKEY_BLOB
#define BCRYPT_HKDF_SALT_AND_FINALIZE
#define BCRYPT_ECDSA_P521_ALGORITHM
#define BCRYPT_DSA_PRIVATE_BLOB
#define BCRYPT_HASH_LENGTH
#define BCRYPT_ECDSA_PRIVATE_P256_MAGIC
#define BCRYPT_ECDH_ALGORITHM
#define BCRYPT_KDF_RAW_SECRET
#define BCRYPT_BLOCK_PADDING
#define BCRYPT_MD5_ALG_HANDLE
#define BCRYPT_ECDSA_PUBLIC_P521_MAGIC
#define BCRYPT_AES_GMAC_ALGORITHM
#define BCRYPT_DH_PARAMETERS_MAGIC
#define BCRYPT_RSAPUBLIC_MAGIC
#define BCRYPT_ECDH_PRIVATE_P384_MAGIC
#define BCRYPT_TLS1_2_KDF_ALGORITHM
#define BCRYPT_HASH_REUSABLE_FLAG
#define BCRYPT_KEY_DATA_BLOB_VERSION1
#define BCRYPT_INITIALIZATION_VECTOR
#define BCRYPT_ECC_CURVE_SECP256R1
#define MS_PRIMITIVE_PROVIDER
#define BCRYPT_ECDH_PUBLIC_P521_MAGIC
#define KDF_TLS_PRF_LABEL
#define BCRYPT_DH_PRIVATE_BLOB
#define BCRYPT_ECDH_P256_ALGORITHM
#define BCRYPT_ASYMMETRIC_ENCRYPTION_OPERATION
#define BCRYPT_CHACHA20_POLY1305_ALGORITHM
#define BCRYPT_ECDH_PRIVATE_P521_MAGIC
#define BCRYPT_RSA_SIGN_ALGORITHM
#define BCRYPT_SHA384_ALGORITHM
#define BCRYPT_DSA_PUBLIC_MAGIC
#define BCRYPT_OPAQUE_KEY_BLOB
#define BCRYPT_DH_ALGORITHM
#define BCRYPT_TLS1_1_KDF_ALGORITHM
#define BCRYPT_CHAIN_MODE_ECB
#define BCRYPT_SHA1_ALGORITHM
#define BCRYPT_RSAFULLPRIVATE_BLOB
#define BCRYPT_MESSAGE_BLOCK_LENGTH
#define BCRYPT_AES_CBC_ALG_HANDLE
#define BCRYPT_MD5_ALGORITHM
#define BCRYPT_ECDH_PRIVATE_GENERIC_MAGIC
#define BCRYPT_SHA1_ALG_HANDLE
#define BCRYPT_DH_PUBLIC_BLOB
#define BCRYPT_DH_PRIVATE_MAGIC
#define BCRYPT_USE_SYSTEM_PREFERRED_RNG
#define BCRYPT_ECDSA_P256_ALG_HANDLE
NTSTATUS WINAPI BCryptSecretAgreement(BCRYPT_KEY_HANDLE privkey_handle, BCRYPT_KEY_HANDLE pubkey_handle, BCRYPT_SECRET_HANDLE *ret_handle, ULONG flags)
NTSTATUS WINAPI BCryptGenRandom(BCRYPT_ALG_HANDLE handle, UCHAR *buffer, ULONG count, ULONG flags)
NTSTATUS WINAPI BCryptDuplicateKey(BCRYPT_KEY_HANDLE handle, BCRYPT_KEY_HANDLE *handle_copy, UCHAR *object, ULONG object_len, ULONG flags)
NTSTATUS WINAPI BCryptHashData(BCRYPT_HASH_HANDLE handle, UCHAR *input, ULONG size, ULONG flags)
NTSTATUS WINAPI BCryptGetProperty(BCRYPT_HANDLE handle, const WCHAR *prop, UCHAR *buffer, ULONG count, ULONG *res, ULONG flags)
NTSTATUS WINAPI BCryptCreateHash(BCRYPT_ALG_HANDLE handle, BCRYPT_HASH_HANDLE *ret_handle, UCHAR *object, ULONG object_len, UCHAR *secret, ULONG secret_len, ULONG flags)
NTSTATUS WINAPI BCryptDecrypt(BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG input_len, void *padding, UCHAR *iv, ULONG iv_len, UCHAR *output, ULONG output_len, ULONG *ret_len, ULONG flags)
NTSTATUS WINAPI BCryptImportKeyPair(BCRYPT_ALG_HANDLE handle, BCRYPT_KEY_HANDLE decrypt_key_handle, const WCHAR *type, BCRYPT_KEY_HANDLE *ret_handle, UCHAR *input, ULONG input_len, ULONG flags)
NTSTATUS WINAPI BCryptGenerateKeyPair(BCRYPT_ALG_HANDLE handle, BCRYPT_KEY_HANDLE *ret_handle, ULONG bitlen, ULONG flags)
NTSTATUS WINAPI BCryptDeriveKeyPBKDF2(BCRYPT_ALG_HANDLE handle, UCHAR *pwd, ULONG pwd_len, UCHAR *salt, ULONG salt_len, ULONGLONG iterations, UCHAR *key, ULONG key_len, ULONG flags)
NTSTATUS WINAPI BCryptDestroyHash(BCRYPT_HASH_HANDLE handle)
NTSTATUS WINAPI BCryptGenerateSymmetricKey(BCRYPT_ALG_HANDLE handle, BCRYPT_KEY_HANDLE *ret_handle, UCHAR *object, ULONG object_len, UCHAR *secret, ULONG secret_len, ULONG flags)
NTSTATUS WINAPI BCryptExportKey(BCRYPT_KEY_HANDLE export_key_handle, BCRYPT_KEY_HANDLE encrypt_key_handle, const WCHAR *type, UCHAR *output, ULONG output_len, ULONG *size, ULONG flags)
NTSTATUS WINAPI BCryptEncrypt(BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG input_len, void *padding, UCHAR *iv, ULONG iv_len, UCHAR *output, ULONG output_len, ULONG *ret_len, ULONG flags)
NTSTATUS WINAPI BCryptOpenAlgorithmProvider(BCRYPT_ALG_HANDLE *handle, const WCHAR *id, const WCHAR *implementation, DWORD flags)
NTSTATUS WINAPI BCryptEnumAlgorithms(ULONG type, ULONG *ret_count, BCRYPT_ALGORITHM_IDENTIFIER **ret_list, ULONG flags)
NTSTATUS WINAPI BCryptKeyDerivation(BCRYPT_KEY_HANDLE handle, BCryptBufferDesc *desc, UCHAR *output, ULONG output_len, ULONG *ret_len, ULONG flags)
NTSTATUS WINAPI BCryptSetProperty(BCRYPT_HANDLE handle, const WCHAR *prop, UCHAR *value, ULONG size, ULONG flags)
NTSTATUS WINAPI BCryptFinalizeKeyPair(BCRYPT_KEY_HANDLE handle, ULONG flags)
NTSTATUS WINAPI BCryptDeriveKeyCapi(BCRYPT_HASH_HANDLE handle, BCRYPT_ALG_HANDLE halg, UCHAR *key, ULONG keylen, ULONG flags)
NTSTATUS WINAPI BCryptCloseAlgorithmProvider(BCRYPT_ALG_HANDLE handle, DWORD flags)
NTSTATUS WINAPI BCryptDeriveKey(BCRYPT_SECRET_HANDLE handle, const WCHAR *kdf, BCryptBufferDesc *desc, UCHAR *output, ULONG output_len, ULONG *ret_len, ULONG flags)
NTSTATUS WINAPI BCryptDestroySecret(BCRYPT_SECRET_HANDLE handle)
NTSTATUS WINAPI BCryptVerifySignature(BCRYPT_KEY_HANDLE handle, void *padding, UCHAR *hash, ULONG hash_len, UCHAR *signature, ULONG signature_len, ULONG flags)
NTSTATUS WINAPI BCryptImportKey(BCRYPT_ALG_HANDLE handle, BCRYPT_KEY_HANDLE decrypt_key_handle, const WCHAR *type, BCRYPT_KEY_HANDLE *ret_handle, UCHAR *object, ULONG object_len, UCHAR *input, ULONG input_len, ULONG flags)
NTSTATUS WINAPI BCryptSignHash(BCRYPT_KEY_HANDLE handle, void *padding, UCHAR *hash, ULONG hash_len, UCHAR *signature, ULONG signature_len, ULONG *ret_len, ULONG flags)
NTSTATUS WINAPI BCryptDestroyKey(BCRYPT_KEY_HANDLE handle)
NTSTATUS WINAPI BCryptFinishHash(BCRYPT_HASH_HANDLE handle, UCHAR *output, ULONG size, ULONG flags)
void WINAPI BCryptFreeBuffer(void *buffer)
NTSTATUS WINAPI BCryptGetFipsAlgorithmMode(BOOLEAN *enabled)
NTSTATUS WINAPI BCryptEnumContextFunctions(ULONG table, const WCHAR *ctx, ULONG iface, ULONG *buflen, CRYPT_CONTEXT_FUNCTIONS **buffer)
#define RegCloseKey(hKey)
#define STATUS_INVALID_HANDLE
#define STATUS_NOT_SUPPORTED
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
const char * wine_dbgstr_an(const char *str, int n)
#define GetProcAddress(x, y)
static const WCHAR pubkey[]
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
_ACRTIMP size_t __cdecl strlen(const char *)
_ACRTIMP int __cdecl strcmp(const char *, const char *)
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLsizei GLsizei * length
GLenum const GLfloat * params
GLenum GLenum GLenum input
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
#define InterlockedCompareExchange
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl void winetest_pop_context(void)
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl winetest_push_context(const char *fmt,...) __WINE_PRINTF_ATTR(1
#define memcpy(s1, s2, n)
static struct test_info tests[]
#define expect2(expected1, expected2, got1, got2)
static const WCHAR label[]
#define NCRYPT_SCHANNEL_INTERFACE
#define STATUS_INTERNAL_ERROR
#define STATUS_AUTH_TAG_MISMATCH
#define STATUS_INVALID_BUFFER_SIZE
#define STATUS_INVALID_SIGNATURE
#define STATUS_BUFFER_TOO_SMALL
BYTE * hashed_secret_prepended
SYMCRYPT_AES_EXPANDED_KEY key2
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
#define STATUS_ACCESS_DENIED
#define STATUS_INVALID_PARAMETER
#define HKEY_LOCAL_MACHINE