X-Git-Url: https://git.cryptolib.org/?p=avr-crypto-lib.git;a=blobdiff_plain;f=test_src%2Fmain-xtea-test.c;h=778d9cdce7bee6644fced7a79bcff54a5f3c8417;hp=99a8eb72b627cd808b1e7d72672df9dd7d56939e;hb=b246a2a0589f234db6247255555df98f4c281c41;hpb=35dc9566e40c9f68fa216c70eaa6d5b0597448fe diff --git a/test_src/main-xtea-test.c b/test_src/main-xtea-test.c index 99a8eb7..778d9cd 100644 --- a/test_src/main-xtea-test.c +++ b/test_src/main-xtea-test.c @@ -54,6 +54,25 @@ void testrun_performance_xtea(void){ bcal_performance_multiple(algolist); } +void test_xtea(void){ + uint8_t key[16]; + uint8_t data[8]; + + memset(key, 0, 16); + key[0] = 0x80; + memset(data, 0, 8); + cli_putstr_P(PSTR("\r\n*** XTEA test ***\r\n key: ")); + cli_hexdump(key, 16); + cli_putstr_P(PSTR("\r\n plain: ")); + cli_hexdump(data, 8); + xtea_enc(data, data, key); + cli_putstr_P(PSTR("\r\n crypt: ")); + cli_hexdump(data, 8); + xtea_dec(data, data, key); + cli_putstr_P(PSTR("\r\n plain: ")); + cli_hexdump(data, 8); +} + /***************************************************************************** * main * *****************************************************************************/ @@ -65,7 +84,7 @@ const char echo_str[] PROGMEM = "echo"; cmdlist_entry_t cmdlist[] PROGMEM = { { nessie_str, NULL, testrun_nessie_xtea}, - { test_str, NULL, testrun_nessie_xtea}, + { test_str, NULL, test_xtea}, { performance_str, NULL, testrun_performance_xtea}, { echo_str, (void*)1, (void_fpt)echo_ctrl}, { NULL, NULL, NULL}