/* main-skipjack-test.c */
/*
This file is part of the AVR-Crypto-Lib.
- Copyright (C) 2008 Daniel Otte (daniel.otte@rub.de)
+ Copyright (C) 2006-2015 Daniel Otte (bg@nerilex.org)
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
*
*/
-#include "config.h"
-
-#include "uart_i.h"
-#include "debug.h"
+#include "main-test-common.h"
#include "skipjack.h"
#include "nessie_bc_test.h"
-#include "cli.h"
#include "performance_test.h"
#include "bcal-performance.h"
#include "bcal-nessie.h"
#include "bcal_skipjack.h"
-#include <stdint.h>
-#include <string.h>
-#include <stdlib.h>
-
+char *algo_name = "Skipjack";
-char* algo_name = "Skipjack";
-
-const bcdesc_t* const algolist[] PROGMEM = {
+const bcdesc_t *const algolist[] PROGMEM = {
(bcdesc_t*)&skipjack_desc,
NULL
};
/*****************************************************************************
* additional validation-functions *
*****************************************************************************/
-void skipjack_genctx_dummy(uint8_t* key, uint16_t keysize, void* ctx){
+void skipjack_genctx_dummy(uint8_t *key, uint16_t keysize, void *ctx){
memcpy(ctx, key, 10);
}
bcal_performance_multiple(algolist);
}
-int test_enc(const void* buffer, void* key){
+int test_enc(const void *buffer, void *key){
uint8_t data[8];
int r;
memcpy(data, buffer, 8);
* self tests *
*****************************************************************************/
-void testencrypt(uint8_t* block, uint8_t* key){
+void testencrypt(uint8_t *block, uint8_t *key){
cli_putstr("\r\n==testy-encrypt==\r\n key: ");
cli_hexdump(key,10);
cli_putstr("\r\n plain: ");
cli_hexdump(block,8);
}
-void testdecrypt(uint8_t* block, uint8_t* key){
+void testdecrypt(uint8_t *block, uint8_t *key){
cli_putstr("\r\n==testy-decrypt==\r\n key: ");
cli_hexdump(key,10);
cli_putstr("\r\n crypt: ");
};
int main (void){
- DEBUG_INIT();
-
- cli_rx = (cli_rx_fpt)uart0_getc;
- cli_tx = (cli_tx_fpt)uart0_putc;
- for(;;){
- cli_putstr_P(PSTR("\r\n\r\nCrypto-VS ("));
- cli_putstr(algo_name);
- cli_putstr_P(PSTR(")\r\nloaded and running\r\n"));
- cmd_interface(cmdlist);
+ main_setup();
+
+ for(;;){
+ welcome_msg(algo_name);
+ cmd_interface(cmdlist);
}
}