3 This file is part of the AVR-Crypto-Lib.
4 Copyright (C) 2006-2010 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 "jh_simple.h"
28 #include "hfal-nessie.h"
29 #include "hfal-test.h"
30 #include "hfal-performance.h"
32 #include "nessie_hash_test.h"
33 #include "performance_test.h"
35 char* algo_name = "JH";
38 const hfdesc_t* const algolist[] PROGMEM = {
39 (hfdesc_t*)&jh224_desc,
40 (hfdesc_t*)&jh256_desc,
41 (hfdesc_t*)&jh384_desc,
42 (hfdesc_t*)&jh512_desc,
46 /*****************************************************************************
47 * additional validation-functions *
48 *****************************************************************************/
50 void performance_jh(void){
51 hfal_performance_multiple(algolist);
54 void testrun_nessie_jh(void){
55 hfal_nessie_multiple(algolist);
58 void test256Null(void){
62 jh_lastBlock(&ctx, NULL, 0);
63 jh256_ctx2hash(hash, &ctx);
64 cli_putstr_P(PSTR("\r\nresult:\r\n"));
65 cli_hexdump_block(hash, 32, 4, 8);
68 /*****************************************************************************
70 *****************************************************************************/
73 const char nessie_str[] PROGMEM = "nessie";
74 const char test_str[] PROGMEM = "test";
75 const char test256_str[] PROGMEM = "test256";
76 const char performance_str[] PROGMEM = "performance";
77 const char singleround_str[] PROGMEM = "singleround";
78 const char echo_str[] PROGMEM = "echo";
79 const char shavs_list_str[] PROGMEM = "shavs_list";
80 const char shavs_set_str[] PROGMEM = "shavs_set";
81 const char shavs_test1_str[] PROGMEM = "shavs_test1";
83 const cmdlist_entry_t cmdlist[] PROGMEM = {
84 { nessie_str, NULL, testrun_nessie_jh},
85 { performance_str, NULL, performance_jh},
86 { test256_str, NULL, test256Null},
87 // { singleround_str, NULL, singleround_jh},
88 { shavs_list_str, NULL, shavs_listalgos},
89 { shavs_set_str, (void*)1, (void_fpt)shavs_setalgo},
90 { shavs_test1_str, NULL, shavs_test1},
91 { echo_str, (void*)1, (void_fpt)echo_ctrl},
98 shavs_algolist=(hfdesc_t**)algolist;
99 shavs_algo=(hfdesc_t*)&jh256_desc;
101 welcome_msg(algo_name);
102 cmd_interface(cmdlist);