28 #define XTEA_NUM_TESTS 6
31 { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
32 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
33 { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
34 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
35 { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
36 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
37 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
38 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
39 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
40 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
41 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
42 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
46 { 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48 },
47 { 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41 },
48 { 0x5a, 0x5b, 0x6e, 0x27, 0x89, 0x48, 0xd7, 0x7f },
49 { 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48 },
50 { 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41 },
51 { 0x70, 0xe1, 0x22, 0x5d, 0x6e, 0x4e, 0x76, 0x55 }
55 { 0x49, 0x7d, 0xf3, 0xd0, 0x72, 0x61, 0x2c, 0xb5 },
56 { 0xe7, 0x8f, 0x2d, 0x13, 0x74, 0x43, 0x41, 0xd8 },
57 { 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41 },
58 { 0xa0, 0x39, 0x05, 0x89, 0xf8, 0xb8, 0xef, 0xa5 },
59 { 0xed, 0x23, 0x37, 0x5a, 0x82, 0x1a, 0x8c, 0x2d },
60 { 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41 }
64 const uint8_t *
ref,
int len, uint8_t *iv,
int dir,
66 void (*crypt)(
AVXTEA *, uint8_t *,
const uint8_t *,
int, uint8_t *,
int))
72 for (
i = 0;
i < 8*
len;
i++)
75 for (
i = 0;
i < 8*
len;
i++)
84 uint8_t buf[16], iv[8];
86 static const uint8_t
src[32] =
"HelloWorldHelloWorldHelloWorld";
99 for (j = 0; j < 4; j++)
102 for (j = 0; j < 2; j++) {
110 memcpy(iv,
"HALLO123", 8);
114 memcpy(iv,
"HALLO123", 8);
117 memcpy(iv,
"HALLO123", 8);
121 printf(
"Test encryption/decryption success.\n");