3 This file is part of the AVR-Crypto-Lib.
4 Copyright (C) 2006-2015 Daniel Otte (bg@nerilex.org)
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/>.
24 #include "main-test-common.h"
27 #include "nessie_stream_test.h"
28 #include "performance_test.h"
30 char *algo_name = "MUGI";
32 /*****************************************************************************
33 * additional validation-functions *
34 *****************************************************************************/
36 void testrun_performance_mugi(void){
50 mugi_init(key, iv, &ctx);
52 cli_putstr_P(PSTR("\r\n\tctx-gen time: "));
53 ultoa((unsigned long)t, str, 10);
59 cli_putstr_P(PSTR("\r\n\tencrypt time: "));
60 ultoa((unsigned long)t, str, 10);
63 cli_putstr_P(PSTR("\r\n"));
67 void testrun_mugi(void){
68 uint8_t key[]={ 0x00, 0x01, 0x02, 0x03,
69 0x04, 0x05, 0x06, 0x07,
70 0x08, 0x09, 0x0a, 0x0b,
71 0x0c, 0x0d, 0x0e, 0x0f };
72 uint8_t iv[]= { 0xf0, 0xe0, 0xd0, 0xc0,
73 0xb0, 0xa0, 0x90, 0x80,
74 0x70, 0x60, 0x50, 0x40,
75 0x30, 0x20, 0x10, 0x00 };
79 mugi_init(key, iv, &ctx);
80 cli_putstr_P(PSTR("\r\nkey = "));
81 cli_hexdump2(key, 16);
82 cli_putstr_P(PSTR("\r\niv = "));
85 output = mugi_gen(&ctx);
86 cli_putstr_P(PSTR("\r\nMUGI output: "));
87 cli_hexdump(&output, 8);
92 mugi_init(key, iv, &ctx);
93 cli_putstr_P(PSTR("\r\nkey = "));
94 cli_hexdump2(key, 16);
95 cli_putstr_P(PSTR("\r\niv = "));
98 output = mugi_gen(&ctx);
99 cli_putstr_P(PSTR("\r\nMUGI output: "));
100 cli_hexdump(&output, 8);
104 /*****************************************************************************
106 *****************************************************************************/
108 const char nessie_str[] PROGMEM = "nessie";
109 const char test_str[] PROGMEM = "test";
110 const char performance_str[] PROGMEM = "performance";
111 const char echo_str[] PROGMEM = "echo";
113 const cmdlist_entry_t cmdlist[] PROGMEM = {
114 // { nessie_str, NULL, testrun_nessie_arcfour },
115 { test_str, NULL, testrun_mugi},
116 { performance_str, NULL, testrun_performance_mugi},
117 { echo_str, (void*)1, (void_fpt)echo_ctrl},
125 welcome_msg(algo_name);
126 cmd_interface(cmdlist);