1 /* main-entropium-test.c */
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/>.
24 #include "main-test-common.h"
26 #include "entropium.h"
27 #include "nessie_bc_test.h"
28 #include "performance_test.h"
30 char *algo_name = "Entropium";
32 /*****************************************************************************
33 * additional validation-functions *
34 *****************************************************************************/
36 void testrun_entropium(void){
40 while('q'!=cli_getc()){
41 entropium_getRandomBlock(data);
42 cli_putstr_P(PSTR("\r\n "));
44 for(c=strlen(str); c<11; ++c){
49 cli_putstr_P(PSTR(" : "));
50 cli_hexdump(data, 32);
52 cli_putstr_P(PSTR("\r\n\r\n"));
56 void testrun_performance_entropium(void){
65 entropium_addEntropy(128, data);
67 cli_putstr_P(PSTR("\r\n\tadd entropy time: "));
68 ultoa((unsigned long)t, str, 10);
73 entropium_getRandomBlock(data);
75 cli_putstr_P(PSTR("\r\n\tget random time: "));
76 ultoa((unsigned long)t, str, 10);
79 cli_putstr_P(PSTR("\r\n"));
81 /*****************************************************************************
83 *****************************************************************************/
85 const char nessie_str[] PROGMEM = "nessie";
86 const char test_str[] PROGMEM = "test";
87 const char performance_str[] PROGMEM = "performance";
88 const char echo_str[] PROGMEM = "echo";
90 const cmdlist_entry_t cmdlist[] PROGMEM = {
91 { nessie_str, NULL, testrun_entropium},
92 { test_str, NULL, testrun_entropium},
93 { performance_str, NULL, testrun_performance_entropium},
94 { echo_str, (void*)1, (void_fpt)echo_ctrl},
103 welcome_msg(algo_name);
104 cmd_interface(cmdlist);