X-Git-Url: https://git.cryptolib.org/?p=avr-crypto-lib.git;a=blobdiff_plain;f=test_src%2Fnessie_bc_test.c;h=1d28adae96d8c7a10c2598db62adc789dc426cc8;hp=f9a91e547a8f82f745e9f9df73201d0da8245e50;hb=4b5da1dc27a791b5c448274a3db09cd035b33493;hpb=2159c273c9d3361571a6ff1ab63d9bc76582fbab diff --git a/test_src/nessie_bc_test.c b/test_src/nessie_bc_test.c index f9a91e5..1d28ada 100644 --- a/test_src/nessie_bc_test.c +++ b/test_src/nessie_bc_test.c @@ -1,7 +1,7 @@ /* nessie_bc_test.c */ /* - This file is part of the Crypto-avr-lib/microcrypt-lib. - Copyright (C) 2008 Daniel Otte (daniel.otte@rub.de) + This file is part of the AVR-Crypto-Lib. + 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 @@ -19,7 +19,7 @@ /** * * author: Daniel Otte - * email: daniel.otte@rub.de + * email: bg@nerilex.org * license: GPLv3 * * a suit for running the nessie-tests for blockciphers @@ -29,7 +29,6 @@ #include #include "nessie_bc_test.h" #include "nessie_common.h" -#include "uart.h" nessie_bc_ctx_t nessie_bc_ctx; @@ -37,12 +36,12 @@ void nessie_bc_init(void){ memset(&nessie_bc_ctx, 0, sizeof(nessie_bc_ctx_t)); } static -void nessie_bc_free(void* ctx){ +void nessie_bc_free(void *ctx){ if(nessie_bc_ctx.cipher_free) nessie_bc_ctx.cipher_free(ctx); } -void nessie_bc_enc(uint8_t* key, uint8_t* pt){ +void nessie_bc_enc(uint8_t *key, uint8_t *pt){ uint8_t ctx[nessie_bc_ctx.ctx_size_B]; uint8_t buffer[nessie_bc_ctx.blocksize_B]; uint16_t i; @@ -63,19 +62,21 @@ void nessie_bc_enc(uint8_t* key, uint8_t* pt){ memcpy(buffer, pt, nessie_bc_ctx.blocksize_B); for(i=0; i<100; ++i){ nessie_bc_ctx.cipher_enc(buffer, ctx); + NESSIE_SEND_ALIVE_A(i); } nessie_print_item("Iterated 100 times", buffer, nessie_bc_ctx.blocksize_B); #ifndef NESSIE_NO1KTEST /* 1000 times test, we use the 100 precedig steps to fasten things a bit */ for(; i<1000; ++i){ nessie_bc_ctx.cipher_enc(buffer, ctx); + NESSIE_SEND_ALIVE_A(i); } nessie_print_item("Iterated 1000 times", buffer, nessie_bc_ctx.blocksize_B); #endif nessie_bc_free(ctx); } -void nessie_bc_dec(uint8_t* key, uint8_t* ct){ +void nessie_bc_dec(uint8_t *key, uint8_t *ct){ uint8_t ctx[nessie_bc_ctx.ctx_size_B]; uint8_t buffer[nessie_bc_ctx.blocksize_B];