X-Git-Url: https://git.cryptolib.org/?p=avr-crypto-lib.git;a=blobdiff_plain;f=test_src%2Fmain-camellia-test.c;h=7e2cc352a28e388cdde389d8b5f270f1fe2e1c2c;hp=19153b57fcfa4548c537a7a0230ec3cdb89a691c;hb=9b567bc05f6ff8c98fbc8a140f1faf6f60da30ac;hpb=12883cff6e7d233365e8477e08f90c75fa5a48b2 diff --git a/test_src/main-camellia-test.c b/test_src/main-camellia-test.c index 19153b5..7e2cc35 100644 --- a/test_src/main-camellia-test.c +++ b/test_src/main-camellia-test.c @@ -115,15 +115,15 @@ void testrun_camellia(void){ 0x89, 0xab, 0xcd, 0xef, 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }; -/* - uint8_t data[16] = { - 0x10, 0x32, 0x54, 0x76, - 0x98, 0xba, 0xdc, 0xfe, - 0xfe, 0xcd, 0xab, 0x89 - 0x67, 0x89, 0x67, 0x01}; -*/ + + uint8_t key[16] = { 0x01, 0x23, 0x45, 0x67, + 0x89, 0xab, 0xcd, 0xef, + 0xfe, 0xdc, 0xba, 0x98, + 0x76, 0x54, 0x32, 0x10 }; + + camellia128_ctx_t ctx; - camellia128_init(data, &ctx); + camellia128_init(key, &ctx); uart_putstr_P(PSTR("\r\n key: ")); uart_hexdump(data, 16); uart_putstr_P(PSTR("\r\n plaintext: ")); @@ -131,6 +131,9 @@ void testrun_camellia(void){ camellia128_enc(data, &ctx); uart_putstr_P(PSTR("\r\n ciphertext: ")); uart_hexdump(data, 16); + camellia128_dec(data, &ctx); + uart_putstr_P(PSTR("\r\n decrypted: ")); + uart_hexdump(data, 16); }