30 #define TEA_NUM_TESTS 4
34 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
35 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
37 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
38 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
40 { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
41 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF
43 { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
44 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF
49 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
50 { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 },
51 { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 },
52 { 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF }
56 { 0x41, 0xEA, 0x3A, 0x0A, 0x94, 0xBA, 0xA9, 0x40 },
57 { 0x6A, 0x2F, 0x9C, 0xF3, 0xFC, 0xCF, 0x3C, 0x55 },
58 { 0xDE, 0xB1, 0xC0, 0xA2, 0x7E, 0x74, 0x5D, 0xB3 },
59 { 0x12, 0x6C, 0x6B, 0x92, 0xC0, 0x65, 0x3A, 0x3E }
63 const uint8_t *
ref,
int len, uint8_t *iv,
int dir,
67 if (memcmp(dst,
ref, 8*
len)) {
70 for (
i = 0;
i < 8*
len;
i++)
73 for (
i = 0;
i < 8*
len;
i++)
83 uint8_t buf[8], iv[8];
85 static const uint8_t
src[32] =
"HelloWorldHelloWorldHelloWorld";
100 memcpy(iv,
"HALLO123", 8);
104 memcpy(iv,
"HALLO123", 8);
107 memcpy(iv,
"HALLO123", 8);
111 printf(
"Test encryption/decryption success.\n");