3 This file is part of the AVR-Crypto-Lib.
4 Copyright (C) 2008 Daniel Otte (daniel.otte@rub.de)
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
30 #include "nessie_stream_test.h"
32 #include "performance_test.h"
38 char* algo_name = "MUGI";
40 /*****************************************************************************
41 * additional validation-functions *
42 *****************************************************************************/
44 void testrun_performance_mugi(void){
58 mugi_init(key, iv, &ctx);
60 cli_putstr_P(PSTR("\r\n\tctx-gen time: "));
61 ultoa((unsigned long)t, str, 10);
67 cli_putstr_P(PSTR("\r\n\tencrypt time: "));
68 ultoa((unsigned long)t, str, 10);
71 cli_putstr_P(PSTR("\r\n"));
75 void testrun_mugi(void){
76 uint8_t key[]={ 0x00, 0x01, 0x02, 0x03,
77 0x04, 0x05, 0x06, 0x07,
78 0x08, 0x09, 0x0a, 0x0b,
79 0x0c, 0x0d, 0x0e, 0x0f };
80 uint8_t iv[]= { 0xf0, 0xe0, 0xd0, 0xc0,
81 0xb0, 0xa0, 0x90, 0x80,
82 0x70, 0x60, 0x50, 0x40,
83 0x30, 0x20, 0x10, 0x00 };
87 mugi_init(key, iv, &ctx);
88 cli_putstr_P(PSTR("\r\nkey = "));
89 cli_hexdump2(key, 16);
90 cli_putstr_P(PSTR("\r\niv = "));
93 output = mugi_gen(&ctx);
94 cli_putstr_P(PSTR("\r\nMUGI output: "));
95 cli_hexdump(&output, 8);
100 mugi_init(key, iv, &ctx);
101 cli_putstr_P(PSTR("\r\nkey = "));
102 cli_hexdump2(key, 16);
103 cli_putstr_P(PSTR("\r\niv = "));
104 cli_hexdump2(iv, 16);
106 output = mugi_gen(&ctx);
107 cli_putstr_P(PSTR("\r\nMUGI output: "));
108 cli_hexdump(&output, 8);
112 /*****************************************************************************
114 *****************************************************************************/
116 const char nessie_str[] PROGMEM = "nessie";
117 const char test_str[] PROGMEM = "test";
118 const char performance_str[] PROGMEM = "performance";
119 const char echo_str[] PROGMEM = "echo";
121 cmdlist_entry_t cmdlist[] PROGMEM = {
122 // { nessie_str, NULL, testrun_nessie_arcfour },
123 { test_str, NULL, testrun_mugi},
124 { performance_str, NULL, testrun_performance_mugi},
125 { echo_str, (void*)1, (void_fpt)echo_ctrl},
132 cli_rx = (cli_rx_fpt)uart0_getc;
133 cli_tx = (cli_tx_fpt)uart0_putc;
135 cli_putstr_P(PSTR("\r\n\r\nCrypto-VS ("));
136 cli_putstr(algo_name);
137 cli_putstr_P(PSTR(")\r\nloaded and running\r\n"));
138 cmd_interface(cmdlist);