33 r = (
r << 32) | rand();
37 static const uint8_t test_key[] = { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 };
43 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
44 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0x01,
45 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0x01, 0x23
51 int delay = cbc && !decrypt ? 2 : 1;
61 return res == 0xc5cecf63ecec514cULL;
63 return res == 0xcb191f85d1ed8439ULL;
66 return res == 0x8325397644091a0aULL;
68 return res == 0xdd17e8b8b437d232ULL;
82 uint64_t roundkeys[16];
94 printf(
"Public API decryption failed\n");
98 printf(
"Partial Monte-Carlo test failed\n");
101 for (
i = 0;
i < 1000;
i++) {
111 printf(
"Test 2 failed\n");
116 printf(
"static const uint32_t S_boxes_P_shuffle[8][64] = {\n");
117 for (
i = 0;
i < 8;
i++) {
120 for (j = 0; j < 64; j++) {
121 uint32_t v = S_boxes[
i][j >> 1];
122 v = j & 1 ? v >> 4 : v & 0xf;
124 v =
shuffle(v, P_shuffle,
sizeof(P_shuffle));
125 printf((j & 7) == 0 ?
"\n " :
" ");