]> git.cryptolib.org Git - avr-crypto-lib.git/blobdiff - test_src/main-omac-noekeon-test.c
fixing E-Mail-Address & Copyright
[avr-crypto-lib.git] / test_src / main-omac-noekeon-test.c
index a5a0e7990d0746d652a026d785be7e95da241c5d..c125a73cb8f1f433f2a05b29fbb376c2d81dccbf 100644 (file)
@@ -1,7 +1,7 @@
 /* main-omac-noekeon-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 "noekeon.h"
 #include "omac_noekeon.h"
 
-#include "cli.h"
 #include "nessie_mac_test.h"
 #include "performance_test.h"
 
-#include <stdlib.h>
-#include <stdint.h>
-#include <string.h>
-
-char* algo_name = "OMAC-Noekeon";
+char *algo_name = "OMAC-Noekeon";
 
 /*****************************************************************************
  *  additional validation-functions                                                                                     *
  *****************************************************************************/
 
-void test_mac(void* key, void* data, uint16_t datalength_b){
+void test_mac(void *key, void *data, uint16_t datalength_b){
        uint8_t mac[16];
        cli_putstr_P(PSTR("\r\n-----------\r\n msg length (bit): 0x"));
        cli_hexdump(((uint8_t*)&datalength_b)+1, 1);
@@ -72,16 +64,16 @@ void testrun_test_omac_noekeon(void){
 
 uint8_t stat_key[16];
 
-void omac_noekeon_next_dummy(void* ctx, const void* buffer){
+void omac_noekeon_next_dummy(void *ctx, const void *buffer){
        omac_noekeon_next(buffer, stat_key, ctx);
 }
 
-void omac_noekeon_init_dummy(void* ctx, const void* key, uint16_t keysize_b){
+void omac_noekeon_init_dummy(void *ctx, const void *key, uint16_t keysize_b){
        omac_noekeon_init(ctx);
        memcpy(stat_key, key, 16);
 }
 
-void omac_noekeon_last_dummy(void* ctx, const void* buffer, uint16_t size_b){
+void omac_noekeon_last_dummy(void *ctx, const void *buffer, uint16_t size_b){
        while(size_b>128){
                omac_noekeon_next(buffer, stat_key, ctx);
                size_b -= 128;
@@ -90,7 +82,7 @@ void omac_noekeon_last_dummy(void* ctx, const void* buffer, uint16_t size_b){
        omac_noekeon_last(buffer, size_b, stat_key, ctx);
 }
 
-void omac_noekeon_conv_dummy(void* buffer, void* ctx){
+void omac_noekeon_conv_dummy(void *buffer, void *ctx){
        memcpy(buffer, ctx, 16);
 }
 
@@ -166,14 +158,10 @@ const cmdlist_entry_t cmdlist[] PROGMEM = {
 };
 
 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);
        }
 }