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"
40 char* algo_name = "DES";
42 void uart0_putc(char byte){
43 uart_putc(UART_0, byte);
46 char uart0_getc(void){
47 return uart_getc(UART_0);
50 const bcdesc_t* algolist[] = {
54 /*****************************************************************************
55 * additional validation-functions *
56 *****************************************************************************/
57 void des_init_dummy(const void* key, uint16_t keysize_b, void* ctx){
61 void des_enc_dummy(void* buffer, void* ctx){
62 des_enc(buffer, buffer, ctx);
65 void des_dec_dummy(void* buffer, void* ctx){
66 des_dec(buffer, buffer, ctx);
69 void testrun_nessie_des(void){
71 nessie_bc_ctx.blocksize_B = 8;
72 nessie_bc_ctx.keysize_b = 64;
73 nessie_bc_ctx.name = algo_name;
74 nessie_bc_ctx.ctx_size_B = 8;
75 nessie_bc_ctx.cipher_enc = (nessie_bc_enc_fpt)des_enc_dummy;
76 nessie_bc_ctx.cipher_dec = (nessie_bc_dec_fpt)des_dec_dummy;
77 nessie_bc_ctx.cipher_genctx = (nessie_bc_gen_fpt)des_init_dummy;
83 void testrun_performance_des(void){
84 bcal_performance_multiple(algolist);
86 /*****************************************************************************
88 *****************************************************************************/
90 const char nessie_str[] = "nessie";
91 const char test_str[] = "test";
92 const char performance_str[] = "performance";
93 const char echo_str[] = "echo";
95 cmdlist_entry_t cmdlist[] = {
96 { nessie_str, NULL, testrun_nessie_des },
97 { test_str, NULL, testrun_nessie_des },
98 { performance_str, NULL, testrun_performance_des},
99 { echo_str, (void*)1, (void_fpt)echo_ctrl},
104 sysclk_set_freq(SYS_FREQ);
105 sysclk_mosc_verify_enable();
106 uart_init(UART_0, 115200, 8, UART_PARATY_NONE, UART_STOPBITS_ONE);
107 gptm_set_timer_32periodic(TIMER0);
113 cli_putstr("\r\n\r\nARM-Crypto-Lib VS (");
114 cli_putstr(algo_name);
116 cli_putstr(__DATE__);
118 cli_putstr(__TIME__);
119 cli_putstr(")\r\nloaded and running\r\n");
120 cmd_interface(cmdlist);