1 /* main-arcfour-test.c */
3 This file is part of the ARM-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/>.
20 * arcfour (RC4 compatible) test-suit
30 #include "uart_lowlevel.h"
35 #include "scal_arcfour.h"
37 #include "scal-nessie.h"
38 #include "nessie_stream_test.h"
39 #include "performance_test.h"
45 const char* algo_name = "Arcfour";
47 void uart0_putc(char byte){
48 uart_putc(UART_0, byte);
51 char uart0_getc(void){
52 return uart_getc(UART_0);
55 /*****************************************************************************
56 * additional validation-functions *
57 *****************************************************************************/
61 void testrun_nessie_arcfour(void){
62 scal_nessie_run(&arcfour_desc);
65 void testrun_performance_arcfour(void){
77 arcfour_init(key, 16, &ctx);
79 cli_putstr("\r\n\tctx-gen time: ");
80 ultoa((unsigned long)t, str, 10);
86 cli_putstr("\r\n\tencrypt time: ");
87 ultoa((unsigned long)t, str, 10);
94 /*****************************************************************************
96 *****************************************************************************/
98 const cmdlist_entry_t cmdlist[] = {
99 { "nessie", NULL, testrun_nessie_arcfour },
100 { "test", NULL, testrun_nessie_arcfour},
101 { "performance", NULL, testrun_performance_arcfour},
102 { "echo", (void*)1, (void_fpt)echo_ctrl},
107 sysclk_set_freq(SYS_FREQ);
108 sysclk_mosc_verify_enable();
109 uart_init(UART_0, 115200, 8, UART_PARATY_NONE, UART_STOPBITS_ONE);
110 gptm_set_timer_32periodic(TIMER0);
116 cli_putstr("\r\n\r\nARM-Crypto-Lib VS (");
117 cli_putstr(algo_name);
119 cli_putstr(__DATE__);
121 cli_putstr(__TIME__);
122 cli_putstr(")\r\nloaded and running\r\n");
123 cmd_interface(cmdlist);