/* 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
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])))){
}
}
-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';
}
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))))
uint16_t buffersize_B;
uint32_t blocks;
hfgen_ctx_t ctx;
- uint8_t* buffer;
+ uint8_t *buffer;
uint8_t in_byte;
} shavs_ctx_t;
}
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++;
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);
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);