X-Git-Url: https://git.cryptolib.org/?p=avr-crypto-lib.git;a=blobdiff_plain;f=test_src%2Fshavs.c;h=b1fb908e2a5ef347cd9f543554ce03d9aed9ccf1;hp=84cf9f2ce9de5aea5089ec5675c46ea99803d6c0;hb=4b5da1dc27a791b5c448274a3db09cd035b33493;hpb=a45c328791dc391e6432051ee0c7972ef7fd8d9a diff --git a/test_src/shavs.c b/test_src/shavs.c index 84cf9f2..b1fb908 100644 --- a/test_src/shavs.c +++ b/test_src/shavs.c @@ -1,7 +1,7 @@ /* shavs.c */ /* This file is part of the AVR-Crypto-Lib. - Copyright (C) 2006 2007 2008 2009 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 @@ -56,7 +56,7 @@ hfdesc_t** shavs_algolist=NULL; void shavs_listalgos(void){ char option = 'a'; - hfdesc_t* t; + hfdesc_t *t; uint8_t i=0; fputs_P(PSTR("\nthe following algorithms are available:\n"), shavs_out_file); while(option <= 'z' && (t = (hfdesc_t*)pgm_read_word(&(shavs_algolist[i])))){ @@ -66,7 +66,7 @@ void shavs_listalgos(void){ } } -void shavs_setalgo(char* param){ +void shavs_setalgo(char *param){ param = strstrip(param); if(param[1]=='\0'){ /* single letter specified */ uint8_t i, option = param[0] - 'a'; @@ -83,7 +83,7 @@ void shavs_setalgo(char* param){ } shavs_algo=(hfdesc_t*)pgm_read_word(&(shavs_algolist[option])); } else { /* name specifyed */ - hfdesc_t* t=NULL; + hfdesc_t *t=NULL; uint8_t i=0; while((t=(hfdesc_t*)pgm_read_word(&(shavs_algolist[i]))) && strcasecmp_P(param, (void*)pgm_read_word(&(t->name)))) @@ -104,7 +104,7 @@ typedef struct { uint16_t buffersize_B; uint32_t blocks; hfgen_ctx_t ctx; - uint8_t* buffer; + uint8_t *buffer; uint8_t in_byte; } shavs_ctx_t; @@ -143,7 +143,7 @@ uint8_t buffer_add(char c){ } static -uint32_t my_strtoul(const char* str){ +uint32_t my_strtoul(const char *str){ uint32_t r=0; while(*str && (*str<'0' || *str>'9')){ str++; @@ -162,7 +162,7 @@ uint32_t my_strtoul(const char* str){ int32_t getLength(void){ uint32_t len=0; char lenstr[21]; - char* len2; + char *len2; for(;;){ memset(lenstr, 0, 21); cli_getsn_cecho(lenstr, 20); @@ -200,7 +200,7 @@ void shavs_test1(void){ /* KAT tests */ shavs_ctx.buffersize_B=pgm_read_word(&(shavs_algo->blocksize_b))/8; uint8_t buffer[shavs_ctx.buffersize_B+5]; shavs_ctx.buffer = buffer; - fprintf_P(shavs_out_file, PSTR("\nbuffer_size = 0x%04"PRIx16" bytes")); + fprintf_P(shavs_out_file, PSTR("\nbuffer_size = 0x%04"PRIx16" bytes"), shavs_ctx.buffersize_B); for(;;){ shavs_ctx.blocks = 0; memset(buffer, 0, shavs_ctx.buffersize_B);