/* cmacvs.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
#include <string.h>
#include <ctype.h>
#include "blockcipher_descriptor.h"
-#include "bcal/bcal-basic.h"
-#include "bcal/bcal-cmac.h"
+#include "bcal-basic.h"
+#include "bcal-cmac.h"
#include "cmacvs.h"
#include "string-extras.h"
#include "cli.h"
void cmacvs_listalgos(void){
char option = 'a';
- bcdesc_t* t;
+ bcdesc_t *t;
uint8_t i=0;
cli_putstr_P(PSTR("\r\nthe following algorithms are available:\r\n"));
while(option<='z' && (t=(bcdesc_t*)pgm_read_word(&(cmacvs_algolist[i])))){
}
}
-void cmacvs_setalgo(char* param){
+void cmacvs_setalgo(char *param){
param = strstrip(param);
if(param[1]=='\0'){ /* single letter specified */
uint8_t i,option = param[0]-'a';
}
cmacvs_algo=(bcdesc_t*)pgm_read_word(&(cmacvs_algolist[option]));
} else { /* name specifyed */
- bcdesc_t* t=NULL;
+ bcdesc_t *t=NULL;
uint8_t i=0;
while((t=(bcdesc_t*)pgm_read_word(&(cmacvs_algolist[i]))) &&
strcasecmp_P(param, (void*)pgm_read_word(&(t->name))))
uint16_t buffersize_B;
uint32_t blocks;
bcal_cmac_ctx_t ctx;
- uint8_t* buffer;
+ uint8_t *buffer;
uint8_t in_byte;
} cmacvs_ctx_t;
int32_t getValue_P(PGM_P key){
uint32_t val=0;
char instr[21];
- char* str2;
+ char *str2;
for(;;){
memset(instr, 0, 21);
cli_getsn_cecho(instr, 20);
return -2;
}
-uint8_t getKey(void* key_buffer, uint8_t klen_B){
+uint8_t getKey(void *key_buffer, uint8_t klen_B){
char c;
uint8_t v,i=0;
memset(key_buffer, 0x00, klen_B);
return 0;
}
-uint8_t getMac(void* mac_buffer, uint8_t mlen_B){
+uint8_t getMac(void *mac_buffer, uint8_t mlen_B){
char c;
uint8_t v,i=0;
memset(mac_buffer, 0x00, mlen_B);