23#define WIN32_NO_STATUS
102 else win_skip(
"BCryptGenRandom pseudo handles are not available\n");
108 static const WCHAR policyKeyVistaW[] = {
109 'S',
'y',
's',
't',
'e',
'm',
'\\',
110 'C',
'u',
'r',
'r',
'e',
'n',
't',
'C',
'o',
'n',
't',
'r',
'o',
'l',
'S',
'e',
't',
'\\',
111 'C',
'o',
'n',
't',
'r',
'o',
'l',
'\\',
113 'F',
'I',
'P',
'S',
'A',
'l',
'g',
'o',
'r',
'i',
't',
'h',
'm',
'P',
'o',
'l',
'i',
'c',
'y',0};
114 static const WCHAR policyValueVistaW[] = {
'E',
'n',
'a',
'b',
'l',
'e',
'd',0};
115 static const WCHAR policyKeyXPW[] = {
116 'S',
'y',
's',
't',
'e',
'm',
'\\',
117 'C',
'u',
'r',
'r',
'e',
'n',
't',
'C',
'o',
'n',
't',
'r',
'o',
'l',
'S',
'e',
't',
'\\',
118 'C',
'o',
'n',
't',
'r',
'o',
'l',
'\\',
120 static const WCHAR policyValueXPW[] = {
121 'F',
'I',
'P',
'S',
'A',
'l',
'g',
'o',
'r',
'i',
't',
'h',
'm',
'P',
'o',
'l',
'i',
'c',
'y',0};
142 ok(0,
"Neither XP or Vista key is present\n");
150 ret = pBCryptGetFipsAlgorithmMode(
NULL);
165#define test_object_length(a) _test_object_length(__LINE__,a)
197 ok_(__FILE__,
line)(
len != 0xdeadbeef,
"len not set\n");
201#define test_hash_length(a,b) _test_hash_length(__LINE__,a,b)
210 ok_(__FILE__,
line)(
len == exlen,
"len = %u, expected %u\n",
len, exlen);
213#define test_alg_name(a,b) _test_alg_name(__LINE__,a,b)
242 UCHAR buf[512], buf_hmac[1024], hash_buf[128], hmac_hash[128];
250 ok(alg !=
NULL,
"alg not set\n");
265 ret = pBCryptHashData(
hash, (
UCHAR *)
"test",
sizeof(
"test"), 0);
271 memset(hash_buf, 0,
sizeof(hash_buf));
272 ret = pBCryptFinishHash(
hash, hash_buf,
test->hash_size, 0);
277 ret = pBCryptDestroyHash(
hash);
286 ret = pBCryptHashData(
hash, (
UCHAR *)
"test",
sizeof(
"test"), 0);
289 memset(hash_buf, 0,
sizeof(hash_buf));
290 ret = pBCryptFinishHash(
hash, hash_buf,
test->hash_size, 0);
296 ret = pBCryptHashData(
hash, (
UCHAR *)
"tset",
sizeof(
"tset"), 0);
299 memset(hash_buf, 0,
sizeof(hash_buf));
300 ret = pBCryptFinishHash(
hash, hash_buf,
test->hash_size, 0);
305 ret = pBCryptDestroyHash(
hash);
309 ret = pBCryptCloseAlgorithmProvider(alg, 0);
315 ok(alg !=
NULL,
"alg not set\n");
318 len =
sizeof(buf_hmac);
319 ret = pBCryptCreateHash(alg, &
hash, buf_hmac,
len, (
UCHAR *)
"key",
sizeof(
"key"), 0);
323 ret = pBCryptHashData(
hash, (
UCHAR *)
"test",
sizeof(
"test"), 0);
329 memset(hmac_hash, 0,
sizeof(hmac_hash));
330 ret = pBCryptFinishHash(
hash, hmac_hash,
test->hash_size, 0);
335 ret = pBCryptDestroyHash(
hash);
339 len =
sizeof(buf_hmac);
344 ret = pBCryptHashData(
hash, (
UCHAR *)
"test",
sizeof(
"test"), 0);
347 memset(hmac_hash, 0,
sizeof(hmac_hash));
348 ret = pBCryptFinishHash(
hash, hmac_hash,
test->hash_size, 0);
354 ret = pBCryptHashData(
hash, (
UCHAR *)
"tset",
sizeof(
"tset"), 0);
357 memset(hmac_hash, 0,
sizeof(hmac_hash));
358 ret = pBCryptFinishHash(
hash, hmac_hash,
test->hash_size, 0);
363 ret = pBCryptDestroyHash(
hash);
367 ret = pBCryptDestroyHash(
hash);
370 ret = pBCryptDestroyHash(
NULL);
373 ret = pBCryptCloseAlgorithmProvider(alg, 0);
389 ret = pBCryptHashData(
hash, (
UCHAR *)
"test",
sizeof(
"test"), 0);
391 ret = pBCryptFinishHash(
hash, hash_buf, 21, 0);
393 ret = pBCryptFinishHash(
hash, hash_buf, 20, 0);
395 ret = pBCryptDestroyHash(
hash);
405 "961fa64958818f767707072755d7018dcd278e94",
406 "9314f62ff64197143c91fc86de37e9ae776a3fb8",
407 "2472cf65d0e090618d769d3e46f0d9446cf212da",
408 "b2d2ba8cfd714d474cf0d9622cc5d15e1f53d53f",
411 "ceb73749c899693706ede1e30c9929b3fd5dd926163831c2fb8bd41e6efb1126",
412 "ea0938c118a7b15954f41b85195f2b42aec3a9429c63f593cfa65c137ffaa986",
413 "34c1aa473a4468a91d06e7cdbc75bc4f93b830ccfc2a47ffd74e8e6ed29e4c72",
414 "55feb7052060bd99e33f36eb0982c7f4856eb6a84fbefe19a1afd9faafc3af6f",
417 "62b21e90c9022b101671ba1f808f8631a8149f0f12904055839a35c1ca78ae53"
418 "63eed1e743a692d70e0504b0cfd12ef9",
419 "724db7c0bbc51ef1ac3fc793083fc54c0e5c423faec9b11378c01c236b19aaaf"
420 "a45177ad055feaf003968cc40ece44c7",
421 "4b3e6d6ff2da121790ab7e7b9247583e3a7eed2db5bd4dabc680303b1608f37d"
422 "fdc836d96a704c03283bc05b4f6c5eb8",
423 "03e1818e5c165a0e54619e513acb06c393e1a6cb0ddbb4036b5f29617b334642"
424 "e6e0be8b214d8508595b17a8c4b4e7db",
427 "d55ced17163bf5386f2cd9ff21d6fd7fe576a915065c24744d09cfae4ec84ee1"
428 "ef6ef11bfbc5acce3639bab725b50a1fe2c204f8c820d6d7db0df0ecbc49c5ca",
429 "7752d707b54d2b00e7d1c09120d189475b0fd2e31ebb988cf0a01fc8492ddc0b"
430 "3ca9c9ca61d9d7d1fb65ca7665e87f043c1d5bc9f786f8345e951c2d91ac594f",
431 "415fb6b10018ca03b38a1b1399c42ac0be5e8aceddb9a73103f5e543bf2d888f"
432 "2eecf91373941f9315dd730a77937fa92444450fbece86f409d9cb5ec48c6513",
433 "1487bcecba46ae677622fa499e4cb2f0fdf92f6f3427cba76382d537a06e49c3"
434 "3e70a2fc1fc730092bf21128c3704cc6387f6dfbf7e2f9f315bbb894505a1205",
437 "1bb33606ba908912a84221109d29cd7e",
438 "b9a6ad9323b17e2d0cd389dddd6ef78a",
439 "7f05b0638d77f4a27f3a9c4d353cd648",
440 "05980873e6bfdd05dd7b30078de7e42a",
443 "74b5db93c0b41e36ca7074338fc0b637",
444 "a14a9ff2059a8c28f47b01e6bc48a1bf",
445 "bc2e8ac4d8248ed21b8d26227a30ea3a",
446 "b609db0eb4b8669db74f2c20099701e4",
449 "e2a3e68d23ce348b8f68b3079de3d4c9",
450 "bcdd7ca574342aa9db0e212348eacb16",
451 "7bda029b93fa8d817fcc9e13d6bdf092",
452 "dd636ab8e9592c5088e57c37d44c5bb3",
464 "e2a3e68d23ce348b8f68b3079de3d4c9";
465 static const char expected_hmac[] =
466 "7bda029b93fa8d817fcc9e13d6bdf092";
474 win_skip(
"BCryptHash is not available\n");
492 ret = pBCryptCloseAlgorithmProvider(
alg, 0);
496 memset(md5_hmac, 0,
sizeof(md5_hmac));
501 ret = pBCryptHash(
alg, (
UCHAR *)
"key",
sizeof(
"key"), (
UCHAR *)
"test",
sizeof(
"test"), md5_hmac,
sizeof(md5_hmac));
506 ret = pBCryptCloseAlgorithmProvider(
alg, 0);
527static UCHAR dk1[] =
"0c60c80f961f0e71f3a9b524af6012062fe037a6";
528static UCHAR dk2[] =
"ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957";
529static UCHAR dk3[] =
"4b007901b765489abead49d926f721d065a429c1";
530static UCHAR dk4[] =
"364dd6bc200ec7d197f1b85f4a61769010717124";
531static UCHAR dk5[] =
"3d2eec4fe41c849b80c8d83662c0e44a8b291a964cf2f07038";
532static UCHAR dk6[] =
"56fa6aa75548099dcc37d7f03425e0c3";
533static UCHAR dk7[] =
"8754c32c64b0f524fc50c00f788135de";
586 ret = pBCryptCloseAlgorithmProvider(
alg, 0);
624 ret = pBCryptCloseAlgorithmProvider(
alg, 0);
644 ok(
len,
"expected non-zero len\n");
671 memset(&key_lengths, 0,
sizeof(key_lengths));
674 ok(
size ==
sizeof(key_lengths),
"got %u\n",
size);
701 ret = pBCryptCloseAlgorithmProvider(
alg, 0);
734 ok(
len,
"expected non-zero len\n");
761 memset(&key_lengths, 0,
sizeof(key_lengths));
764 ok(
size ==
sizeof(key_lengths),
"got %u\n",
size);
775 ret = pBCryptCloseAlgorithmProvider(
alg, 0);
782 {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f};
784 {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f};
786 {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f};
788 {0xc6,0xa1,0x3b,0x37,0x87,0x8f,0x5b,0x82,0x6f,0x4f,0x81,0x62,0xa1,0xc8,0xd8,0x79};
789 static UCHAR expected2[] =
790 {0xb5,0x8a,0x10,0x64,0xd8,0xac,0xa9,0x9b,0xd9,0xb0,0x40,0x5b,0x85,0x45,0xf5,0xbb};
791 static UCHAR expected3[] =
792 {0xe3,0x7c,0xd3,0x63,0xdd,0x7c,0x87,0xa0,0x9a,0xff,0x0e,0x3e,0x60,0xe0,0x9c,0x82};
795 UCHAR *
buf, ciphertext[16], plaintext[16], ivbuf[16],
mode[64];
809 key = (
void *)0xdeadbeef;
812 ok(
key == (
void *)0xdeadbeef,
"got %p\n",
key);
835 ok(keylen == 128,
"got %u\n", keylen);
877 memcpy(ivbuf, iv,
sizeof(iv));
881 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
884 memcpy(ivbuf, iv,
sizeof(iv));
885 memset(ciphertext, 0,
sizeof(ciphertext));
890 for (
i = 0;
i < 16;
i++)
892 ok(!
memcmp(ivbuf, ciphertext,
sizeof(iv)),
"wrong iv data.\n");
895 memset(ciphertext, 0,
sizeof(ciphertext));
899 ok(!
memcmp(ciphertext, expected2,
sizeof(expected2)),
"wrong data\n");
902 memcpy(ivbuf, iv,
sizeof(iv));
904 memset(ciphertext, 0,
sizeof(ciphertext));
908 ok(!
memcmp(ciphertext, expected3,
sizeof(expected3)),
"wrong data\n");
909 for (
i = 0;
i < 16;
i++)
910 ok(ciphertext[
i] == expected3[
i],
"%u: %02x != %02x\n",
i, ciphertext[
i], expected3[
i]);
911 ok(!
memcmp(ivbuf, ciphertext,
sizeof(iv)),
"wrong iv data.\n");
913 key2 = (
void *)0xdeadbeef;
914 ret = pBCryptDuplicateKey(
NULL, &key2,
NULL, 0, 0);
916 ok(key2 == (
void *)0xdeadbeef,
"got %p\n", key2);
924 key2 = (
void *)0xdeadbeef;
925 ret = pBCryptDuplicateKey(
key, &key2,
NULL, 0, 0);
931 memcpy(ivbuf, iv,
sizeof(iv));
932 memset(ciphertext, 0,
sizeof(ciphertext));
933 ret = pBCryptEncrypt(key2,
data, 16,
NULL, ivbuf, 16, ciphertext, 16, &
size, 0);
937 for (
i = 0;
i < 16;
i++)
939 ok(!
memcmp(ivbuf, ciphertext,
sizeof(iv)),
"wrong iv data.\n");
941 ret = pBCryptDestroyKey(key2);
951 memcpy(ivbuf, iv,
sizeof(iv));
957 memcpy(ivbuf, iv,
sizeof(iv));
958 memset(plaintext, 0,
sizeof(plaintext));
959 ret = pBCryptDecrypt(
key, ciphertext, 16,
NULL, ivbuf, 16, plaintext, 16, &
size, 0);
963 ok(!
memcmp(ivbuf, ciphertext,
sizeof(iv)),
"wrong iv data.\n");
978 memset(&key_lengths, 0,
sizeof(key_lengths));
981 ok(
size ==
sizeof(key_lengths),
"got %u\n",
size);
986 ret = pBCryptDestroyKey(
key);
993 ret = pBCryptDestroyKey(
key);
998 ret = pBCryptCloseAlgorithmProvider(aes, 0);
1002#define RACE_TEST_COUNT 200
1007 static UCHAR nonce[] =
1008 {0x11,0x20,0x30,0x40,0x50,0x60,0x10,0x20,0x30,0x40,0x50,0x60};
1009 static UCHAR auth_data[] =
1010 {0x61,0x50,0x40,0x30,0x20,0x10,0x60,0x50,0x40,0x30,0x20,0x10};
1012 {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
1013 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10};
1014 static UCHAR expected4[] =
1015 {0xb2,0x27,0x19,0x09,0xc7,0x89,0xdc,0x52,0x24,0x83,0x3a,0x55,0x34,0x76,0x2c,0xbf,
1016 0x15,0xa1,0xcb,0x40,0x78,0x11,0xba,0xbc,0xa4,0x76,0x69,0x7c,0x75,0x4f,0x11,0xba};
1017 static UCHAR expected_tag3[] =
1018 {0xef,0xee,0x75,0x99,0xb8,0x12,0xe9,0xf0,0xb4,0xcc,0x65,0x11,0x67,0x60,0x2d,0xe6};
1023 unsigned int i,
test;
1027 memset(&auth_info, 0,
sizeof(auth_info));
1028 auth_info.
cbSize =
sizeof(auth_info);
1031 auth_info.
cbNonce =
sizeof(nonce);
1044 memset(ciphertext, 0xff,
sizeof(ciphertext));
1049 ok(!
memcmp(ciphertext, expected4,
sizeof(expected4)),
"wrong data\n");
1050 ok(!
memcmp(
tag, expected_tag3,
sizeof(expected_tag3)),
"wrong tag\n");
1051 for (
i = 0;
i < 32;
i++)
1052 ok(ciphertext[
i] == expected4[
i],
"%u: %02x != %02x\n",
i, ciphertext[
i], expected4[
i]);
1053 for (
i = 0;
i < 16;
i++)
1054 ok(
tag[
i] == expected_tag3[
i],
"%u: %02x != %02x\n",
i,
tag[
i], expected_tag3[
i]);
1062 static UCHAR nonce[] =
1063 {0x10,0x20,0x30,0x40,0x50,0x60,0x10,0x20,0x30,0x40,0x50,0x60};
1064 static UCHAR auth_data[] =
1065 {0x60,0x50,0x40,0x30,0x20,0x10,0x60,0x50,0x40,0x30,0x20,0x10};
1067 {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f};
1068 static UCHAR secret256[] =
1069 {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
1070 0x0f,0x0e,0x0d,0x0c,0x0b,0x0a,0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01,0x00};
1072 {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f};
1074 {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10};
1076 {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
1077 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10};
1079 {0xc6,0xa1,0x3b,0x37,0x87,0x8f,0x5b,0x82,0x6f,0x4f,0x81,0x62,0xa1,0xc8,0xd8,0x79};
1080 static UCHAR expected2[] =
1081 {0xc6,0xa1,0x3b,0x37,0x87,0x8f,0x5b,0x82,0x6f,0x4f,0x81,0x62,0xa1,0xc8,0xd8,0x79,
1082 0x28,0x73,0x3d,0xef,0x84,0x8f,0xb0,0xa6,0x5d,0x1a,0x51,0xb7,0xec,0x8f,0xea,0xe9};
1083 static UCHAR expected3[] =
1084 {0xc6,0xa1,0x3b,0x37,0x87,0x8f,0x5b,0x82,0x6f,0x4f,0x81,0x62,0xa1,0xc8,0xd8,0x79,
1085 0xb1,0xa2,0x92,0x73,0xbe,0x2c,0x42,0x07,0xa5,0xac,0xe3,0x93,0x39,0x8c,0xb6,0xfb,
1086 0x87,0x5d,0xea,0xa3,0x7e,0x0f,0xde,0xfa,0xd9,0xec,0x6c,0x4e,0x3c,0x76,0x86,0xe4};
1087 static UCHAR expected4[] =
1088 {0xe1,0x82,0xc3,0xc0,0x24,0xfb,0x86,0x85,0xf3,0xf1,0x2b,0x7d,0x09,0xb4,0x73,0x67,
1089 0x86,0x64,0xc3,0xfe,0xa3,0x07,0x61,0xf8,0x16,0xc9,0x78,0x7f,0xe7,0xb1,0xc4,0x94};
1090 static UCHAR expected5[] =
1091 {0x0a,0x94,0x0b,0xb5,0x41,0x6e,0xf0,0x45,0xf1,0xc3,0x94,0x58,0xc6,0x53,0xea,0x5a};
1092 static UCHAR expected6[] =
1093 {0x0a,0x94,0x0b,0xb5,0x41,0x6e,0xf0,0x45,0xf1,0xc3,0x94,0x58,0xc6,0x53,0xea,0x5a,
1094 0x84,0x07,0x66,0xb7,0x49,0xc0,0x9b,0x49,0x74,0x28,0x8c,0x10,0xb9,0xc2,0x09,0x70};
1095 static UCHAR expected7[] =
1096 {0x0a,0x94,0x0b,0xb5,0x41,0x6e,0xf0,0x45,0xf1,0xc3,0x94,0x58,0xc6,0x53,0xea,0x5a,
1097 0x95,0x4f,0x64,0xf2,0xe4,0xe8,0x6e,0x9e,0xee,0x82,0xd2,0x02,0x16,0x68,0x48,0x99,
1098 0x95,0x4f,0x64,0xf2,0xe4,0xe8,0x6e,0x9e,0xee,0x82,0xd2,0x02,0x16,0x68,0x48,0x99};
1099 static UCHAR expected8[] =
1100 {0xb5,0x8a,0x10,0x64,0xd8,0xac,0xa9,0x9b,0xd9,0xb0,0x40,0x5b,0x85,0x45,0xf5,0xbb};
1101 static UCHAR expected9[] =
1102 {0x0a,0x94,0x0b,0xb5,0x41,0x6e,0xf0,0x45,0xf1,0xc3,0x94,0x58,0xc6,0x53,0xea,0x5a};
1103 static UCHAR expected10[] =
1104 {0x66,0xb8,0xbd,0xe5,0x90,0x6c,0xec,0xdf,0xfa,0x8a,0xb2,0xfd,0x92,0x84,0xeb,0xf0,
1105 0x95,0xc4,0xdf,0xa7,0x7a,0x62,0xe4,0xab,0xd4,0x0e,0x94,0x4e,0xd7,0x6e,0xa1,0x47,
1106 0x29,0x4b,0x37,0xfe,0x28,0x6d,0x5f,0x69,0x46,0x30,0x73,0xc0,0xaa,0x42,0xe4,0x46};
1107 static UCHAR expected11[] =
1108 {0x0a,0x22,0xf7,0x96,0xe1,0xb9,0x3e,0x90,0x32,0xcf,0xf8,0x04,0x83,0x8a,0xdf,0xc3};
1109 static UCHAR expected12[] =
1110 {0xb5,0x9d,0xe7,0x8e,0x0f,0x80,0x16,0xc3,0xf6,0x80,0xad,0xf8,0xac,0xef,0xf9,0x9f};
1111 static UCHAR expected13[] =
1112 {0xc6,0x41,0x37,0xd8,0x6f,0x65,0x64,0x1d,0x2b,0xa0,0xad,0xee,0x67,0xba,0x9b,0x5f};
1113 static UCHAR expected14[] =
1114 {0x0a,0x22,0xf7,0x96,0xe1,0xb9,0x3e,0x90,0x32,0xcf,0xf8,0x04,0x83,0x8a,0xdf,0xc3,
1115 0xa5,0xfa,0x54,0xd7,0x62,0x9d,0x8b,0x11,0x3d,0xd8,0xe2,0x95,0xc2,0x23,0x3f,0x29};
1116 static UCHAR expected15[] =
1117 {0x0a,0x22,0xf7,0x96,0xe1,0xb9,0x3e,0x90,0x32,0xcf,0xf8,0x04,0x83,0x8a,0xdf,0xc3,
1118 0xa5,0xe5,0xcd,0x29,0x48,0x37,0x3f,0x92,0x6f,0x09,0x84,0x5a,0xb8,0x88,0xda,0xfd,
1119 0x65,0x00,0x20,0x9a,0xc6,0xdb,0xfa,0x82,0xdb,0xbc,0xf4,0x70,0x7d,0x88,0x86,0xb5};
1120 static UCHAR expected16[] =
1121 {0x64,0xff,0xc6,0x97,0x14,0x5e,0x21,0xfa,0xe8,0x6e,0xba,0xc1,0x0c,0xb1,0x72,0x64,
1122 0x5d,0xf0,0x22,0x72,0xef,0x39,0xe3,0x2f,0x80,0x3e,0x53,0x00,0xc1,0xcf,0x3f,0xbb,
1123 0xea,0x30,0x01,0x78,0x3b,0xba,0x4d,0xca,0xa0,0x2e,0x83,0x5e,0x0e,0xe2,0x65,0xcb};
1124 static UCHAR expected_tag[] =
1125 {0x89,0xb3,0x92,0x00,0x39,0x20,0x09,0xb4,0x6a,0xd6,0xaf,0xca,0x4b,0x5b,0xfd,0xd0};
1126 static UCHAR expected_tag2[] =
1127 {0x9a,0x92,0x32,0x2c,0x61,0x2a,0xae,0xef,0x66,0x2a,0xfb,0x55,0xe9,0x48,0xdf,0xbd};
1128 static UCHAR expected_tag3[] =
1129 {0x17,0x9d,0xc0,0x7a,0xf0,0xcf,0xaa,0xd5,0x1c,0x11,0xc4,0x4b,0xd6,0xa3,0x3e,0x77};
1130 static UCHAR expected_tag4[] =
1131 {0x4c,0x42,0x83,0x9e,0x8d,0x40,0xf1,0x19,0xd6,0x2b,0x1c,0x66,0x03,0x2b,0x39,0x63};
1162 memcpy(ivbuf, iv,
sizeof(iv));
1166 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
1169 memcpy(ivbuf, iv,
sizeof(iv));
1170 memset(ciphertext, 0,
sizeof(ciphertext));
1175 for (
i = 0;
i < 16;
i++)
1177 ok(!
memcmp(ivbuf, ciphertext,
sizeof(iv)),
"wrong iv data.\n");
1181 memset(ciphertext, 0,
sizeof(ciphertext));
1185 ok(!
memcmp(ciphertext, expected8,
sizeof(expected8)),
"wrong data\n");
1189 memset(ciphertext, 0,
sizeof(ciphertext));
1190 memset(ivbuf, 0,
sizeof(ivbuf));
1194 ok(!
memcmp(ciphertext, expected9,
sizeof(expected9)),
"wrong data\n");
1195 for (
i = 0;
i < 16;
i++)
1196 ok(ciphertext[
i] == expected9[
i],
"%u: %02x != %02x\n",
i, ciphertext[
i], expected9[
i]);
1197 ok(!
memcmp(ivbuf, ciphertext,
sizeof(iv)),
"wrong iv data.\n");
1201 memcpy(ivbuf, iv,
sizeof(iv));
1208 memcpy(ivbuf, iv,
sizeof(iv));
1212 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
1215 memcpy(ivbuf, iv,
sizeof(iv));
1216 memset(ciphertext, 0,
sizeof(ciphertext));
1220 ok(!
memcmp(ciphertext, expected2,
sizeof(expected2)),
"wrong data\n");
1221 for (
i = 0;
i < 32;
i++)
1222 ok(ciphertext[
i] == expected2[
i],
"%u: %02x != %02x\n",
i, ciphertext[
i], expected2[
i]);
1223 ok(!
memcmp(ivbuf, ciphertext + 32 - 16,
sizeof(iv)),
"wrong iv data.\n");
1227 memcpy(ivbuf, iv,
sizeof(iv));
1231 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
1234 memcpy(ivbuf, iv,
sizeof(iv));
1235 memset(ciphertext, 0,
sizeof(ciphertext));
1239 ok(!
memcmp(ciphertext, expected3,
sizeof(expected3)),
"wrong data\n");
1240 for (
i = 0;
i < 48;
i++)
1241 ok(ciphertext[
i] == expected3[
i],
"%u: %02x != %02x\n",
i, ciphertext[
i], expected3[
i]);
1242 ok(!
memcmp(ivbuf, ciphertext + 48 - 16,
sizeof(iv)),
"wrong iv data.\n");
1246 memcpy(ivbuf, iv,
sizeof(iv));
1247 memset(ciphertext, 0,
sizeof(ciphertext));
1253 memcpy(ivbuf, iv,
sizeof(iv));
1254 memset(ciphertext, 0,
sizeof(ciphertext));
1259 ret = pBCryptDestroyKey(
key);
1266 ret = pBCryptGenerateSymmetricKey(aes, &
key,
buf,
len, secret256,
sizeof(secret256), 0);
1268 ret = pBCryptDestroyKey(
key);
1273 ret = pBCryptGenerateSymmetricKey(aes, &
key,
buf,
len, secret256,
sizeof(secret256) + 1, 0);
1277 memcpy(ivbuf, iv,
sizeof(iv));
1281 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
1284 memcpy(ivbuf, iv,
sizeof(iv));
1285 memset(ciphertext, 0,
sizeof(ciphertext));
1289 ok(!
memcmp(ciphertext, expected10,
sizeof(expected10)),
"wrong data\n");
1290 for (
i = 0;
i < 48;
i++)
1291 ok(ciphertext[
i] == expected10[
i],
"%u: %02x != %02x\n",
i, ciphertext[
i], expected10[
i]);
1292 ok(!
memcmp(ivbuf, ciphertext + 48 - 16,
sizeof(iv)),
"wrong iv data.\n");
1294 ret = pBCryptDestroyKey(
key);
1312 ok(
size ==
sizeof(tag_length),
"got %u\n",
size);
1315 memset(&tag_length, 0,
sizeof(tag_length));
1318 ok(
size ==
sizeof(tag_length),
"got %u\n",
size);
1337 memset(&auth_info, 0,
sizeof(auth_info));
1338 auth_info.
cbSize =
sizeof(auth_info);
1341 auth_info.
cbNonce =
sizeof(nonce);
1347 memcpy(ivbuf, iv,
sizeof(iv));
1348 memset(ciphertext, 0xff,
sizeof(ciphertext));
1350 ret = pBCryptEncrypt(
key,
data2, 32, &auth_info, ivbuf, 16, ciphertext, 32, &
size, 0);
1353 ok(!
memcmp(ciphertext, expected4,
sizeof(expected4)),
"wrong data\n");
1354 ok(!
memcmp(
tag, expected_tag,
sizeof(expected_tag)),
"wrong tag\n");
1355 for (
i = 0;
i < 32;
i++)
1356 ok(ciphertext[
i] == expected4[
i],
"%u: %02x != %02x\n",
i, ciphertext[
i], expected4[
i]);
1357 for (
i = 0;
i < 16;
i++)
1358 ok(
tag[
i] == expected_tag[
i],
"%u: %02x != %02x\n",
i,
tag[
i], expected_tag[
i]);
1359 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
1363 memset(ciphertext, 0xff,
sizeof(ciphertext));
1368 ok(!
memcmp(ciphertext, expected4,
sizeof(expected4)),
"wrong data\n");
1369 ok(!
memcmp(
tag, expected_tag,
sizeof(expected_tag)),
"wrong tag\n");
1370 for (
i = 0;
i < 32;
i++)
1371 ok(ciphertext[
i] == expected4[
i],
"%u: %02x != %02x\n",
i, ciphertext[
i], expected4[
i]);
1372 for (
i = 0;
i < 16;
i++)
1373 ok(
tag[
i] == expected_tag[
i],
"%u: %02x != %02x\n",
i,
tag[
i], expected_tag[
i]);
1377 memset(ciphertext, 0xff,
sizeof(ciphertext));
1379 memset(ivbuf, 0,
sizeof(ivbuf));
1380 ret = pBCryptEncrypt(
key,
data2, 32, &auth_info, ivbuf, 16, ciphertext, 32, &
size, 0);
1383 ok(!
memcmp(ciphertext, expected4,
sizeof(expected4)),
"wrong data\n");
1384 ok(!
memcmp(
tag, expected_tag,
sizeof(expected_tag)),
"wrong tag\n");
1385 for (
i = 0;
i < 32;
i++)
1386 ok(ciphertext[
i] == expected4[
i],
"%u: %02x != %02x\n",
i, ciphertext[
i], expected4[
i]);
1387 for (
i = 0;
i < 16;
i++)
1388 ok(
tag[
i] == expected_tag[
i],
"%u: %02x != %02x\n",
i,
tag[
i], expected_tag[
i]);
1389 memset(ciphertext, 0,
sizeof(iv));
1390 ok(!
memcmp(ivbuf, ciphertext,
sizeof(iv)),
"wrong iv data.\n");
1394 memcpy(ivbuf, iv,
sizeof(iv));
1395 memset(ciphertext, 0xff,
sizeof(ciphertext));
1397 ret = pBCryptEncrypt(
key,
data2, 24, &auth_info, ivbuf, 16, ciphertext, 24, &
size, 0);
1400 ok(!
memcmp(ciphertext, expected4, 24),
"wrong data\n");
1401 ok(!
memcmp(
tag, expected_tag2,
sizeof(expected_tag2)),
"wrong tag\n");
1402 for (
i = 0;
i < 24;
i++)
1403 ok(ciphertext[
i] == expected4[
i],
"%u: %02x != %02x\n",
i, ciphertext[
i], expected4[
i]);
1404 for (
i = 0;
i < 16;
i++)
1405 ok(
tag[
i] == expected_tag2[
i],
"%u: %02x != %02x\n",
i,
tag[
i], expected_tag2[
i]);
1406 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
1413 memcpy(ivbuf, iv,
sizeof(iv));
1414 memset(ciphertext, 0xff,
sizeof(ciphertext));
1416 ret = pBCryptEncrypt(
key,
data2, 32, &auth_info, ivbuf, 16, ciphertext, 32, &
size, 0);
1419 ok(!
memcmp(ciphertext, expected4,
sizeof(expected4)),
"wrong data\n");
1420 ok(!
memcmp(
tag, expected_tag3,
sizeof(expected_tag3)),
"wrong tag\n");
1421 for (
i = 0;
i < 32;
i++)
1422 ok(ciphertext[
i] == expected4[
i],
"%u: %02x != %02x\n",
i, ciphertext[
i], expected4[
i]);
1423 for (
i = 0;
i < 16;
i++)
1424 ok(
tag[
i] == expected_tag3[
i],
"%u: %02x != %02x\n",
i,
tag[
i], expected_tag3[
i]);
1425 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
1431 for (
i = 0;
i < 16;
i++)
1432 ok(
tag[
i] == 0xff,
"%u: %02x != %02x\n",
i,
tag[
i], 0xff);
1438 ok(!
memcmp(
tag, expected_tag4,
sizeof(expected_tag4)),
"wrong tag\n");
1439 for (
i = 0;
i < 16;
i++)
1440 ok(
tag[
i] == expected_tag4[
i],
"%u: %02x != %02x\n",
i,
tag[
i], expected_tag4[
i]);
1443 memcpy(ivbuf, iv,
sizeof(iv));
1444 memset(ciphertext, 0,
sizeof(ciphertext));
1448 memcpy(ivbuf, iv,
sizeof(iv));
1449 memset(ciphertext, 0,
sizeof(ciphertext));
1464 memset(ciphertext, 0xff,
sizeof(ciphertext));
1469 ok(!
memcmp(ciphertext, expected4,
sizeof(expected4)),
"wrong data\n");
1470 ok(!
memcmp(
tag, expected_tag3,
sizeof(expected_tag2)),
"wrong tag\n");
1471 for (
i = 0;
i < 32;
i++)
1472 ok(ciphertext[
i] == expected4[
i],
"%u: %02x != %02x\n",
i, ciphertext[
i], expected4[
i]);
1473 for (
i = 0;
i < 16;
i++)
1474 ok(
tag[
i] == expected_tag3[
i],
"%u: %02x != %02x\n",
i,
tag[
i], expected_tag3[
i]);
1479 ret = pBCryptDestroyKey(
key);
1501 memcpy(ivbuf, iv,
sizeof(iv));
1513 memset(ciphertext, 0,
sizeof(ciphertext));
1517 ok(!
memcmp(ciphertext, expected5,
sizeof(expected5)),
"wrong data\n");
1518 for (
i = 0;
i < 16;
i++)
1519 ok(ciphertext[
i] == expected5[
i],
"%u: %02x != %02x\n",
i, ciphertext[
i], expected5[
i]);
1534 memset(ciphertext, 0,
sizeof(ciphertext));
1538 ok(!
memcmp(ciphertext, expected6,
sizeof(expected6)),
"wrong data\n");
1539 for (
i = 0;
i < 32;
i++)
1540 ok(ciphertext[
i] == expected6[
i],
"%u: %02x != %02x\n",
i, ciphertext[
i], expected6[
i]);
1549 memset(ciphertext, 0,
sizeof(ciphertext));
1553 ok(!
memcmp(ciphertext, expected7,
sizeof(expected7)),
"wrong data\n");
1554 for (
i = 0;
i < 48;
i++)
1555 ok(ciphertext[
i] == expected7[
i],
"%u: %02x != %02x\n",
i, ciphertext[
i], expected7[
i]);
1559 memset(ciphertext, 0,
sizeof(ciphertext));
1565 memset(ciphertext, 0,
sizeof(ciphertext));
1570 ret = pBCryptDestroyKey(
key);
1589 memcpy(ivbuf, iv,
sizeof(iv));
1593 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
1596 memcpy(ivbuf, iv,
sizeof(iv));
1597 memset(ciphertext, 0,
sizeof(ciphertext));
1601 ok(!
memcmp(ciphertext, expected11,
sizeof(expected11)),
"wrong data\n");
1602 for (
i = 0;
i < 16;
i++)
1603 ok(ciphertext[
i] == expected11[
i],
"%u: %02x != %02x\n",
i, ciphertext[
i], expected11[
i]);
1604 ok(!
memcmp(ivbuf, ciphertext,
sizeof(iv)),
"wrong iv data.\n");
1608 memset(ciphertext, 0,
sizeof(ciphertext));
1612 ok(!
memcmp(ciphertext, expected12,
sizeof(expected12)),
"wrong data\n");
1616 memset(ciphertext, 0,
sizeof(ciphertext));
1617 memset(ivbuf, 0,
sizeof(ivbuf));
1621 ok(!
memcmp(ciphertext, expected13,
sizeof(expected13)),
"wrong data\n");
1622 for (
i = 0;
i < 16;
i++)
1623 ok(ciphertext[
i] == expected13[
i],
"%u: %02x != %02x\n",
i, ciphertext[
i], expected13[
i]);
1624 ok(!
memcmp(ivbuf, ciphertext,
sizeof(iv)),
"wrong iv data.\n");
1628 memcpy(ivbuf, iv,
sizeof(iv));
1635 memcpy(ivbuf, iv,
sizeof(iv));
1639 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
1642 memcpy(ivbuf, iv,
sizeof(iv));
1643 memset(ciphertext, 0,
sizeof(ciphertext));
1647 ok(!
memcmp(ciphertext, expected14,
sizeof(expected14)),
"wrong data\n");
1648 for (
i = 0;
i < 32;
i++)
1649 ok(ciphertext[
i] == expected14[
i],
"%u: %02x != %02x\n",
i, ciphertext[
i], expected14[
i]);
1650 ok(!
memcmp(ivbuf, ciphertext + 32 - 16,
sizeof(iv)),
"wrong iv data.\n");
1654 memcpy(ivbuf, iv,
sizeof(iv));
1660 memcpy(ivbuf, iv,
sizeof(iv));
1661 memset(ciphertext, 0,
sizeof(ciphertext));
1665 ok(!
memcmp(ciphertext, expected15,
sizeof(expected15)),
"wrong data\n");
1666 for (
i = 0;
i < 48;
i++)
1667 ok(ciphertext[
i] == expected15[
i],
"%u: %02x != %02x\n",
i, ciphertext[
i], expected15[
i]);
1668 ok(!
memcmp(ivbuf, ciphertext + 48 - 16,
sizeof(iv)),
"wrong iv data.\n");
1672 memcpy(ivbuf, iv,
sizeof(iv));
1673 memset(ciphertext, 0,
sizeof(ciphertext));
1677 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
1680 memcpy(ivbuf, iv,
sizeof(iv));
1681 memset(ciphertext, 0,
sizeof(ciphertext));
1685 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
1687 ret = pBCryptDestroyKey(
key);
1694 ret = pBCryptGenerateSymmetricKey(aes, &
key,
buf,
len, secret256,
sizeof(secret256), 0);
1696 ret = pBCryptDestroyKey(
key);
1701 ret = pBCryptGenerateSymmetricKey(aes, &
key,
buf,
len, secret256,
sizeof(secret256) + 1, 0);
1705 memcpy(ivbuf, iv,
sizeof(iv));
1709 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
1712 memcpy(ivbuf, iv,
sizeof(iv));
1713 memset(ciphertext, 0,
sizeof(ciphertext));
1717 ok(!
memcmp(ciphertext, expected16,
sizeof(expected16)),
"wrong data\n");
1718 for (
i = 0;
i < 48;
i++)
1719 ok(ciphertext[
i] == expected16[
i],
"%u: %02x != %02x\n",
i, ciphertext[
i], expected16[
i]);
1720 ok(!
memcmp(ivbuf, ciphertext + 48 - 16,
sizeof(iv)),
"wrong iv data.\n");
1722 ret = pBCryptCloseAlgorithmProvider(aes, 0);
1728 static UCHAR nonce[] =
1729 {0x10,0x20,0x30,0x40,0x50,0x60,0x10,0x20,0x30,0x40,0x50,0x60};
1730 static UCHAR auth_data[] =
1731 {0x60,0x50,0x40,0x30,0x20,0x10,0x60,0x50,0x40,0x30,0x20,0x10};
1733 {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f};
1735 {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f};
1737 {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f};
1738 static UCHAR expected2[] =
1739 {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10};
1740 static UCHAR expected3[] =
1741 {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
1742 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10};
1743 static UCHAR expected4[] =
1744 {0x28,0x73,0x3d,0xef,0x84,0x8f,0xb0,0xa6,0x5d,0x1a,0x51,0xb7,0xec,0x8f,0xea,0xe9,
1745 0x10,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f};
1746 static UCHAR expected5[] =
1747 {0x29,0x73,0x3d,0xef,0x84,0x8f,0xb0,0xa6,0x5d,0x1a,0x51,0xb7,0xec,0x8f,0xea,0xe9,
1748 0x10,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f};
1749 static UCHAR ciphertext[32] =
1750 {0xc6,0xa1,0x3b,0x37,0x87,0x8f,0x5b,0x82,0x6f,0x4f,0x81,0x62,0xa1,0xc8,0xd8,0x79,
1751 0x28,0x73,0x3d,0xef,0x84,0x8f,0xb0,0xa6,0x5d,0x1a,0x51,0xb7,0xec,0x8f,0xea,0xe9};
1752 static UCHAR ciphertext2[] =
1753 {0xc6,0xa1,0x3b,0x37,0x87,0x8f,0x5b,0x82,0x6f,0x4f,0x81,0x62,0xa1,0xc8,0xd8,0x79,
1754 0x28,0x73,0x3d,0xef,0x84,0x8f,0xb0,0xa6,0x5d,0x1a,0x51,0xb7,0xec,0x8f,0xea,0xe9};
1755 static UCHAR ciphertext3[] =
1756 {0xc6,0xa1,0x3b,0x37,0x87,0x8f,0x5b,0x82,0x6f,0x4f,0x81,0x62,0xa1,0xc8,0xd8,0x79,
1757 0xb1,0xa2,0x92,0x73,0xbe,0x2c,0x42,0x07,0xa5,0xac,0xe3,0x93,0x39,0x8c,0xb6,0xfb,
1758 0x87,0x5d,0xea,0xa3,0x7e,0x0f,0xde,0xfa,0xd9,0xec,0x6c,0x4e,0x3c,0x76,0x86,0xe4};
1759 static UCHAR ciphertext4[] =
1760 {0xe1,0x82,0xc3,0xc0,0x24,0xfb,0x86,0x85,0xf3,0xf1,0x2b,0x7d,0x09,0xb4,0x73,0x67,
1761 0x86,0x64,0xc3,0xfe,0xa3,0x07,0x61,0xf8,0x16,0xc9,0x78,0x7f,0xe7,0xb1,0xc4,0x94};
1762 static UCHAR ciphertext5[] =
1763 {0x0a,0x94,0x0b,0xb5,0x41,0x6e,0xf0,0x45,0xf1,0xc3,0x94,0x58,0xc6,0x53,0xea,0x5a,
1764 0x84,0x07,0x66,0xb7,0x49,0xc0,0x9b,0x49,0x74,0x28,0x8c,0x10,0xb9,0xc2,0x09,0x70};
1765 static UCHAR ciphertext6[] =
1766 {0x0a,0x94,0x0b,0xb5,0x41,0x6e,0xf0,0x45,0xf1,0xc3,0x94,0x58,0xc6,0x53,0xea,0x5a,
1767 0x95,0x4f,0x64,0xf2,0xe4,0xe8,0x6e,0x9e,0xee,0x82,0xd2,0x02,0x16,0x68,0x48,0x99,
1768 0x95,0x4f,0x64,0xf2,0xe4,0xe8,0x6e,0x9e,0xee,0x82,0xd2,0x02,0x16,0x68,0x48,0x99};
1770 {0x89,0xb3,0x92,0x00,0x39,0x20,0x09,0xb4,0x6a,0xd6,0xaf,0xca,0x4b,0x5b,0xfd,0xd0};
1771 static UCHAR tag2[] =
1772 {0x17,0x9d,0xc0,0x7a,0xf0,0xcf,0xaa,0xd5,0x1c,0x11,0xc4,0x4b,0xd6,0xa3,0x3e,0x77};
1778 UCHAR *
buf, plaintext[48], ivbuf[16];
1786 memset(&key_lengths, 0,
sizeof(key_lengths));
1789 ok(
size ==
sizeof(key_lengths),
"got %u\n",
size);
1811 memcpy(ivbuf, iv,
sizeof(iv));
1815 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
1818 memcpy(ivbuf, iv,
sizeof(iv));
1819 memset(plaintext, 0,
sizeof(plaintext));
1820 ret = pBCryptDecrypt(
key, ciphertext, 32,
NULL, ivbuf, 16, plaintext, 32, &
size, 0);
1824 ok(!
memcmp(ivbuf, ciphertext +
size -
sizeof(iv),
sizeof(iv)),
"wrong iv data.\n");
1828 memset(plaintext, 0,
sizeof(plaintext));
1829 ret = pBCryptDecrypt(
key, ciphertext, 32,
NULL, ivbuf, 16, plaintext, 32, &
size, 0);
1833 ok(!
memcmp(ivbuf, ciphertext + 32 - 16,
sizeof(iv)),
"wrong iv data.\n");
1836 memset(plaintext, 0,
sizeof(plaintext));
1840 ok(!
memcmp(plaintext, expected4,
sizeof(expected4)),
"wrong data\n");
1844 memcpy(ivbuf, iv,
sizeof(iv));
1848 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
1851 memcpy(ivbuf, iv,
sizeof(iv));
1852 memset(plaintext, 0,
sizeof(plaintext));
1856 ok(!
memcmp(plaintext, expected2,
sizeof(expected2)),
"wrong data\n");
1857 ok(!
memcmp(ivbuf, ciphertext2 + 32 -
sizeof(iv),
sizeof(iv)),
"wrong iv data.\n");
1860 memset(plaintext, 0,
sizeof(plaintext));
1864 ok(!
memcmp(plaintext, expected4,
size),
"wrong data\n");
1865 ok(!
memcmp(ivbuf, ciphertext2 + 32 - 16,
sizeof(iv)),
"wrong iv data.\n");
1869 memcpy(ivbuf, iv,
sizeof(iv));
1873 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
1876 memcpy(ivbuf, iv,
sizeof(iv));
1877 memset(plaintext, 0,
sizeof(plaintext));
1881 ok(!
memcmp(plaintext, expected3,
sizeof(expected3)),
"wrong data\n");
1882 ok(!
memcmp(ivbuf, ciphertext3 + 48 - 16,
sizeof(iv)),
"wrong iv data.\n");
1886 memcpy(ivbuf, iv,
sizeof(iv));
1887 ret = pBCryptDecrypt(
key, ciphertext, 32,
NULL, ivbuf, 16, plaintext, 31, &
size, 0);
1892 memcpy(ivbuf, iv,
sizeof(iv));
1898 memcpy(ivbuf, iv,
sizeof(iv));
1904 memcpy(ivbuf, iv,
sizeof(iv));
1911 memcpy(ivbuf, iv,
sizeof(iv));
1918 memcpy(ivbuf, iv,
sizeof(iv));
1923 ret = pBCryptDestroyKey(
key);
1943 memset(&auth_info, 0,
sizeof(auth_info));
1944 auth_info.
cbSize =
sizeof(auth_info);
1947 auth_info.
cbNonce =
sizeof(nonce);
1953 memcpy(ivbuf, iv,
sizeof(iv));
1954 memset(plaintext, 0,
sizeof(plaintext));
1955 ret = pBCryptDecrypt(
key, ciphertext4, 32, &auth_info, ivbuf, 16, plaintext, 32, &
size, 0);
1958 ok(!
memcmp(plaintext, expected3,
sizeof(expected3)),
"wrong data\n");
1959 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv.\n");
1962 memset(plaintext, 0,
sizeof(plaintext));
1963 ret = pBCryptDecrypt(
key, ciphertext4, 32, &auth_info,
NULL, 0, plaintext, 32, &
size, 0);
1966 ok(!
memcmp(plaintext, expected3,
sizeof(expected3)),
"wrong data\n");
1969 memcpy(ivbuf, iv,
sizeof(iv));
1971 memset(plaintext, 0,
sizeof(plaintext));
1972 ret = pBCryptDecrypt(
key, ciphertext4, 32, &auth_info, ivbuf, 16, plaintext, 32, &
size, 0);
1975 ok(!
memcmp(plaintext, expected3,
sizeof(expected3)),
"wrong data\n");
1976 ok(!
memcmp(ivbuf + 1, iv + 1,
sizeof(iv) - 1),
"wrong iv data.\n");
1977 ok(ivbuf[0] == iv[0] + 1,
"wrong iv data.\n");
1982 auth_info.
pbTag = tag2;
1983 auth_info.
cbTag =
sizeof(tag2);
1986 memcpy(ivbuf, iv,
sizeof(iv));
1987 memset(plaintext, 0,
sizeof(plaintext));
1988 ret = pBCryptDecrypt(
key, ciphertext4, 32, &auth_info, ivbuf, 16, plaintext, 32, &
size, 0);
1991 ok(!
memcmp(plaintext, expected3,
sizeof(expected3)),
"wrong data\n");
1992 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv.\n");
1995 memcpy(ivbuf, iv,
sizeof(iv));
1996 auth_info.
pbTag = iv;
1997 ret = pBCryptDecrypt(
key, ciphertext4, 32, &auth_info, ivbuf, 16, plaintext, 32, &
size, 0);
2000 ok(!
memcmp(ivbuf, iv,
sizeof(iv)),
"wrong iv data.\n");
2002 ret = pBCryptDestroyKey(
key);
2024 memcpy(ivbuf, iv,
sizeof(iv));
2025 ret = pBCryptDecrypt(
key, ciphertext5, 32,
NULL, ivbuf, 16, plaintext, 32, &
size, 0);
2036 memset(plaintext, 0,
sizeof(plaintext));
2049 memset(plaintext, 0,
sizeof(plaintext));
2053 ok(!
memcmp(plaintext, expected2,
sizeof(expected2)),
"wrong data\n");
2062 memset(plaintext, 0,
sizeof(plaintext));
2066 ok(!
memcmp(plaintext, expected3,
sizeof(expected3)),
"wrong data\n");
2101 ret = pBCryptDestroyKey(
key);
2104 ret = pBCryptDestroyKey(
key);
2108 ret = pBCryptDestroyKey(
NULL);
2111 ret = pBCryptCloseAlgorithmProvider(aes, 0);
2114 ret = pBCryptCloseAlgorithmProvider(aes, 0);
2117 ret = pBCryptCloseAlgorithmProvider(
NULL, 0);
2123 static const UCHAR encrypted_blob[40] = {0x33,0x6e,0x51,0x10,
2124 0x25,0xba,0xdb,0xce,0xcb,0x25,0x00,0x85,0x51,0xc0,0xfa,0x21,
2125 0x66,0xdd,0x6d,0x67,0x46,0x76,0x0f,0x8a,0x44,0xe5,0x65,0x31,
2126 0xcb,0x02,0x52,0x9c,0x69,0x59,0x1a,0xec,0x67,0x27,0x11,0xaa};
2142 key_data1->cbKeyData = 16;
2143 memset(&key_data1[1], 0x11, 16);
2153 memset(&key_data2[1], 0x22, 32);
2157 ok(key2 !=
NULL,
"key not set\n");
2162 ok(
size ==
sizeof(buffer3),
"got %u\n",
size);
2166 ok(!
memcmp(buffer3, encrypted_blob,
sizeof(encrypted_blob)),
"blobs didn't match\n");
2171 ok(key3 !=
NULL,
"key not set\n");
2174 memset(buffer4, 0xff,
sizeof(buffer4));
2177 ok(
size ==
sizeof(buffer2),
"Got %u\n",
size);
2178 ok(!
memcmp(buffer4, buffer2,
sizeof(buffer2)),
"Expected exported key to match imported key\n");
2180 pBCryptDestroyKey(key3);
2181 pBCryptDestroyKey(key2);
2186 ok(
size ==
sizeof(buffer1),
"got %u\n",
size);
2189 memset(buffer2, 0xff,
sizeof(buffer2));
2192 ok(
size ==
sizeof(buffer1),
"Got %u\n",
size);
2193 ok(!
memcmp(buffer1, buffer2,
sizeof(buffer1)),
"Expected exported key to match imported key\n");
2199 ok(
size > 0,
"got zero\n");
2205 ret = pBCryptDestroyKey(
key);
2213 ret = pBCryptDestroyKey(
key);
2220 pBCryptDestroyKey(
key);
2224 ret = pBCryptCloseAlgorithmProvider(aes, 0);
2231 0x26, 0xff, 0x0e, 0xf9, 0x71, 0x93, 0xf8, 0xed, 0x59, 0xfa, 0x24, 0xec, 0x18, 0x13, 0xfe, 0xf5,
2232 0x0b, 0x4a, 0xb1, 0x27, 0xb7, 0xab, 0x3e, 0x4f, 0xc5, 0x5a, 0x91, 0xa3, 0x6e, 0x21, 0x61, 0x65,
2234 0x62, 0x7b, 0x8b, 0x30, 0x7a, 0x63, 0x4c, 0x1a, 0xf4, 0x54, 0x54, 0xbb, 0x75, 0x59, 0x68, 0x36,
2235 0xfe, 0x49, 0x95, 0x75, 0x9e, 0x20, 0x3e, 0x69, 0x58, 0xb9, 0x7a, 0x84, 0x03, 0x45, 0x5c, 0x10,
2237 0xb9, 0xcd, 0xbe, 0xd4, 0x75, 0x5d, 0x05, 0xe5, 0x83, 0x0c, 0xd3, 0x37, 0x34, 0x15, 0xe3, 0x2c,
2238 0xe5, 0x85, 0x15, 0xa9, 0xee, 0xba, 0x94, 0x03, 0x03, 0x0b, 0x86, 0xea, 0x85, 0x40, 0xbd, 0x35,
2243 0x3b, 0x3c, 0x34, 0xc8, 0x3f, 0x15, 0xea, 0x02, 0x68, 0x46, 0x69, 0xdf, 0x0c, 0xa6, 0xee, 0x7a,
2244 0xd9, 0x82, 0x08, 0x9b, 0x37, 0x53, 0x42, 0xf3, 0x13, 0x63, 0xda, 0x65, 0x79, 0xe8, 0x04, 0x9e,
2246 0x8c, 0x77, 0xc4, 0x33, 0x77, 0xd9, 0x5a, 0x7f, 0x60, 0x7b, 0x98, 0xce, 0xf3, 0x96, 0x56, 0xd6,
2247 0xb5, 0x8d, 0x87, 0x7a, 0x00, 0x2b, 0xf3, 0x70, 0xb3, 0x90, 0x73, 0xa0, 0x56, 0x06, 0x3b, 0x22,
2251 0x28, 0x19, 0x0f, 0x15, 0x6d, 0x75, 0xcc, 0xcf, 0x62, 0xf1, 0x5e, 0xe6, 0x8a, 0xc3, 0xf0, 0x5d,
2252 0x89, 0x28, 0x2d, 0x48, 0xd8, 0x73, 0x7c, 0x05, 0x05, 0x8e, 0xbc, 0xce, 0x28, 0xb7, 0xba, 0xc9,
2257 0xd7, 0x29, 0xce, 0x5a, 0xef, 0x74, 0x85, 0xd1, 0x18, 0x5f, 0x6e, 0xf1, 0xba, 0x53, 0xd4, 0xcd,
2258 0xdd, 0xe0, 0x5d, 0xf1, 0x5e, 0x48, 0x51, 0xea, 0x63, 0xc0, 0xe8, 0xe2, 0xf6, 0xfa, 0x4c, 0xaf,
2260 0xe3, 0x94, 0x15, 0x3b, 0x6c, 0x71, 0x6e, 0x44, 0x22, 0xcb, 0xa0, 0x88, 0xcd, 0x0a, 0x5a, 0x50,
2261 0x29, 0x7c, 0x5c, 0xd6, 0x6c, 0xd2, 0xe0, 0x7f, 0xcd, 0x02, 0x92, 0x21, 0x4c, 0x2c, 0x92, 0xee,
2294 pBCryptDestroyKey(
key);
2301 pBCryptDestroyKey(
key);
2310 ok(
size ==
sizeof(keylen),
"got %u\n",
size);
2311 ok(keylen == 256,
"got %u\n", keylen);
2328 pBCryptDestroyKey(
key);
2364 pBCryptDestroyKey(
key);
2365 pBCryptCloseAlgorithmProvider(
alg, 0);
2370 0x52, 0x53, 0x41, 0x31, 0x00, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
2371 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0xad, 0x41, 0x09, 0xa2, 0x56,
2372 0x3a, 0x7b, 0x75, 0x4b, 0x72, 0x9b, 0x28, 0x72, 0x3b, 0xae, 0x9f, 0xd8, 0xa8, 0x25, 0x4a, 0x4c,
2373 0x19, 0xf5, 0xa6, 0xd0, 0x05, 0x1c, 0x59, 0x8f, 0xe3, 0xf3, 0x2d, 0x29, 0x47, 0xf8, 0x80, 0x25,
2374 0x25, 0x21, 0x58, 0xc2, 0xac, 0xa1, 0x9e, 0x93, 0x8e, 0x82, 0x6d, 0xd7, 0xf3, 0xe7, 0x8f, 0x0b,
2375 0xc0, 0x41, 0x85, 0x29, 0x3c, 0xf1, 0x0b, 0x2c, 0x5d, 0x49, 0xed, 0xb4, 0x30, 0x6e, 0x02, 0x15,
2376 0x4b, 0x9a, 0x08, 0x0d, 0xe1, 0x6f, 0xa8, 0xd3, 0x12, 0xab, 0x66, 0x48, 0x4d, 0xd9, 0x28, 0x03,
2377 0x6c, 0x9d, 0x44, 0x7a, 0xed, 0xc9, 0x43, 0x4f, 0x9d, 0x4e, 0x3c, 0x7d, 0x0e, 0xff, 0x07, 0x87,
2378 0xeb, 0xca, 0xca, 0x65, 0x6d, 0xbe, 0xc5, 0x31, 0x8b, 0xcc, 0x7e, 0x0a, 0x71, 0x4a, 0x4d, 0x9d,
2379 0x3d, 0xfd, 0x7a, 0x56, 0x32, 0x8a, 0x6c, 0x6d, 0x9d, 0x2a, 0xd9, 0x8e, 0x68, 0x89, 0x63, 0xc6,
2380 0x4f, 0x24, 0xd1, 0x2a, 0x72, 0x69, 0x08, 0x77, 0xa0, 0x7f, 0xfe, 0xc6, 0x33, 0x8d, 0xb4, 0x7d,
2381 0x73, 0x91, 0x13, 0x9c, 0x47, 0x53, 0x6a, 0x13, 0xdf, 0x19, 0xc7, 0xed, 0x48, 0x81, 0xed, 0xd8,
2382 0x1f, 0x11, 0x11, 0xbb, 0x41, 0x15, 0x5b, 0xa4, 0xf5, 0xc9, 0x2b, 0x48, 0x5e, 0xd8, 0x4b, 0x52,
2383 0x1f, 0xf7, 0x87, 0xf2, 0x68, 0x25, 0x28, 0x79, 0xee, 0x39, 0x41, 0xc9, 0x0e, 0xc8, 0xf9, 0xf2,
2384 0xd8, 0x24, 0x09, 0xb4, 0xd4, 0xb7, 0x90, 0xba, 0x26, 0xe8, 0x1d, 0xb4, 0xd7, 0x09, 0x00, 0xc4,
2385 0xa0, 0xb6, 0x14, 0xe8, 0x4c, 0x29, 0x60, 0x54, 0x2e, 0x01, 0xde, 0x54, 0x66, 0x40, 0x22, 0x50,
2386 0x27, 0xf1, 0xe7, 0x62, 0xa9, 0x00, 0x5a, 0x61, 0x2e, 0xfa, 0xfe, 0x16, 0xd8, 0xe0, 0xe7, 0x66,
2387 0x17, 0xda, 0xb8, 0x0c, 0xa6, 0x04, 0x8d, 0xf8, 0x21, 0x68, 0x39
2392 0x96, 0x1f, 0xa6, 0x49, 0x58, 0x81, 0x8f, 0x76, 0x77, 0x07, 0x07, 0x27, 0x55, 0xd7, 0x01, 0x8d,
2393 0xcd, 0x27, 0x8e, 0x94
2398 0xa8, 0x3a, 0x9d, 0xaf, 0x92, 0x94, 0xa4, 0x4d, 0x34, 0xba, 0x41, 0x0c, 0xc1, 0x23, 0x91, 0xc7,
2399 0x91, 0xa8, 0xf8, 0xfc, 0x94, 0x87, 0x4d, 0x05, 0x85, 0x63, 0xe8, 0x7d, 0xea, 0x7f, 0x6b, 0x8d,
2400 0xbb, 0x9a, 0xd4, 0x46, 0xa6, 0xc0, 0xd6, 0xdc, 0x91, 0xba, 0xd3, 0x1a, 0xbf, 0xf4, 0x52, 0xa0,
2401 0xc7, 0x15, 0x87, 0xe9, 0x1e, 0x60, 0x49, 0x9c, 0xee, 0x5a, 0x9c, 0x6c, 0xbd, 0x7a, 0x3e, 0xc3,
2402 0x48, 0xb3, 0xee, 0xca, 0x68, 0x40, 0x9b, 0xa1, 0x4c, 0x6e, 0x20, 0xd6, 0xca, 0x6c, 0x72, 0xaf,
2403 0x2b, 0x6b, 0x62, 0x7c, 0x78, 0x06, 0x94, 0x4c, 0x02, 0xf3, 0x8d, 0x49, 0xe0, 0x11, 0xc4, 0x9b,
2404 0x62, 0x5b, 0xc2, 0xfd, 0x68, 0xf4, 0x07, 0x15, 0x71, 0x11, 0x4c, 0x35, 0x97, 0x5d, 0xc0, 0xe6,
2405 0x22, 0xc9, 0x8a, 0x7b, 0x96, 0xc9, 0xc3, 0xe4, 0x2b, 0x1e, 0x88, 0x17, 0x4f, 0x98, 0x9b, 0xf3,
2406 0x42, 0x23, 0x0c, 0xa0, 0xfa, 0x19, 0x03, 0x2a, 0xf7, 0x13, 0x2d, 0x27, 0xac, 0x9f, 0xaf, 0x2d,
2407 0xa3, 0xce, 0xf7, 0x63, 0xbb, 0x39, 0x9f, 0x72, 0x80, 0xdd, 0x6c, 0x73, 0x00, 0x85, 0x70, 0xf2,
2408 0xed, 0x50, 0xed, 0xa0, 0x74, 0x42, 0xd7, 0x22, 0x46, 0x24, 0xee, 0x67, 0xdf, 0xb5, 0x45, 0xe8,
2409 0x49, 0xf4, 0x9c, 0xe4, 0x00, 0x83, 0xf2, 0x27, 0x8e, 0xa2, 0xb1, 0xc3, 0xc2, 0x01, 0xd7, 0x59,
2410 0x2e, 0x4d, 0xac, 0x49, 0xa2, 0xc1, 0x8d, 0x88, 0x4b, 0xfe, 0x28, 0xe5, 0xac, 0xa6, 0x85, 0xc4,
2411 0x1f, 0xf8, 0xc5, 0xc5, 0x14, 0x4e, 0xa3, 0xcb, 0x17, 0xb7, 0x64, 0xb3, 0xc2, 0x12, 0xf8, 0xf8,
2412 0x36, 0x99, 0x1c, 0x91, 0x9b, 0xbd, 0xed, 0x55, 0x0f, 0xfd, 0x49, 0x85, 0xbb, 0x32, 0xad, 0x78,
2413 0xc1, 0x74, 0xe6, 0x7c, 0x18, 0x0f, 0x2b, 0x3b, 0xaa, 0xd1, 0x9d, 0x40, 0x71, 0x1d, 0x19, 0x53
2418 0x52, 0x53, 0x41, 0x32, 0x00, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
2419 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0xa6, 0x8b, 0x46, 0x26, 0xb5,
2420 0xa9, 0x69, 0x83, 0x94, 0x66, 0xa7, 0xf3, 0x33, 0x95, 0x74, 0xe9, 0xeb, 0xc8, 0xcd, 0xd7, 0x81,
2421 0x9e, 0x45, 0x66, 0xb2, 0x48, 0x8b, 0x1f, 0xfe, 0xb3, 0x62, 0xc4, 0x0d, 0xa2, 0xf9, 0xf3, 0xe2,
2422 0xa6, 0x86, 0xd1, 0x1e, 0x8a, 0xbb, 0x1d, 0xa5, 0xc5, 0xe8, 0xa7, 0x50, 0x37, 0xfd, 0x69, 0x1f,
2423 0x6f, 0x99, 0x99, 0xca, 0x39, 0x13, 0xea, 0x5b, 0x6b, 0xe3, 0x91, 0xc0, 0xd2, 0x2c, 0x0b, 0x21,
2424 0xb1, 0xac, 0xa9, 0xe8, 0xa0, 0x6d, 0xa4, 0x1f, 0x1b, 0x34, 0xcb, 0x88, 0x7f, 0x2e, 0xeb, 0x7d,
2425 0x91, 0x38, 0x48, 0xce, 0x05, 0x73, 0x05, 0xdd, 0x22, 0x94, 0xc3, 0xdd, 0x1c, 0xfd, 0xc5, 0x41,
2426 0x2e, 0x94, 0xf9, 0xed, 0xe5, 0x92, 0x5f, 0x3f, 0x06, 0xf8, 0x49, 0x60, 0xb8, 0x92, 0x52, 0x6a,
2427 0x56, 0x6e, 0xd7, 0x04, 0x1a, 0xb5, 0xb5, 0x1c, 0x31, 0xd1, 0x1b,
2432 0x52, 0x53, 0x41, 0x33, 0x00, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
2433 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0xa6, 0x8b, 0x46, 0x26, 0xb5,
2434 0xa9, 0x69, 0x83, 0x94, 0x66, 0xa7, 0xf3, 0x33, 0x95, 0x74, 0xe9, 0xeb, 0xc8, 0xcd, 0xd7, 0x81,
2435 0x9e, 0x45, 0x66, 0xb2, 0x48, 0x8b, 0x1f, 0xfe, 0xb3, 0x62, 0xc4, 0x0d, 0xa2, 0xf9, 0xf3, 0xe2,
2436 0xa6, 0x86, 0xd1, 0x1e, 0x8a, 0xbb, 0x1d, 0xa5, 0xc5, 0xe8, 0xa7, 0x50, 0x37, 0xfd, 0x69, 0x1f,
2437 0x6f, 0x99, 0x99, 0xca, 0x39, 0x13, 0xea, 0x5b, 0x6b, 0xe3, 0x91, 0xc0, 0xd2, 0x2c, 0x0b, 0x21,
2438 0xb1, 0xac, 0xa9, 0xe8, 0xa0, 0x6d, 0xa4, 0x1f, 0x1b, 0x34, 0xcb, 0x88, 0x7f, 0x2e, 0xeb, 0x7d,
2439 0x91, 0x38, 0x48, 0xce, 0x05, 0x73, 0x05, 0xdd, 0x22, 0x94, 0xc3, 0xdd, 0x1c, 0xfd, 0xc5, 0x41,
2440 0x2e, 0x94, 0xf9, 0xed, 0xe5, 0x92, 0x5f, 0x3f, 0x06, 0xf8, 0x49, 0x60, 0xb8, 0x92, 0x52, 0x6a,
2441 0x56, 0x6e, 0xd7, 0x04, 0x1a, 0xb5, 0xb5, 0x1c, 0x31, 0xd1, 0x1b, 0xa3, 0xf3, 0xd1, 0x69, 0x61,
2442 0xab, 0xfe, 0xc1, 0xb6, 0x40, 0x7b, 0x19, 0xbb, 0x2d, 0x59, 0xf5, 0xda, 0x49, 0x32, 0x6f, 0x20,
2443 0x24, 0xd3, 0xb3, 0xec, 0x21, 0xec, 0x0c, 0xc7, 0x5b, 0xf9, 0x1b, 0xba, 0x6e, 0xe9, 0x61, 0xda,
2444 0x55, 0xc6, 0x72, 0xfd, 0x2d, 0x66, 0x3f, 0x3c, 0xcb, 0x49, 0xa9, 0xc5, 0x0d, 0x9b, 0x02, 0x36,
2445 0x7a, 0xee, 0x36, 0x09, 0x55, 0xe4, 0x03, 0xf2, 0xe3, 0xe6, 0x25, 0x14, 0x89, 0x7f, 0x2b, 0xfb,
2446 0x27, 0x0e, 0x8d, 0x37, 0x84, 0xfd, 0xad, 0x10, 0x79, 0x43, 0x4e, 0x38, 0x4a, 0xd4, 0x5e, 0xfa,
2447 0xda, 0x9f, 0x88, 0x21, 0x7c, 0xb4, 0x98, 0xb6, 0x6e, 0x1c, 0x24, 0x09, 0xe5, 0xe7, 0x22, 0x6f,
2448 0xd3, 0x84, 0xc0, 0xdc, 0x36, 0x09, 0xaf, 0x4b, 0x96, 0x8b, 0x5f, 0x47, 0xb3, 0x24, 0x80, 0xb5,
2449 0x64, 0x69, 0xad, 0x83, 0xd5, 0x09, 0xe7, 0xb9, 0xe4, 0x81, 0x6f, 0x1a, 0xe2, 0x6d, 0xf1, 0x5e,
2450 0x2b, 0xb3, 0x7a, 0xd0, 0x77, 0xef, 0x82, 0xcd, 0x55, 0x2e, 0xd5, 0xb1, 0xa7, 0x72, 0xec, 0x02,
2451 0x9d, 0xe2, 0xcc, 0x5a, 0xf1, 0x68, 0x30, 0xe5, 0xbc, 0x8d, 0xad,
2471 0x91, 0xe3, 0x6b, 0x5b, 0xea, 0x13, 0x39, 0xca, 0x99, 0x99, 0x6f, 0x1f, 0x69, 0xfd, 0x37, 0x50,
2472 0xa7, 0xe8, 0xc5, 0xa5, 0x1d, 0xbb, 0x8a, 0x1e, 0xd1, 0x86, 0xa6, 0xe2, 0xf3, 0xf9, 0xa2, 0x0d,
2473 0xc4, 0x62, 0xb3, 0xfe, 0x1f, 0x8b, 0x48, 0xb2, 0x66, 0x45, 0x9e, 0x81, 0xd7, 0xcd, 0xc8, 0xeb,
2474 0xe9, 0x74, 0x95, 0x33, 0xf3, 0xa7, 0x66, 0x94, 0x83, 0x69, 0xa9, 0xb5, 0x26, 0x46, 0x8b, 0xa6
2477 0xc3, 0x94, 0x22, 0xdd, 0x05, 0x73, 0x05, 0xce, 0x48, 0x38, 0x91, 0x7d, 0xeb, 0x2e, 0x7f, 0x88,
2478 0xcb, 0x34, 0x1b, 0x1f, 0xa4, 0x6d, 0xa0, 0xe8, 0xa9, 0xac, 0xb1, 0x21, 0x0b, 0x2c, 0xd2, 0xc0
2481 0x1b, 0xd1, 0x31, 0x1c, 0xb5, 0xb5, 0x1a, 0x04, 0xd7, 0x6e, 0x56, 0x6a, 0x52, 0x92, 0xb8, 0x60,
2482 0x49, 0xf8, 0x06, 0x3f, 0x5f, 0x92, 0xe5, 0xed, 0xf9, 0x94, 0x2e, 0x41, 0xc5, 0xfd, 0x1c, 0xdd
2485 0x1b, 0xf9, 0x5b, 0xc7, 0x0c, 0xec, 0x21, 0xec, 0xb3, 0xd3, 0x24, 0x20, 0x6f, 0x32, 0x49, 0xda,
2486 0xf5, 0x59, 0x2d, 0xbb, 0x19, 0x7b, 0x40, 0xb6, 0xc1, 0xfe, 0xab, 0x61, 0x69, 0xd1, 0xf3, 0xa3
2489 0x25, 0xe6, 0xe3, 0xf2, 0x03, 0xe4, 0x55, 0x09, 0x36, 0xee, 0x7a, 0x36, 0x02, 0x9b, 0x0d, 0xc5,
2490 0xa9, 0x49, 0xcb, 0x3c, 0x3f, 0x66, 0x2d, 0xfd, 0x72, 0xc6, 0x55, 0xda, 0x61, 0xe9, 0x6e, 0xba
2493 0x24, 0x1c, 0x6e, 0xb6, 0x98, 0xb4, 0x7c, 0x21, 0x88, 0x9f, 0xda, 0xfa, 0x5e, 0xd4, 0x4a, 0x38,
2494 0x4e, 0x43, 0x79, 0x10, 0xad, 0xfd, 0x84, 0x37, 0x8d, 0x0e, 0x27, 0xfb, 0x2b, 0x7f, 0x89, 0x14
2497 0xad, 0x8d, 0xbc, 0xe5, 0x30, 0x68, 0xf1, 0x5a, 0xcc, 0xe2, 0x9d, 0x02, 0xec, 0x72, 0xa7, 0xb1,
2498 0xd5, 0x2e, 0x55, 0xcd, 0x82, 0xef, 0x77, 0xd0, 0x7a, 0xb3, 0x2b, 0x5e, 0xf1, 0x6d, 0xe2, 0x1a,
2499 0x6f, 0x81, 0xe4, 0xb9, 0xe7, 0x09, 0xd5, 0x83, 0xad, 0x69, 0x64, 0xb5, 0x80, 0x24, 0xb3, 0x47,
2500 0x5f, 0x8b, 0x96, 0x4b, 0xaf, 0x09, 0x36, 0xdc, 0xc0, 0x84, 0xd3, 0x6f, 0x22, 0xe7, 0xe5, 0x09
2506 0x52, 0x53, 0x41, 0x31, 0x00, 0x04, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00,
2507 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2508 0x01, 0x00, 0x01, 0xc7, 0x8f, 0xac, 0x2a, 0xce, 0xbf, 0xc9, 0x6c, 0x7b,
2509 0x85, 0x74, 0x71, 0xbb, 0xff, 0xbb, 0x9b, 0x20, 0x03, 0x79, 0x17, 0x34,
2510 0xe7, 0x26, 0x91, 0x5c, 0x1f, 0x1b, 0x03, 0x3d, 0x46, 0xdf, 0xb6, 0xf2,
2511 0x10, 0x55, 0xf0, 0x39, 0x55, 0x0a, 0xe3, 0x9c, 0x0c, 0x63, 0xc2, 0x14,
2512 0x03, 0x94, 0x51, 0x0d, 0xb4, 0x22, 0x09, 0xf2, 0x5c, 0xb2, 0xd1, 0xc3,
2513 0xac, 0x6f, 0xa8, 0xc4, 0xac, 0xb8, 0xbc, 0x59, 0xe7, 0xed, 0x77, 0x6e,
2514 0xb1, 0x80, 0x58, 0x7d, 0xb2, 0x94, 0x46, 0xe5, 0x00, 0xe2, 0xb7, 0x33,
2515 0x48, 0x7a, 0xd3, 0x78, 0xe9, 0x26, 0x01, 0xc7, 0x00, 0x7b, 0x41, 0x6d,
2516 0x94, 0x3a, 0xe1, 0x50, 0x2b, 0x9f, 0x6b, 0x1c, 0x08, 0xa3, 0xfc, 0x0a,
2517 0x44, 0x81, 0x09, 0x41, 0x80, 0x23, 0x7b, 0xf6, 0x3f, 0xaf, 0x91, 0xa1,
2518 0x87, 0x75, 0x33, 0x15, 0xb8, 0xde, 0x32, 0x30, 0xb4, 0x5e, 0xfd
2523 0x4a, 0xc1, 0xfa, 0x4f, 0xe0, 0x3f, 0x36, 0x9a, 0x64, 0xbf, 0x2e, 0x00, 0xb4, 0xb5, 0x40, 0xbe,
2524 0x2d, 0x9a, 0x14, 0xf6, 0x8f, 0xa5, 0xc2, 0xe2, 0x20, 0xaf, 0x21, 0x79, 0xc6, 0x32, 0x7e, 0xea,
2525 0x73, 0x00, 0x01, 0xbb, 0x9a, 0x19, 0x73, 0x41, 0x96, 0xae, 0x88, 0x6e, 0x36, 0x56, 0xe9, 0x9c,
2526 0xac, 0x04, 0x82, 0xa8, 0x00, 0xdb, 0x4e, 0x29, 0x61, 0x7e, 0xaf, 0x64, 0xdb, 0xa2, 0x70, 0x0f,
2531 UCHAR input[] =
"Hello World!", input_no_padding[64] = { 0 }, encrypted[64], decrypted[64];
2535 DWORD encrypted_size, decrypted_size;
2545 ret = pBCryptGenerateKeyPair(rsa, &
key, 512, 0);
2551 pBCryptDestroyKey(
key);
2563 memset(input_no_padding, 0,
sizeof(input_no_padding));
2564 strcpy((
char *)input_no_padding,
"Hello World");
2568 ok(encrypted_size == 64,
"got size of %d\n", encrypted_size);
2570 encrypted_a =
malloc(encrypted_size);
2571 memset(encrypted_a, 0, encrypted_size);
2572 encrypted_b =
malloc(encrypted_size);
2573 memset(encrypted_b, 0xff, encrypted_size);
2580 ok(encrypted_size == 64,
"got size of %d\n", encrypted_size);
2582 ret = pBCryptEncrypt(
key, input_no_padding,
sizeof(input_no_padding),
NULL,
NULL, 0, encrypted_a, encrypted_size, &encrypted_size,
BCRYPT_PAD_NONE);
2584 ok(encrypted_size == 64,
"got size of %d\n", encrypted_size);
2586 ret = pBCryptEncrypt(
key, input_no_padding,
sizeof(input_no_padding),
NULL,
NULL, 0, encrypted_b, encrypted_size, &encrypted_size,
BCRYPT_PAD_NONE);
2589 ok(!
memcmp(encrypted_a, encrypted_b, encrypted_size),
"Both outputs should be the same\n");
2596 ok(decrypted_size ==
sizeof(input_no_padding),
"got %u\n", decrypted_size);
2600 ok(decrypted_size ==
sizeof(input_no_padding),
"got %u\n", decrypted_size);
2601 ok(!
memcmp(decrypted, input_no_padding,
sizeof(input_no_padding)),
"unexpected output\n");
2608 ok(encrypted_size == 64,
"got size of %d\n", encrypted_size);
2610 encrypted_a =
realloc(encrypted_a, encrypted_size);
2611 memset(encrypted_a, 0, encrypted_size);
2612 encrypted_b =
realloc(encrypted_b, encrypted_size);
2613 memset(encrypted_b, 0, encrypted_size);
2617 ok(encrypted_size == 64,
"got size of %d\n", encrypted_size);
2621 ok(encrypted_size == 64,
"got size of %d\n", encrypted_size);
2622 ok(
memcmp(encrypted_a, encrypted_b, encrypted_size),
"Both outputs are the same\n");
2627 ok(decrypted_size ==
sizeof(
input),
"got size of %d\n", decrypted_size);
2631 ok(decrypted_size ==
sizeof(
input),
"got size of %d\n", decrypted_size);
2641 ok(encrypted_size == 64,
"got size of %d\n", encrypted_size);
2643 memset(decrypted, 0,
sizeof(decrypted));
2644 ret = pBCryptDecrypt(
key, encrypted,
sizeof(encrypted),
NULL,
NULL, 0, decrypted,
sizeof(decrypted),
2647 ok(decrypted_size ==
sizeof(
input),
"got size of %d\n", decrypted_size);
2649 pBCryptDestroyKey(key2);
2650 pBCryptDestroyKey(
key);
2653 ret = pBCryptGenerateKeyPair(rsa, &
key, 640 , 0);
2656 ret = pBCryptFinalizeKeyPair(
key, 0);
2663 ok(encrypted_size == 80,
"got size of %d\n", encrypted_size);
2665 encrypted_a =
realloc(encrypted_a, encrypted_size);
2666 memset(encrypted_a, 0, encrypted_size);
2667 encrypted_b =
realloc(encrypted_b, encrypted_size);
2668 memset(encrypted_b, 0, encrypted_size);
2672 ok(encrypted_size == 80,
"got size of %d\n", encrypted_size);
2676 ok(encrypted_size == 80,
"got size of %d\n", encrypted_size);
2677 ok(
memcmp(encrypted_a, encrypted_b, encrypted_size),
"Both outputs are the same\n");
2680 memset(decrypted, 0,
sizeof(decrypted));
2683 ok(decrypted_size ==
sizeof(
input),
"got %u\n", decrypted_size);
2685 ret = pBCryptDecrypt(
key, encrypted_a, encrypted_size, &oaep_pad,
NULL, 0, decrypted, decrypted_size, &decrypted_size,
BCRYPT_PAD_OAEP);
2687 ok(decrypted_size ==
sizeof(
input),
"got %u\n", decrypted_size);
2694 pBCryptDestroyKey(
key);
2700 pBCryptDestroyKey(
key);
2707 {0x7e,0xe3,0x74,0xe7,0xc5,0x0b,0x6b,0x70,0xdb,0xab,0x32,0x6d,0x1d,0x51,0xd6,0x74,0x79,0x8e,0x5b,0x4b};
2708 static UCHAR hash48[] =
2709 {0x62,0xb2,0x1e,0x90,0xc9,0x02,0x2b,0x10,0x16,0x71,0xba,0x1f,0x80,0x8f,0x86,0x31,0xa8,0x14,0x9f,0x0f,
2710 0x12,0x90,0x40,0x55,0x83,0x9a,0x35,0xc1,0xca,0x78,0xae,0x53,0x1b,0xb3,0x36,0x06,0xba,0x90,0x89,0x12,
2711 0xa8,0x42,0x21,0x10,0x9d,0x29,0xcd,0x7e};
2717 UCHAR sig[256], sig_pss[256];
2727 ret = pBCryptGetProperty(
alg,
L"PaddingSchemes", (
UCHAR *)&schemes,
sizeof(schemes), &
size, 0);
2729 ok(schemes,
"schemes not set\n");
2730 ok(
size ==
sizeof(schemes),
"got %u\n",
size);
2733 ok(!
ret,
"BCryptImportKeyPair failed: 0x%x\n",
ret);
2734 pBCryptDestroyKey(
key);
2737 ok(!
ret,
"BCryptImportKeyPair failed: 0x%x\n",
ret);
2742 ok(
size ==
sizeof(keylen),
"got %u\n",
size);
2743 ok(keylen == 2048,
"got %u\n", keylen);
2747 ok(!
ret,
"BCryptVerifySignature failed: 0x%x\n",
ret);
2767 ret = pBCryptDestroyKey(
key);
2768 ok(!
ret,
"BCryptDestroyKey failed: 0x%x\n",
ret);
2771 ret = pBCryptGenerateKeyPair(
alg, &
key, 1024, 0);
2780 ret = pBCryptFinalizeKeyPair(
key, 0);
2786 ok(
size ==
sizeof(keylen),
"got %u\n",
size);
2787 ok(keylen == 2048,
"got %u\n", keylen);
2793 memset(sig, 0,
sizeof(sig));
2800 ok(!
ret,
"BCryptVerifySignature failed: 0x%x\n",
ret);
2803 memset(sig, 0,
sizeof(sig));
2810 ok(!
ret,
"BCryptVerifySignature failed: 0x%x\n",
ret);
2813 memset(sig, 0,
sizeof(sig));
2825 ok(!
ret,
"BCryptVerifySignature failed: 0x%x, len %d\n",
ret,
len);
2829 memset(sig_pss, 0,
sizeof(sig_pss));
2839 ok(
size,
"size not set\n");
2852 ok(
size == size2,
"got %u expected %u\n", size2,
size);
2858 ok(
size,
"size not set\n");
2871 ok(
size == size2,
"got %u expected %u\n", size2,
size);
2878 ok(
size,
"size not set\n");
2891 ret = pBCryptDestroyKey(
key);
2904 ret = pBCryptVerifySignature(
key, &pad_pss, hash48,
sizeof(hash48), sig_pss,
sizeof(sig_pss),
BCRYPT_PAD_PSS);
2906 ret = pBCryptDestroyKey(
key);
2913 ret = pBCryptFinalizeKeyPair(
key, 0);
2923 pBCryptDestroyKey(
key);
2936 pBCryptDestroyKey(
key);
2938 ret = pBCryptCloseAlgorithmProvider(
alg, 0);
2956 ok(!
ret,
"BCryptImportKeyPair failed: 0x%x\n",
ret);
2958 memset(buf2, 0xcc,
sizeof(buf2));
2969 ok(
size == size2,
"got %u expected %u\n", size2,
size);
2980 ok(!
ret,
"BCryptVerifySignature failed: 0x%x\n",
ret);
3000 ret = pBCryptDestroyKey(
key);
3001 ok(!
ret,
"BCryptDestroyKey failed: 0x%x\n",
ret);
3004 ret = pBCryptGenerateKeyPair(
alg, &
key, 512, 0);
3007 ret = pBCryptFinalizeKeyPair(
key, 0);
3013 ok(
size,
"size not set\n");
3026 ok(
size == size2,
"got %u expected %u\n", size2,
size);
3032 ok(
size,
"size not set\n");
3045 ok(
size == size2,
"got %u expected %u\n", size2,
size);
3047 pBCryptDestroyKey(
key);
3049 ret = pBCryptCloseAlgorithmProvider(
alg, 0);
3050 ok(!
ret,
"BCryptCloseAlgorithmProvider failed: 0x%x\n",
ret);
3055 0x45, 0x43, 0x4b, 0x32, 0x20, 0x00, 0x00, 0x00,
3056 0xfb, 0xbd, 0x3d, 0x20, 0x1b, 0x6d, 0x66, 0xb3, 0x7c, 0x9f, 0x89, 0xf3, 0xe4, 0x41, 0x16, 0xa5,
3057 0x68, 0x52, 0x77, 0xac, 0xab, 0x55, 0xb2, 0x6c, 0xb0, 0x23, 0x55, 0xcb, 0x96, 0x14, 0xfd, 0x0b,
3058 0x1c, 0xef, 0xdf, 0x07, 0x6d, 0x31, 0xaf, 0x39, 0xce, 0x8c, 0x8f, 0x9d, 0x75, 0xd0, 0x7b, 0xea,
3059 0x81, 0xdc, 0x40, 0x21, 0x1f, 0x58, 0x22, 0x5f, 0x72, 0x55, 0xfc, 0x58, 0x8a, 0xeb, 0x88, 0x5d,
3060 0x02, 0x09, 0x90, 0xd2, 0xe3, 0x36, 0xac, 0xfe, 0x83, 0x13, 0x6c, 0x88, 0x1a, 0xab, 0x9b, 0xdd,
3061 0xaa, 0x8a, 0xee, 0x69, 0x9a, 0x6a, 0x62, 0x86, 0x6a, 0x13, 0x69, 0x88, 0xb7, 0xd5, 0xa3, 0xcd
3066 0x45, 0x43, 0x4b, 0x31, 0x20, 0x00, 0x00, 0x00,
3067 0x07, 0x61, 0x9d, 0x49, 0x63, 0x6b, 0x96, 0x94, 0xd1, 0x8f, 0xd1, 0x48, 0xcc, 0xcf, 0x72, 0x4d,
3068 0xff, 0x43, 0xf4, 0x97, 0x0f, 0xa3, 0x8a, 0x72, 0xe9, 0xe0, 0xba, 0x87, 0x6d, 0xc3, 0x62, 0x15,
3069 0xae, 0x65, 0xdd, 0x31, 0x51, 0xfc, 0x3b, 0xc9, 0x59, 0xa1, 0x0a, 0x92, 0x17, 0x2b, 0x64, 0x55,
3070 0x03, 0x3e, 0x62, 0x1d, 0xac, 0x3e, 0x37, 0x40, 0x6a, 0x4c, 0xb6, 0x21, 0x3f, 0x73, 0x5c, 0xf5
3076 0x48, 0xb0, 0x11, 0xdb, 0x69, 0x4e, 0xb4, 0xf4, 0xf5, 0x3e, 0xe1, 0x9b, 0xca, 0x00, 0x04, 0xc8,
3077 0x9b, 0x69, 0xaf, 0xd1, 0xaf, 0x1f, 0xc2, 0xd7, 0x83, 0x0a, 0xb7, 0xf8, 0x4f, 0x24, 0x32, 0x8e,
3098 0x1b, 0xe7, 0xbf, 0x0f, 0x65, 0x1e, 0xd0, 0x07, 0xf9, 0xf4, 0x77, 0x48, 0x48, 0x39, 0xd0, 0xf8,
3099 0xf3, 0xce, 0xfc, 0x89
3120 status = pBCryptFinalizeKeyPair(
key, 0);
3126 ok(
size,
"size not set\n");
3138 pBCryptDestroyKey(
pubkey);
3147 ok(
size,
"size not set\n");
3160 pBCryptDestroyKey(
pubkey);
3161 pBCryptDestroyKey(privkey);
3162 pBCryptDestroyKey(
key);
3170 ok(
size,
"size not set\n");
3189 win_skip(
"BCRYPT_KDF_RAW_SECRET not supported\n");
3190 goto raw_secret_end;
3195 ok(
size == 32,
"size of secret key incorrect, got %u, expected 32\n",
size);
3232 pBCryptDestroySecret(
secret);
3233 pBCryptDestroyKey(
pubkey);
3234 pBCryptDestroyKey(privkey);
3235 pBCryptCloseAlgorithmProvider(
alg, 0);
3245 status = pBCryptFinalizeKeyPair(
key, 0);
3251 ok(
size,
"size not set\n");
3263 pBCryptDestroyKey(
pubkey);
3268 pBCryptDestroyKey(
pubkey);
3269 pBCryptCloseAlgorithmProvider(
alg, 0);
3275 0x44, 0x48, 0x50, 0x42, 0x40, 0x00, 0x00, 0x00,
3277 0xcf, 0x18, 0xe9, 0xa9, 0xb3, 0x97, 0x59, 0xae, 0x0d, 0xac, 0xf0, 0x99, 0x39, 0xdc, 0xd2, 0xfe,
3278 0x1e, 0xf3, 0xfc, 0x2c, 0x49, 0xdf, 0x76, 0x89, 0xff, 0x13, 0x57, 0xc7, 0xe6, 0xbd, 0xed, 0xa7,
3279 0x42, 0xc0, 0xc3, 0xd7, 0x8e, 0x84, 0xa8, 0xdf, 0xcd, 0x52, 0x50, 0x81, 0x73, 0x8a, 0x33, 0x60,
3280 0xde, 0x6d, 0x56, 0xeb, 0xd5, 0xec, 0x1f, 0x9f, 0x9f, 0xd6, 0x2c, 0xe4, 0x8f, 0xab, 0x58, 0x0b,
3282 0x5f, 0xc5, 0x50, 0x9a, 0xde, 0xf6, 0x84, 0x48, 0x39, 0xa9, 0xa7, 0xb1, 0x73, 0x0c, 0x56, 0xd4,
3283 0x28, 0xbb, 0x12, 0x93, 0x51, 0x44, 0x33, 0xdf, 0xa6, 0xe7, 0x7f, 0x0b, 0x3f, 0xe9, 0x41, 0xef,
3284 0x32, 0x80, 0xcd, 0x8e, 0x2b, 0x38, 0x85, 0x49, 0x4d, 0x0c, 0xcc, 0x74, 0x02, 0x07, 0x92, 0xd3,
3285 0xe4, 0x3e, 0x37, 0x84, 0x27, 0x1f, 0xa3, 0xad, 0x94, 0x8c, 0xc1, 0xc2, 0x22, 0x99, 0x36, 0xf0,
3287 0x22, 0xaf, 0x98, 0xeb, 0xd9, 0xc4, 0xb5, 0xbd, 0xe1, 0xab, 0x19, 0x1b, 0xe3, 0x36, 0x20, 0xca,
3288 0xff, 0xe8, 0x6c, 0x30, 0x96, 0x3c, 0x90, 0x77, 0x0e, 0xe0, 0x96, 0xae, 0xb1, 0x47, 0xd1, 0x52,
3289 0x2c, 0xc3, 0x65, 0x5e, 0x9b, 0x41, 0x9a, 0xa6, 0xfe, 0xab, 0x54, 0xa0, 0xf0, 0x71, 0xab, 0x6c,
3290 0xd0, 0x0e, 0x01, 0x08, 0x5b, 0x66, 0xe5, 0x62, 0xd2, 0xe5, 0x5d, 0xae, 0x9c, 0x60, 0xb2, 0xc6,
3296 0x44, 0x48, 0x50, 0x56, 0x40, 0x00, 0x00, 0x00,
3298 0xcf, 0x18, 0xe9, 0xa9, 0xb3, 0x97, 0x59, 0xae, 0x0d, 0xac, 0xf0, 0x99, 0x39, 0xdc, 0xd2, 0xfe,
3299 0x1e, 0xf3, 0xfc, 0x2c, 0x49, 0xdf, 0x76, 0x89, 0xff, 0x13, 0x57, 0xc7, 0xe6, 0xbd, 0xed, 0xa7,
3300 0x42, 0xc0, 0xc3, 0xd7, 0x8e, 0x84, 0xa8, 0xdf, 0xcd, 0x52, 0x50, 0x81, 0x73, 0x8a, 0x33, 0x60,
3301 0xde, 0x6d, 0x56, 0xeb, 0xd5, 0xec, 0x1f, 0x9f, 0x9f, 0xd6, 0x2c, 0xe4, 0x8f, 0xab, 0x58, 0x0b,
3303 0x5f, 0xc5, 0x50, 0x9a, 0xde, 0xf6, 0x84, 0x48, 0x39, 0xa9, 0xa7, 0xb1, 0x73, 0x0c, 0x56, 0xd4,
3304 0x28, 0xbb, 0x12, 0x93, 0x51, 0x44, 0x33, 0xdf, 0xa6, 0xe7, 0x7f, 0x0b, 0x3f, 0xe9, 0x41, 0xef,
3305 0x32, 0x80, 0xcd, 0x8e, 0x2b, 0x38, 0x85, 0x49, 0x4d, 0x0c, 0xcc, 0x74, 0x02, 0x07, 0x92, 0xd3,
3306 0xe4, 0x3e, 0x37, 0x84, 0x27, 0x1f, 0xa3, 0xad, 0x94, 0x8c, 0xc1, 0xc2, 0x22, 0x99, 0x36, 0xf0,
3308 0x22, 0xaf, 0x98, 0xeb, 0xd9, 0xc4, 0xb5, 0xbd, 0xe1, 0xab, 0x19, 0x1b, 0xe3, 0x36, 0x20, 0xca,
3309 0xff, 0xe8, 0x6c, 0x30, 0x96, 0x3c, 0x90, 0x77, 0x0e, 0xe0, 0x96, 0xae, 0xb1, 0x47, 0xd1, 0x52,
3310 0x2c, 0xc3, 0x65, 0x5e, 0x9b, 0x41, 0x9a, 0xa6, 0xfe, 0xab, 0x54, 0xa0, 0xf0, 0x71, 0xab, 0x6c,
3311 0xd0, 0x0e, 0x01, 0x08, 0x5b, 0x66, 0xe5, 0x62, 0xd2, 0xe5, 0x5d, 0xae, 0x9c, 0x60, 0xb2, 0xc6,
3313 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3314 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3315 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x97, 0x71, 0x3e, 0x82,
3316 0x8b, 0xea, 0x11, 0x77, 0xc4, 0xb4, 0x62, 0xc7, 0x4d, 0xff, 0x0f, 0x63, 0xd9, 0xe2, 0xda, 0xab,
3321 0x73, 0x84, 0x62, 0xc1, 0x9a, 0x9c, 0xc2, 0x91, 0x9f, 0xc1, 0xc2, 0x94, 0x0c, 0xa8, 0x2f, 0x58,
3322 0xac, 0x50, 0xcd, 0xd5, 0x29, 0x43, 0x41, 0x8e, 0x5d, 0xca, 0x73, 0x55, 0x4d, 0x46, 0x50, 0xe5,
3323 0xb7, 0x34, 0xa9, 0xcb, 0x3a, 0x18, 0x68, 0x99, 0x30, 0xef, 0x58, 0x26, 0xd3, 0x03, 0x61, 0x02,
3324 0x17, 0xb7, 0xba, 0x01, 0xbc, 0xae, 0xdf, 0x3f, 0xb5, 0xb5, 0x4a, 0xb0, 0x08, 0xe5, 0xea, 0xc3,
3329 0xa7, 0xfc, 0xff, 0x21, 0xb3, 0xd1, 0x46, 0xb8, 0x21, 0x3d, 0xc6, 0xd4, 0xe3, 0x61, 0x97, 0x5e,
3330 0xb5, 0x0a, 0xfe, 0x8f,
3370 status = pBCryptFinalizeKeyPair(
key, 0);
3374 pBCryptDestroyKey(
key);
3381 ok(
size,
"size not set\n");
3394 pBCryptDestroyKey(
pubkey);
3399 ok(
size ==
sizeof(*dhkey) + 64 * 4,
"size not set\n");
3408 pBCryptDestroyKey(
key);
3413 pBCryptDestroyKey(privkey);
3422 ok(
size,
"size not set\n");
3438 ok(
size,
"size not set\n");
3455 pBCryptDestroyKey(
pubkey);
3456 pBCryptDestroyKey(privkey);
3462 win_skip(
"BCRYPT_KDF_RAW_SECRET not supported\n");
3463 pBCryptDestroySecret(
secret);
3501 pBCryptDestroySecret(
secret);
3504#ifndef NCRYPT_SCHANNEL_INTERFACE
3505#define NCRYPT_SCHANNEL_INTERFACE 0x00010002
3521 0x52, 0x53, 0x41, 0x31, 0x00, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
3522 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0xd5, 0xfe, 0xf6, 0x7a, 0x9a, 0xa1, 0x2d, 0xcf, 0x98,
3523 0x60, 0xca, 0x38, 0x60, 0x0b, 0x74, 0x4c, 0x7e, 0xa1, 0x42, 0x64, 0xad, 0x05, 0xa5, 0x29, 0x25, 0xcb, 0xd5,
3524 0x9c, 0xaf, 0x6f, 0x63, 0x85, 0x6d, 0x5b, 0x59, 0xe5, 0x17, 0x8f, 0xf9, 0x18, 0x90, 0xa7, 0x63, 0xae, 0xe0,
3525 0x3a, 0x62, 0xf7, 0x98, 0x57, 0xe9, 0x91, 0xda, 0xfb, 0xd9, 0x36, 0x45, 0xe4, 0x9e, 0x75, 0xf6, 0x73, 0xc4,
3526 0x99, 0x23, 0x21, 0x1b, 0x3d, 0xe1, 0xe0, 0xa6, 0xa0, 0x4a, 0x50, 0x2a, 0xcb, 0x2a, 0x50, 0xf0, 0x8b, 0x70,
3527 0x9c, 0xe4, 0x1a, 0x14, 0x3b, 0xbe, 0x35, 0xa5, 0x5a, 0x91, 0xa3, 0xa1, 0x82, 0xea, 0x84, 0x4d, 0xe8, 0x62,
3528 0x3b, 0x11, 0xec, 0x61, 0x09, 0x6c, 0xfe, 0xb2, 0xcc, 0x4b, 0xa8, 0xff, 0xaf, 0x73, 0x72, 0x05, 0x4e, 0x7e,
3529 0xe5, 0x73, 0xdf, 0x24, 0xcf, 0x7f, 0x5d, 0xaf, 0x8a, 0xf0, 0xd8, 0xcb, 0x08, 0x1e, 0xf2, 0x36, 0x70, 0x8d,
3530 0x1b, 0x9e, 0xc8, 0x98, 0x60, 0x54, 0xeb, 0x45, 0x34, 0x21, 0x43, 0x4d, 0x42, 0x0a, 0x3a, 0x2d, 0x0f, 0x0e,
3531 0xd6, 0x0d, 0xe4, 0x2e, 0x8c, 0x31, 0x87, 0xa8, 0x09, 0x89, 0x61, 0x16, 0xca, 0x5b, 0xbe, 0x76, 0x69, 0xbb,
3532 0xfd, 0x91, 0x63, 0xd2, 0x66, 0x57, 0x08, 0xef, 0xe2, 0x40, 0x67, 0xd7, 0x7f, 0x50, 0x15, 0x42, 0x33, 0x97,
3533 0x54, 0x73, 0x47, 0xe7, 0x9c, 0x14, 0xa8, 0xb0, 0x3d, 0xc9, 0x23, 0xb0, 0x27, 0x3b, 0xe7, 0xdd, 0x5f, 0xd1,
3534 0x4f, 0x31, 0x10, 0x7d, 0xdd, 0x69, 0x8e, 0xde, 0xa3, 0xe8, 0x92, 0x00, 0xfa, 0xa5, 0xa4, 0x40, 0x51, 0x23,
3535 0x82, 0x84, 0xc7, 0xce, 0x19, 0x61, 0x26, 0xf1, 0xae, 0xf3, 0x90, 0x93, 0x98, 0x56, 0x23, 0x9a, 0xd1, 0xbd,
3536 0xf2, 0xdf, 0xfd, 0x13, 0x9c, 0x30, 0x07, 0xf9, 0x5a, 0x2e, 0x00, 0xc6, 0x1f
3542 {0x7e,0xe3,0x74,0xe7,0xc5,0x0b,0x6b,0x70,0xdb,0xab,0x32,0x6d,0x1d,0x51,0xd6,0x74,0x79,0x8e,0x5b,0x4b};
3543 static UCHAR hash_sha256[] =
3544 {0x25,0x2f,0x10,0xc8,0x36,0x10,0xeb,0xca,0x1a,0x05,0x9c,0x0b,0xae,0x82,0x55,0xeb,0xa2,0xf9,0x5b,0xe4,
3545 0xd1,0xd7,0xbC,0xfA,0x89,0xd7,0x24,0x8a,0x82,0xd9,0xf1,0x11};
3575 ret = pBCryptDestroyKey(
key);
3578 ret = pBCryptGenerateKeyPair(
alg, &
key, 512, 0);
3581 ret = pBCryptFinalizeKeyPair(
key, 0);
3584 ret = pBCryptFinalizeKeyPair(
key, 0);
3588 memset(sig, 0,
sizeof(sig));
3604 ret = pBCryptDestroyKey(
key);
3607 ret = pBCryptCloseAlgorithmProvider(
alg, 0);
3614 ret = pBCryptGenerateKeyPair(
alg, &
key, 256, 0);
3617 ret = pBCryptFinalizeKeyPair(
key, 0);
3620 memset(sig, 0,
sizeof(sig));
3635 ret = pBCryptDestroyKey(
key);
3638 ret = pBCryptCloseAlgorithmProvider(
alg, 0);
3666 pBCryptFreeBuffer(
list );
3676 pBCryptFreeBuffer(
list );
3681 static const UCHAR secret[] = {0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10};
3682 static const UCHAR expect[] = {0xb0,0xcb,0xf5,0x80,0xd4,0xe3,0x55,0x23,0x6e,0x19,0x5b,0xdb,0xfe,0xe0,0x6c,0xd3};
3683 static const UCHAR expect2[] = {0x06,0x0c,0x81,0xab,0xd4,0x28,0x80,0x42,0xce,0x30,0x56,0x17,0x15,0x00,0x9e,0xc1};
3684 static const UCHAR expect3[] = {0x3e,0x99,0xbf,0x02,0xf5,0xd3,0xb8,0x81,0x91,0x4d,0x93,0xea,0xd4,0x92,0x93,0x46};
3685 static UCHAR iv[16],
input[] = {
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'i',
'j',
'k',
'l',
'm',
'n',
'o',
'p'};
3711 memset(output, 0,
sizeof(output));
3719 memset(output, 0,
sizeof(output));
3728 memset(output, 0,
sizeof(output));
3732 ok(!
memcmp(output, expect3,
sizeof(expect3)),
"wrong cipher text\n");
3734 ret = pBCryptDestroyKey(
key);
3737 ret = pBCryptCloseAlgorithmProvider(
alg, 0);
3744 {0xda,0x39,0xa3,0xee,0x5e,0x6b,0x4b,0x0d,0x32,0x55,0xbf,0xef,0x95,0x60,0x18,0x90,0xaf,0xd8,0x07,0x09};
3746 {0x9b,0x03,0x17,0x41,0xf4,0x75,0x11,0xac,0xff,0x22,0xee,0x40,0xbb,0xe8,0xf9,0x74,0x17,0x26,0xb6,0xf2,
3747 0xf8,0xc7,0x88,0x02,0x9a,0xdc,0x0d,0xd7,0x83,0x58,0xea,0x65,0x2e,0x8b,0x85,0xc6,0xdb,0xb7,0xed,0x1c};
3765 ret = pBCryptDestroyHash(
hash);
3774 ret = pBCryptDestroyHash(
hash);
3786 ret = pBCryptDestroyHash(
hash);
3803 ret = pBCryptDestroyHash(
hash);
3818 ret = pBCryptCloseAlgorithmProvider(
alg, 0);
3824 0x7e,0xe3,0x74,0xe7,0xc5,0x0b,0x6b,0x70,0xdb,0xab,0x32,0x6d,0x1d,0x51,0xd6,0x74,0x79,0x8e,0x5b,0x4b
3829 0x5f,0x95,0x1f,0x08,0x19,0x44,0xa5,0xab,0x28,0x11,0x51,0x68,0x82,0x9b,0xe4,0xc3,0x04,0x1b,0xc9,0xdc,
3830 0x41,0x2a,0x89,0xd4,0x4a,0x8b,0x86,0xaf,0x98,0x2c,0x59,0x0b,0xd2,0x88,0xf6,0xe8,0x29,0x13,0x84,0x49
3835 0x44,0x53,0x50,0x42,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x8f,0xd2,0x92,0xbb,0x92,0xb9,0x00,0xc5,0xed,
3836 0x52,0xcc,0x48,0x4a,0x44,0x1d,0xd3,0x74,0xfb,0x75,0xd1,0x7e,0xb6,0x24,0x9b,0x5d,0x57,0x0a,0x8a,0xc4,
3837 0x5d,0xab,0x9c,0x26,0x86,0xc6,0x25,0x16,0x20,0xf9,0xa9,0x71,0xbc,0x1d,0x30,0xc4,0xef,0x8c,0xc4,0xdf,
3838 0x1a,0xaf,0x96,0xdf,0x90,0xd8,0x85,0x9d,0xf9,0x2c,0x86,0x8c,0x91,0x39,0x6c,0x6d,0x11,0x4e,0x53,0x63,
3839 0x2a,0x2b,0x26,0xa7,0xf9,0x76,0x74,0x51,0xbf,0x08,0x87,0x6f,0xe0,0x71,0x91,0x24,0x8a,0xc2,0x84,0x2d,
3840 0x84,0x9c,0x5f,0x94,0xaa,0x38,0x53,0x77,0x84,0xba,0xbc,0xff,0x49,0x3a,0x08,0x0f,0x38,0xb5,0x91,0x5c,
3841 0x06,0x15,0xa4,0x27,0xf4,0xa5,0x59,0xaa,0x1c,0x41,0xa3,0xa0,0xbb,0xf7,0x32,0x86,0xfb,0x94,0x41,0xff,
3842 0xcd,0xed,0x69,0xeb,0xc6,0x5e,0xb6,0xa8,0x15,0x82,0x3b,0x60,0x1e,0x91,0x55,0xd5,0x2c,0xa5,0x74,0x5a,
3843 0x65,0x8f,0xc6,0x56,0xc4,0x3f,0x4e,0xe3,0x3a,0x71,0xb2,0x63,0x66,0xa4,0x0d,0x0d,0xf9,0xdd,0x1e,0x48,
3844 0x81,0xe9,0xbf,0x8f,0xbb,0x85,0x47,0x81,0x68,0x11,0xb5,0x91,0x6b,0xc4,0x05,0xef,0xa3,0xc7,0xbf,0x26,
3845 0x53,0x4f,0xc4,0x10,0xfd,0xfa,0xed,0x61,0x64,0xd6,0x2e,0xad,0x04,0x3e,0x82,0xed,0xb2,0x22,0x76,0xd0,
3846 0x44,0xad,0xc1,0x4c,0xde,0x33,0xa3,0x61,0x55,0xec,0x24,0xe5,0x79,0x45,0xcf,0x94,0x39,0x92,0x9f,0xd8,
3852 0x07,0x02,0x00,0x00,0x00,0x22,0x00,0x00,0x44,0x53,0x53,0x32,0x00,0x04,0x00,0x00,0x01,0xd1,0xfc,0x7a,
3853 0x70,0x53,0xb2,0x48,0x70,0x23,0x19,0x1f,0x3c,0xe1,0x26,0x14,0x7e,0x9f,0x0f,0x7f,0x33,0x5e,0x2b,0xf7,
3854 0xca,0x01,0x74,0x8c,0xb4,0xfd,0xf6,0x44,0x95,0x35,0x56,0xaa,0x4d,0x62,0x48,0xe2,0xd1,0xa2,0x7e,0x6e,
3855 0xeb,0xd6,0xcc,0x7c,0xe8,0xfd,0x21,0x9a,0xa2,0xfd,0x7a,0x9d,0x1a,0x38,0x69,0x87,0x39,0x5a,0x91,0xc0,
3856 0x52,0x2b,0x9f,0x2a,0x54,0x78,0x37,0x82,0x9a,0x70,0x57,0xab,0xec,0x93,0x8e,0xac,0x73,0x04,0xe8,0x53,
3857 0x72,0x72,0x32,0xc6,0xcb,0xef,0x47,0x98,0x3c,0x56,0x49,0x62,0xcb,0xbb,0xe7,0x34,0x84,0xa6,0x72,0x3a,
3858 0xbe,0x26,0x46,0x86,0xca,0xcb,0x35,0x62,0x4f,0x19,0x18,0x0b,0xb0,0x78,0xae,0xd5,0x42,0xdf,0x26,0xdb,
3859 0x85,0x63,0x77,0x85,0x01,0x3b,0x32,0xbe,0x5c,0xf8,0x05,0xc8,0xde,0x17,0x7f,0xb9,0x03,0x82,0xfa,0xf1,
3860 0x9e,0x32,0x73,0xfa,0x8d,0xea,0xa3,0x30,0x48,0xe2,0xdf,0x5a,0xcb,0x83,0x3d,0xff,0x56,0xe9,0xc0,0x94,
3861 0xf8,0x6d,0xb3,0xaf,0x4a,0x97,0xb9,0x43,0x0e,0xd4,0x28,0x98,0x57,0x2e,0x3a,0xca,0xde,0x6f,0x45,0x0d,
3862 0xfb,0x58,0xec,0x78,0x34,0x2e,0x46,0x4d,0xfe,0x98,0x02,0xbb,0xef,0x07,0x1a,0x13,0xb6,0xc2,0x2c,0x06,
3863 0xd9,0x0c,0xc4,0xb0,0x4c,0x3a,0xfc,0x01,0x63,0xb5,0x5a,0x5d,0x2d,0x9c,0x47,0x04,0x67,0x51,0xf2,0x52,
3864 0xf5,0x82,0x36,0xeb,0x6e,0x66,0x58,0x4c,0x10,0x2c,0x29,0x72,0x4a,0x6f,0x6b,0x6c,0xe0,0x93,0x31,0x42,
3865 0xf6,0xda,0xfa,0x5b,0x22,0x43,0x9b,0x1a,0x98,0x71,0xe7,0x41,0x74,0xe9,0x12,0xa4,0x1f,0x27,0x0a,0x63,
3866 0x94,0x49,0xd7,0xad,0xa5,0xc4,0x5c,0xc3,0xc9,0x70,0xb3,0x7b,0x16,0xb6,0x1d,0xd4,0x09,0xc4,0x9a,0x46,
3867 0x2d,0x0e,0x75,0x07,0x31,0x7b,0xed,0x45,0xcd,0x99,0x84,0x14,0xf1,0x01,0x00,0x00,0x93,0xd5,0xa3,0xe4,
3868 0x34,0x05,0xeb,0x98,0x3b,0x5f,0x2f,0x11,0xa4,0xa5,0xc4,0xff,0xfb,0x22,0x7c,0x54
3876 UCHAR sig[40], schemes;
3884 ret = pBCryptGetProperty(
alg,
L"PaddingSchemes", (
UCHAR *)&schemes,
sizeof(schemes), &
size, 0);
3891 win_skip(
"BCRYPT_DSA_ALGORITHM not supported\n");
3894 pBCryptDestroyKey(
key);
3899 memset(buf2, 0xcc,
sizeof(buf2));
3913 ret = pBCryptDestroyKey(
key);
3917 ret = pBCryptGenerateKeyPair(
alg, &
key, 512, 0);
3920 ret = pBCryptFinalizeKeyPair(
key, 0);
3924 memset(sig, 0,
sizeof(sig));
3932 ok(
size,
"size not set\n");
3942 ret = pBCryptDestroyKey(
key);
3951 ret = pBCryptDestroyKey(
key);
3960 ok(
size,
"size not set\n");
3969 ret = pBCryptDestroyKey(
key);
3972 ret = pBCryptCloseAlgorithmProvider(
alg, 0);
3993 static const ULONG dh_private_key[] =
3995 0xc4caf69c, 0x57b4db27, 0x36f7135f, 0x5ccba686, 0xc37b8819, 0x1d35c9b2, 0xbb07a1cf, 0x0c5d1c1b,
3996 0xc79acb10, 0x31dfdabb, 0x702e02b9, 0x1efab345, 0x262a8074, 0x5edf7698, 0x9b9dc630, 0x13c34b93,
3997 0xacbc928b, 0xb79eed8c, 0x7413dce9, 0xa5521280, 0x88d8e695, 0xa310269f, 0xca7c5719, 0xcd0c775b,
3998 0x9a6e2cf2, 0x9e235c51, 0xf49db62d, 0x28e72424, 0x4a44da5a, 0x3d98268d, 0x8e4d2be3, 0x254e44e6,
4000 0x18a67e55, 0x572e13a1, 0x46f81ca8, 0xc331c9b9, 0xf8fe3dd4, 0x8a889e5a, 0x6c0505fd, 0xbd97a121,
4001 0xed2dbd67, 0xf39efa8e, 0x36f9c287, 0xf6bbfa6c, 0x461e42ad, 0x17dc170e, 0xc002dc2e, 0x4813d9a4,
4002 0x0b6fabb8, 0x6a9e1860, 0xa8a8cbd9, 0xb7ed6b5d, 0xabb34d23, 0xf2fbe1fd, 0x8670df1e, 0xba7fa4e6,
4003 0xf7039712, 0x94448f30, 0xe10c812e, 0x3e311976, 0xcfdd72c4, 0xbdbea98f, 0xc9a540d6, 0x89646d57,
4005 0x7ab63b33, 0x03a1e9b6, 0x947f7a9b, 0x5ae59eeb, 0x1d12eb05, 0x3f425d92, 0xe028c6ba, 0xbf90ddc9,
4006 0xb554f55a, 0x7aeb88b6, 0x4a443a5f, 0xbab35111, 0x82c78a0c, 0x298dd482, 0x02937cb1, 0xc94cdc2e,
4007 0x59b010eb, 0x3bbc0a2b, 0xd845fee0, 0x04c1d0db, 0x0c8c9424, 0x1cafd4b2, 0x9aa7aed9, 0x6a478486,
4008 0xa8841fd7, 0xbfeff40a, 0x8fd7bcc5, 0x3bb28977, 0x2b9a7955, 0xa55cd2e4, 0x1b6ad657, 0x067cdf21,
4010 0x06f36920, 0x63280e1b, 0xf17d930f, 0xa06e74a8, 0x463b3a6f, 0x2a464507, 0x93f8a982, 0x8f620a7d,
4011 0xeda32d11, 0x9706a6d4, 0x33dce588, 0x75a1c446, 0x048ab567, 0xd735aafa, 0x806f7c1c, 0xdcb9651a,
4012 0x26acf3b4, 0x45f91cc9, 0x2a0de6fc, 0xf3c03d0c, 0xf5aee0aa, 0x3eeaaf36, 0x18ccee61, 0x83faa783,
4013 0x4b2b5250, 0xf4ccea22, 0x5ac0714b, 0x3f0b2bc6, 0x481b13ce, 0x12040ea7, 0x66e0bbed, 0x158e1a67,
4015 static const ULONG dh_private_key2[] =
4017 0xffffffff, 0xffffffff, 0xa2da0fc9, 0x34c26821, 0x8b62c6c4, 0xd11cdc80, 0x084e0229, 0x74cc678a,
4018 0xa6be0b02, 0x229b133b, 0x79084a51, 0xdd04348e, 0xb31995ef, 0x1b433acd, 0x6d0a2b30, 0x37145ff2,
4019 0x6d35e14f, 0x45c2516d, 0x76b585e4, 0xc67e5e62, 0xe9424cf4, 0x6bed37a6, 0xb65cff0b, 0xedb706f4,
4020 0xfb6b38ee, 0xa59f895a, 0x11249fae, 0xe61f4b7c, 0x51662849, 0x8153e6ec, 0xffffffff, 0xffffffff,
4022 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4023 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4024 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4025 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000000,
4027 0xa0c3c734, 0xc130c92d, 0x5265abf8, 0xff409f17, 0xbcdce187, 0xff64dae3, 0x170560aa, 0xb2423ed8,
4028 0x9ee5a8b9, 0x92548030, 0x02bba1f9, 0x823e39a4, 0x69c438f5, 0xf91016ac, 0x89bfd166, 0x7f996446,
4029 0x86224203, 0x15bf689c, 0x619354a4, 0x0c1d3a1f, 0x11bcf3d2, 0x58aae029, 0x41c69824, 0x3fafc179,
4030 0xa742747c, 0x60658c7a, 0xd3b0bde4, 0x78d3f08b, 0x6cefa061, 0x33752536, 0xe84d4901, 0x48cd73f4,
4032 0x8d449700, 0x1f95120e, 0xceb31745, 0x3663177b, 0xbd9bb2d5, 0x9c23c0d9, 0x814d34f8, 0xbc54edb0,
4033 0xb874659a, 0x3bac8a30, 0xa1f3dd46, 0x1705c900, 0xbc46fefe, 0x7d13875b, 0x3064351a, 0x4bd89a1c,
4034 0x9e938761, 0x931949db, 0x34490719, 0x84fb08ca, 0xa9dd355a, 0x5b3f5061, 0x2ac96663, 0xc594429e,
4035 0xbe58395d, 0x2f7d872a, 0x303d37b3, 0xa3a9b606, 0x735a6732, 0xa095bd95, 0x3d55a7c3, 0x00e54635,
4037 static const ULONG dh_peer_key[] =
4039 0xffffffff, 0xffffffff, 0xa2da0fc9, 0x34c26821, 0x8b62c6c4, 0xd11cdc80, 0x084e0229, 0x74cc678a,
4040 0xa6be0b02, 0x229b133b, 0x79084a51, 0xdd04348e, 0xb31995ef, 0x1b433acd, 0x6d0a2b30, 0x37145ff2,
4041 0x6d35e14f, 0x45c2516d, 0x76b585e4, 0xc67e5e62, 0xe9424cf4, 0x6bed37a6, 0xb65cff0b, 0xedb706f4,
4042 0xfb6b38ee, 0xa59f895a, 0x11249fae, 0xe61f4b7c, 0x51662849, 0x8153e6ec, 0xffffffff, 0xffffffff,
4044 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4045 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4046 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4047 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000000,
4049 0x3bf7404b, 0x6284fffe, 0x97c0d565, 0xd830c658, 0xcc21bf39, 0xcae45bb6, 0x019df7df, 0xbf4cd293,
4050 0x6bf1989d, 0x78a81f52, 0xa4ed861c, 0x6bacf493, 0xa3e700d1, 0xd06cc206, 0x411b9727, 0x01e9c9ab,
4051 0x9b7e6efa, 0xf46bb25d, 0xd1027242, 0x6130787c, 0xa7b87d8b, 0xfee41492, 0x50db6213, 0x321199b6,
4052 0x7dace53a, 0xe8b1ec51, 0x2181b113, 0x3b33e3c0, 0x5b3a2d67, 0xbd34f0c1, 0x7037c542, 0x4a8d5540,
4054 static const ULONG dh_shared_secret_raw[] =
4056 0x375d89b5, 0x35a9c270, 0xfbc5ba82, 0x09eb3069, 0xd50965b0, 0xace510f7, 0x981e8731, 0x80a76115,
4057 0xf386d348, 0xca17b8df, 0x0b0e84ec, 0xf81f756e, 0x5030fa20, 0x03113b71, 0x97b7e879, 0x899b5fae,
4058 0xe6913299, 0x09270076, 0x39bc813a, 0xde3ef070, 0x65ad5b3a, 0x2b7c4ba4, 0x86c98ef9, 0x3236feaf,
4059 0x3e0253f7, 0x0489d2dd, 0x97669a3d, 0x50242fca, 0x5d4aecb1, 0xcf2d805f, 0x2258afff, 0x750e92cd,
4061 static const ULONG dh_shared_secret_raw2[] =
4063 0x0815f37d, 0x19ee74ab, 0x9f63f123, 0xe1b3f10c, 0xbcc9be83, 0xaddf5b9d, 0x28174e72, 0xf8a33825,
4064 0xfc74e47d, 0x2c950888, 0xf5b776d9, 0xfc712fef, 0x5b213b32, 0x489a9829, 0xfc0a4d1d, 0x6e641d3b,
4065 0x3bb2ff57, 0x63500318, 0x081ee54f, 0xf33a2805, 0xb3759e98, 0xa9a64afe, 0x964b8897, 0x04691bbc,
4066 0x80f4aae1, 0x617405ee, 0xab71724d, 0x6c10c214, 0x6f60b96f, 0xdc777b0b, 0x22f40d4f, 0x8a1c4eb5,
4068 static const ULONG dh_shared_secret_sha1[] =
4070 0x0babba9c, 0x0bdeacbd, 0x04e36574, 0xdd504dcd, 0x0cd88db0,
4072 static const ULONG dh_shared_secret_sha256[] =
4074 0x3213db5b, 0x8cc8250b, 0xc829eaab, 0x00933709, 0x68160aa9, 0xfb9f1e20, 0xf92368e6, 0x2b8e18eb,
4094 status = pBCryptFinalizeKeyPair(
key, 0);
4140 status = pBCryptCloseAlgorithmProvider(
alg, 0);
4152 status = pBCryptFinalizeKeyPair(
key, 0);
4156 pBCryptCloseAlgorithmProvider(
alg, 0);
4188 status = pBCryptFinalizeKeyPair(
key, 0);
4191 pBCryptDestroyKey(
key);
4192 pBCryptCloseAlgorithmProvider(
alg, 0);
4197 status = pBCryptFinalizeKeyPair(
key, 0);
4216 ok(dh_header->
cbLength ==
sizeof(*dh_header) +
length / 8 * 2,
"Got unexpected length %u.\n", dh_header->
cbLength);
4226 memcpy(dh_key_blob + 1, dh_private_key,
sizeof(dh_private_key));
4230 size =
sizeof(*dh_key_blob) +
length / 8 * 4;
4246 ok(dh_key_blob->
cbKey ==
length / 8,
"Got unexpected length %u.\n", dh_key_blob->
cbKey);
4247 ok(!
memcmp(dh_key_blob + 1, dh_private_key,
length / 8 * 3),
"Key data does not match.\n");
4258 status = pBCryptFinalizeKeyPair(key2, 0);
4265 ok(dh_key_blob->
cbKey ==
length / 8,
"Got unexpected length %u.\n", dh_key_blob->
cbKey);
4268 "Random public key data matches.\n");
4276 ok(dh_key_blob->
cbKey ==
length / 8,
"Got unexpected length %u.\n", dh_key_blob->
cbKey);
4277 ok(!
memcmp(dh_key_blob + 1, dh_private_key,
length / 8 * 4),
"Private key data does not match.\n");
4303 ok(
size == 20,
"Got unexpected size %u.\n",
size);
4313 ok(!
memcmp(
buffer, dh_shared_secret_raw,
size),
"Raw shared secret data does not match.\n");
4319 ok(
size == 20,
"Got unexpected size %u.\n",
size);
4320 ok(!
memcmp(
buffer, dh_shared_secret_sha1,
sizeof(dh_shared_secret_sha1)),
4321 "sha1 shared secret data does not match.\n");
4326 ok(
size == 32,
"Got unexpected size %u.\n",
size);
4327 ok(!
memcmp(
buffer, dh_shared_secret_sha256,
sizeof(dh_shared_secret_sha256)),
4328 "sha256 shared secret data does not match.\n");
4355 status = pBCryptDestroyKey(key2);
4361 memcpy(dh_key_blob + 1, dh_private_key2,
sizeof(dh_private_key2));
4363 size =
sizeof(*dh_key_blob) +
length / 8 * 4;
4370 memcpy(dh_key_blob + 1, dh_peer_key,
sizeof(dh_peer_key));
4372 size =
sizeof(*dh_key_blob) +
length / 8 * 3;
4382 ok(!
memcmp(
buffer, dh_shared_secret_raw2,
size),
"Raw shared secret data does not match.\n");
4388 status = pBCryptDestroyKey(key2);
4391 status = pBCryptCloseAlgorithmProvider(
alg, 0);
4407 ok(
len,
"expected non-zero len\n");
4420 status = pBCryptCloseAlgorithmProvider(
alg, 0);
4426 static char salt[] =
"cCxuHMEHLibcglJOG88dIw==";
4443 (
void *)&iter_count,
4450 pbkdf2_param_buffers,
4452 static UCHAR pbkdf2_hash[] =
4454 0x18, 0xf2, 0x58, 0x0b, 0x92, 0x6e, 0x6d, 0xfe,
4455 0x55, 0xbb, 0x62, 0x87, 0x5b, 0x1f, 0x61, 0x83,
4456 0x4d, 0x16, 0xe4, 0x04, 0xcd, 0xab, 0x43, 0x77,
4457 0x25, 0x3e, 0x1d, 0xb4, 0x95, 0x5f, 0xf7, 0x01,
4470 win_skip(
"PBKDF2 not available\n");
4474 ok(pBCryptKeyDerivation !=
NULL,
"BCryptKeyDerivation not available\n");
4486 memset(&key_lengths, 0xfe,
sizeof(key_lengths));
4490 ok(
size ==
sizeof(key_lengths),
"got %u\n",
size);
4510 ok(
buf[0] == pbkdf2_hash[0],
"buf[0] = %x\n",
buf[0]);
4511 ok(
buf[1] ==
'x',
"buf[1] = %x\n",
buf[1]);
4517 ok(!
memcmp(
buf, pbkdf2_hash,
sizeof(pbkdf2_hash)),
4522 status = pBCryptCloseAlgorithmProvider(
alg, 0);
4533 win_skip(
"bcrypt.dll not found\n");
4538 pBCryptCloseAlgorithmProvider = (
void *)
GetProcAddress(
module,
"BCryptCloseAlgorithmProvider");
static unsigned char bytes[4]
#define InterlockedIncrement
static void test_BCryptDecrypt(void)
BCryptBufferDesc hash_params
static BYTE ecdh_pubkey[]
static void test_key_import_export(void)
static UCHAR long_password[]
static UCHAR rsaFullPrivateBlob[]
static void test_DH(void)
static BCRYPT_HASH_HANDLE PUCHAR
static void test_ECDH(void)
static void test_BCryptEnumAlgorithms(void)
static LONG encrypt_race_start_barrier
static void test_aes_vector(void)
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 struct @1815 rsaLegacyPrivateBlob
#define test_alg_name(a, b)
static BYTE certSignature[]
static BYTE hashed_secret[]
static void test_BCryptSignHash(void)
static UCHAR rsaPrivateBlob[]
static void test_RSA(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 @1814 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 void test_BcryptDeriveKeyCapi(void)
static void _test_object_length(unsigned line, void *handle)
static UCHAR rsaSignature[]
#define test_object_length(a)
static void test_BCryptEncrypt(void)
static void test_rng(void)
static BYTE dh_hashed_secret[]
#define NCRYPT_SCHANNEL_INTERFACE
static void test_3des(void)
static void test_SecretAgreement(void)
BCryptBuffer hash_param_buffers[]
static void test_RC4(void)
static const WCHAR ULONG CRYPT_CONTEXT_FUNCTIONS **static void test_BCryptGenRandom(void)
static void test_BCryptGenerateSymmetricKey(void)
static void _test_hash_length(unsigned line, void *handle, ULONG exlen)
static BYTE ecdh_secret[]
static DWORD WINAPI encrypt_race_thread(void *parameter)
static void test_hashes(void)
static void test_PBKDF2(void)
PVOID BCRYPT_SECRET_HANDLE
#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_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_ECCPUBLIC_BLOB
#define BCRYPT_RSA_ALGORITHM
#define BCRYPT_ECDH_PUBLIC_P384_MAGIC
#define BCRYPT_OBJECT_LENGTH
#define BCRYPT_RC4_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 BCRYPTBUFFER_VERSION
#define BCRYPT_RNG_USE_ENTROPY_IN_BUFFER
#define BCRYPT_DH_ALG_HANDLE
#define BCRYPT_AES_ALGORITHM
#define BCRYPT_PBKDF2_ALGORITHM
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 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_CIPHER_OPERATION
#define BCRYPT_ECDSA_P256_ALGORITHM
#define BCRYPT_RNG_ALGORITHM
#define BCRYPT_AES_WRAP_KEY_BLOB
struct _BCRYPT_RSAKEY_BLOB BCRYPT_RSAKEY_BLOB
#define BCRYPT_DSA_PRIVATE_BLOB
#define BCRYPT_HASH_LENGTH
#define BCRYPT_ECDSA_PRIVATE_P256_MAGIC
#define BCRYPT_KDF_RAW_SECRET
#define BCRYPT_BLOCK_PADDING
#define BCRYPT_MD5_ALG_HANDLE
#define BCRYPT_DH_PARAMETERS_MAGIC
#define BCRYPT_RSAPUBLIC_MAGIC
#define BCRYPT_HASH_REUSABLE_FLAG
#define BCRYPT_KEY_DATA_BLOB_VERSION1
#define MS_PRIMITIVE_PROVIDER
#define BCRYPT_DH_PRIVATE_BLOB
#define BCRYPT_ECDH_P256_ALGORITHM
#define BCRYPT_ASYMMETRIC_ENCRYPTION_OPERATION
#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_CHAIN_MODE_ECB
#define BCRYPT_SHA1_ALGORITHM
#define BCRYPT_RSAFULLPRIVATE_BLOB
#define BCRYPT_AES_CBC_ALG_HANDLE
#define BCRYPT_MD5_ALGORITHM
#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
#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 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
#define memcpy(s1, s2, n)
static struct test_info tests[]
#define expect2(expected1, expected2, got1, got2)
#define STATUS_INTERNAL_ERROR
#define STATUS_AUTH_TAG_MISMATCH
#define STATUS_INVALID_BUFFER_SIZE
#define STATUS_INVALID_SIGNATURE
#define STATUS_BUFFER_TOO_SMALL
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
#define STATUS_ACCESS_DENIED
#define STATUS_INVALID_PARAMETER
#define HKEY_LOCAL_MACHINE