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/>.
30 #include "uart_lowlevel.h"
35 #include "nessie_bc_test.h"
36 #include "performance_test.h"
37 #include "bcal-performance.h"
45 char* algo_name = "RC6-32/20/16";
47 void uart0_putc(char byte){
48 uart_putc(UART_0, byte);
51 char uart0_getc(void){
52 return uart_getc(UART_0);
55 const bcdesc_t* algolist[] = {
59 /*****************************************************************************
60 * additional validation-functions *
61 *****************************************************************************/
63 void testrun_nessie_rc6(void){
65 nessie_bc_ctx.blocksize_B = 16;
66 nessie_bc_ctx.keysize_b = 128;
67 nessie_bc_ctx.name = algo_name;
68 nessie_bc_ctx.ctx_size_B = sizeof(rc6_ctx_t);
69 nessie_bc_ctx.cipher_enc = (nessie_bc_enc_fpt)rc6_enc;
70 nessie_bc_ctx.cipher_dec = (nessie_bc_dec_fpt)rc6_dec;
71 nessie_bc_ctx.cipher_free = (nessie_bc_free_fpt)rc6_free;
72 nessie_bc_ctx.cipher_genctx = (nessie_bc_gen_fpt)rc6_init;
76 nessie_bc_ctx.keysize_b = 192;
79 nessie_bc_ctx.keysize_b = 256;
85 void testrun_performance_rc6(void){
86 bcal_performance_multiple(algolist);
88 /*****************************************************************************
90 *****************************************************************************/
92 const char nessie_str[] = "nessie";
93 const char test_str[] = "test";
94 const char performance_str[] = "performance";
95 const char echo_str[] = "echo";
97 const cmdlist_entry_t cmdlist[] = {
98 { nessie_str, NULL, testrun_nessie_rc6},
99 { test_str, NULL, testrun_nessie_rc6},
100 { performance_str, NULL, testrun_performance_rc6},
101 { echo_str, (void*)1, (void_fpt)echo_ctrl},
106 sysclk_set_freq(SYS_FREQ);
107 sysclk_mosc_verify_enable();
108 uart_init_flow(UART_0, 115200, 8, UART_PARATY_NONE, UART_STOPBITS_ONE, UART_FLOWCTRL_SOFT);
109 gptm_set_timer_32periodic(TIMER0);
111 cli_rx = (cli_rx_fpt)uart0_getc;
112 cli_tx = (cli_tx_fpt)uart0_putc;
114 cli_putstr("\r\n\r\nARM-Crypto-Lib VS (");
115 cli_putstr(algo_name);
117 cli_putstr(__DATE__);
119 cli_putstr(__TIME__);
120 cli_putstr(")\r\nloaded and running\r\n");
121 cmd_interface(cmdlist);