29 int main(
int argc,
char** argv)
32 static const uint8_t Key[3][16] = {
33 {0x01, 0x23, 0x45, 0x67, 0x12, 0x34, 0x56, 0x78, 0x23, 0x45, 0x67, 0x89, 0x34, 0x56, 0x78, 0x9a},
34 {0x01, 0x23, 0x45, 0x67, 0x12, 0x34, 0x56, 0x78, 0x23, 0x45},
35 {0x01, 0x23, 0x45, 0x67, 0x12}
37 static const uint8_t rpt[8] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef};
38 static const uint8_t rct[3][8] = {
39 {0x23, 0x8b, 0x4f, 0xe5, 0x84, 0x7e, 0x44, 0xb2},
40 {0xeb, 0x6a, 0x71, 0x1a, 0x2c, 0x02, 0x27, 0x1b},
41 {0x7a, 0xc8, 0x16, 0xd1, 0x6e, 0x9b, 0x30, 0x2e}
43 static const uint8_t rct2[2][16] = {
44 {0xee, 0xa9, 0xd0, 0xa2, 0x49, 0xfd, 0x3b, 0xa6, 0xb3, 0x43, 0x6f, 0xb8, 0x9d, 0x6d, 0xca, 0x92},
45 {0xb2, 0xc9, 0x5e, 0xb0, 0x0c, 0x31, 0xad, 0x71, 0x80, 0xac, 0x05, 0xb8, 0xe8, 0x3d, 0x69, 0x6e}
47 static const uint8_t iv[8] = {0xee, 0xa9, 0xd0, 0xa2, 0x49, 0xfd, 0x3b, 0xa6};
48 static uint8_t rpt2[2][16];
50 static const int key_bits[3] = {128, 80, 40};
56 for (j = 0; j < 3; j++){
60 for (
i = 0;
i < 8;
i++){
68 for (
i =0;
i < 8;
i++) {
75 memcpy(rpt2[0], Key[0], 16);
76 memcpy(rpt2[1], Key[0], 16);
77 for (
i = 0;
i < 1000000;
i++){
83 for (j = 0; j < 2; j++) {
84 for (
i = 0;
i < 16;
i++) {
85 if (rct2[j][
i] != rpt2[j][
i]) {
91 for (j = 0; j < 3; j++) {
98 for (
i = 0;
i < 16;
i++) {
99 if (rct2[0][
i] != rpt2[0][
i]) {