avr-crypto-lib/test_src/main-rc6-test.c

79 lines
2.3 KiB
C
Raw Permalink Normal View History

2008-05-26 19:13:21 +00:00
/* main-rc6-test.c */
/*
2009-01-30 23:00:04 +00:00
This file is part of the AVR-Crypto-Lib.
2015-02-06 02:43:31 +00:00
Copyright (C) 2006-2015 Daniel Otte (bg@nerilex.org)
2008-05-26 19:13:21 +00:00
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
2006-08-07 16:33:57 +00:00
/*
2009-01-30 23:00:04 +00:00
* rc6 test-suit
2006-08-07 16:33:57 +00:00
*
*/
#include "main-test-common.h"
2006-08-07 16:33:57 +00:00
#include "rc6.h"
2008-04-13 03:30:14 +00:00
#include "performance_test.h"
#include "bcal-performance.h"
2011-01-03 19:52:10 +00:00
#include "bcal-nessie.h"
#include "bcal_rc6.h"
2006-08-07 16:33:57 +00:00
2008-04-13 03:30:14 +00:00
#define RC6_ROUNDS 20
char *algo_name = "RC6-32/20/16";
2006-08-07 16:33:57 +00:00
const bcdesc_t *const algolist[] PROGMEM = {
(bcdesc_t*)&rc6_desc,
NULL
};
2006-08-07 16:33:57 +00:00
/*****************************************************************************
* additional validation-functions *
*****************************************************************************/
void rc6_genctx_dummy(uint8_t *key, uint16_t keysize_b, void *ctx){
2008-04-13 03:30:14 +00:00
rc6_initl(key, keysize_b, RC6_ROUNDS, ctx);
}
2006-08-07 16:33:57 +00:00
2008-04-13 03:30:14 +00:00
void testrun_nessie_rc6(void){
2011-01-03 19:52:10 +00:00
bcal_nessie_multiple(algolist);
2008-04-13 03:30:14 +00:00
}
2006-08-07 16:33:57 +00:00
2008-04-13 03:30:14 +00:00
void testrun_performance_rc6(void){
bcal_performance_multiple(algolist);
2006-08-07 16:33:57 +00:00
}
/*****************************************************************************
* main *
*****************************************************************************/
2009-01-30 23:00:04 +00:00
const char nessie_str[] PROGMEM = "nessie";
const char test_str[] PROGMEM = "test";
const char performance_str[] PROGMEM = "performance";
const char echo_str[] PROGMEM = "echo";
2012-03-14 16:38:51 +00:00
const cmdlist_entry_t cmdlist[] PROGMEM = {
2009-01-30 23:00:04 +00:00
{ nessie_str, NULL, testrun_nessie_rc6},
{ test_str, NULL, testrun_nessie_rc6},
{ performance_str, NULL, testrun_performance_rc6},
{ echo_str, (void*)1, (void_fpt)echo_ctrl},
{ NULL, NULL, NULL}
};
2008-04-13 03:30:14 +00:00
int main (void){
main_setup();
for(;;){
welcome_msg(algo_name);
cmd_interface(cmdlist);
2008-04-13 03:30:14 +00:00
}
2006-08-07 16:33:57 +00:00
}