34 r = (
r << 32) | rand();
38 static const uint8_t
test_key[] = { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 };
44 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
45 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0x01,
46 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0x01, 0x23
52 int delay = cbc && !decrypt ? 2 : 1;
62 return res == 0xc5cecf63ecec514cULL;
64 return res == 0xcb191f85d1ed8439ULL;
67 return res == 0x8325397644091a0aULL;
69 return res == 0xdd17e8b8b437d232ULL;
83 uint64_t roundkeys[16];
95 printf(
"Public API decryption failed\n");
99 printf(
"Partial Monte-Carlo test failed\n");
102 for (
i = 0;
i < 1000;
i++) {
112 printf(
"Test 2 failed\n");
117 printf(
"static const uint32_t S_boxes_P_shuffle[8][64] = {\n");
118 for (
i = 0;
i < 8;
i++) {
121 for (j = 0; j < 64; j++) {
122 uint32_t v = S_boxes[
i][j >> 1];
123 v = j & 1 ? v >> 4 : v & 0xf;
125 v =
shuffle(v, P_shuffle,
sizeof(P_shuffle));
126 printf((j & 7) == 0 ?
"\n " :
" ");