1 /* main-sha256-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/>.
30 #include "nessie_hash_test.h"
31 #include "performance_test.h"
32 #include "hfal-performance.h"
33 #include "hfal-nessie.h"
40 #include "hfal_sha256.h"
43 char* algo_name = "SHA-256";
45 const hfdesc_t* algolist[] PROGMEM = {
46 (hfdesc_t*)&sha256_desc,
50 /*****************************************************************************
51 * additional validation-functions *
52 *****************************************************************************/
54 void testrun_nessie_sha256(void){
55 hfal_nessie_multiple(algolist);
58 void testrun_performance_sha256(void){
59 hfal_performance_multiple(algolist);
62 /*****************************************************************************
64 *****************************************************************************/
66 const char nessie_str[] PROGMEM = "nessie";
67 const char test_str[] PROGMEM = "test";
68 const char performance_str[] PROGMEM = "performance";
69 const char echo_str[] PROGMEM = "echo";
70 const char shavs_list_str[] PROGMEM = "shavs_list";
71 const char shavs_set_str[] PROGMEM = "shavs_set";
72 const char shavs_test1_str[] PROGMEM = "shavs_test1";
73 const char dump_str[] PROGMEM = "dump";
75 cmdlist_entry_t cmdlist[] PROGMEM = {
76 { nessie_str, NULL, testrun_nessie_sha256},
77 { test_str, NULL, testrun_nessie_sha256},
78 { performance_str, NULL, testrun_performance_sha256},
79 { echo_str, (void*)1, (void_fpt)echo_ctrl},
80 { shavs_list_str, NULL, shavs_listalgos},
81 { shavs_set_str, (void*)1, (void_fpt)shavs_setalgo},
82 { shavs_test1_str, NULL, shavs_test1},
83 { dump_str, (void*)1, (void_fpt)dump},
90 cli_rx = (cli_rx_fpt)uart0_getc;
91 cli_tx = (cli_tx_fpt)uart0_putc;
92 shavs_algolist=(hfdesc_t**)algolist;
93 shavs_algo=(hfdesc_t*)&sha256_desc;
95 cli_putstr_P(PSTR("\r\n\r\nCrypto-VS ("));
96 cli_putstr(algo_name);
97 cli_putstr_P(PSTR(")\r\nloaded and running\r\n"));
98 cmd_interface(cmdlist);