]> git.cryptolib.org Git - avr-crypto-lib.git/blobdiff - test_src/main-camellia-test.c
renaming to AVR-Crypto-Lib
[avr-crypto-lib.git] / test_src / main-camellia-test.c
index 19153b57fcfa4548c537a7a0230ec3cdb89a691c..b52cb09fae89d33e9e70c231e8841493b4ab3c5e 100644 (file)
@@ -1,6 +1,6 @@
 /* main-camellia-test.c */
 /*
-    This file is part of the Crypto-avr-lib/microcrypt-lib.
+    This file is part of the This file is part of the AVR-Crypto-Lib.
     Copyright (C) 2008  Daniel Otte (daniel.otte@rub.de)
 
     This program is free software: you can redistribute it and/or modify
@@ -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);
 
 }