#ifndef __CONFIG_H__
#define __CONFIG_H__
#include <avr/io.h>
-
-#define F_CPU 16000000 /* Oszillator-Frequenz in Hz */
-// #define F_CPU 14745600
+#define F_CPU 20000000
+// #define F_CPU 16000000 /* Oszillator-Frequenz in Hz */
+// #define F_CPU 14745600
typedef void(*hf_lastBlock_fpt)(void*, const void*, uint16_t);
typedef void(*hf_ctx2hash_fpt)(void*, void*);
typedef void(*hf_free_fpt)(void*);
-typedef void(*hf_mem_fpt)(void*, void*, uint32_t);
+typedef void(*hf_mem_fpt)(void*, const void*, uint32_t);
#define HFDESC_TYPE_HASHFUNCTION 0x02
}
}
-uint16_t hfal_hash_getBlocksize(const* hash_descriptor){
+uint16_t hfal_hash_getBlocksize(const hfdesc_t* hash_descriptor){
uint16_t ret;
ret = pgm_read_word(&(hash_descriptor->blocksize_b));
return ret;
}
-uint16_t hfal_hash_getHashsize(const* hash_descriptor){
+uint16_t hfal_hash_getHashsize(const hfdesc_t* hash_descriptor){
uint16_t ret;
ret = pgm_read_word(&(hash_descriptor->hashsize_b));
return ret;
void hfal_hash_ctx2hash(void* dest, hfgen_ctx_t* ctx);
void hfal_hash_free(hfgen_ctx_t* ctx);
void hfal_hash_mem(const hfdesc_t* hash_descriptor, void* dest, const void* msg, uint32_t length_b);
-uint16_t hfal_hash_getBlocksize(const* hash_descriptor);
-uint16_t hfal_hash_getHashsize(const* hash_descriptor);
+uint16_t hfal_hash_getBlocksize(const hfdesc_t* hash_descriptor);
+uint16_t hfal_hash_getHashsize(const hfdesc_t* hash_descriptor);
#endif /* HFAL_BASIC_H_ */
if(m)
fname+=m[1]+".";
end
+ return false if lb==nil
buffer+=lb;
- lb = read_line();
+ lb = read_line();
end
if(param!="")
fname+=param+".";
STREAM_CIPHERS += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := A5_1.o
-$(ALGO_NAME)_TEST_BIN := main-a5_1-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-a5_1-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_stream_test.o nessie_common.o cli.o string-extras.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
$(ALGO_NAME)_PERFORMANCE_TEST := "performance"
$(ALGO_NAME)_OBJ := aes_enc-asm.o aes_dec-asm.o aes_sbox-asm.o aes_invsbox-asm.o \
aes_keyschedule-asm.o
-$(ALGO_NAME)_TEST_BIN := main-aes-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-aes-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_bc_test.o nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := test nessie
$(ALGO_NAME)_PERFORMANCE_TEST := performance
$(ALGO_NAME)_OBJ := aes_enc-asm.o aes_dec-asm_faster.o aes_sbox-asm.o aes_invsbox-asm.o \
aes_keyschedule-asm.o
-$(ALGO_NAME)_TEST_BIN := main-aes-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-aes-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_bc_test.o nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := test nessie
$(ALGO_NAME)_PERFORMANCE_TEST := performance
aes_keyschedule.o gf256mul.o \
aes128_enc.o aes128_dec.o aes192_enc.o aes192_dec.o \
aes256_enc.o aes256_dec.o
-$(ALGO_NAME)_TEST_BIN := main-aes-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-aes-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_bc_test.o nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := test nessie
$(ALGO_NAME)_PERFORMANCE_TEST := performance
STREAM_CIPHERS += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := arcfour-asm.o
-$(ALGO_NAME)_TEST_BIN := main-arcfour-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-arcfour-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_stream_test.o nessie_common.o cli.o string-extras.o \
performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
STREAM_CIPHERS += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := arcfour.o
-$(ALGO_NAME)_TEST_BIN := main-arcfour-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-arcfour-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_stream_test.o nessie_common.o cli.o string-extras.o \
performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
BLOCK_CIPHERS += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := camellia128-stub.o camellia-asm.o
-$(ALGO_NAME)_TEST_BIN := main-camellia-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-camellia-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_bc_test.o \
nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
BLOCK_CIPHERS += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := cast5.o
-$(ALGO_NAME)_TEST_BIN := main-cast5-test.o debug.o uart.o serial-tools.o cli.o string-extras.o\
+$(ALGO_NAME)_TEST_BIN := main-cast5-test.o debug.o uart.o hexdigit_tab.o serial-tools.o cli.o string-extras.o\
nessie_bc_test.o nessie_common.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
$(ALGO_NAME)_PERFORMANCE_TEST := "performance"
BLOCK_CIPHERS += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := des.o
-$(ALGO_NAME)_TEST_BIN := main-des-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-des-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_bc_test.o nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
$(ALGO_NAME)_PERFORMANCE_TEST := "performance"
PRNGS += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := entropium.o sha256-asm.o
-$(ALGO_NAME)_TEST_BIN := main-entropium-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-entropium-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
STREAM_CIPHERS += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := grain.o
-$(ALGO_NAME)_TEST_BIN := main-grain-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-grain-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_stream_test.o nessie_common.o cli.o string-extras.o \
performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
MACS += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := hmac-sha1.o sha1-asm.o
-$(ALGO_NAME)_TEST_BIN := main-hmac-sha1-test.o debug.o uart.o serial-tools.o cli.o string-extras.o \
+$(ALGO_NAME)_TEST_BIN := main-hmac-sha1-test.o debug.o uart.o hexdigit_tab.o serial-tools.o cli.o string-extras.o \
nessie_mac_test.o nessie_common.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
$(ALGO_NAME)_PERFORMANCE_TEST := "performance"
MACS += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := hmac-sha256.o sha256-asm.o
-$(ALGO_NAME)_TEST_BIN := main-hmac-sha256-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-hmac-sha256-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_mac_test.o nessie_common.o cli.o string-extras.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
$(ALGO_NAME)_PERFORMANCE_TEST := "performance"
HASHES += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := md5.o
-$(ALGO_NAME)_TEST_BIN := main-md5-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-md5-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_hash_test.o nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
$(ALGO_NAME)_PERFORMANCE_TEST := "performance"
HASHES += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := md5-asm.o
-$(ALGO_NAME)_TEST_BIN := main-md5-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-md5-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_hash_test.o nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
$(ALGO_NAME)_PERFORMANCE_TEST := "performance"
$(ALGO_NAME)_OBJ := noekeon_asm.o
-$(ALGO_NAME)_TEST_BIN := main-noekeon-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-noekeon-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_bc_test.o nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := test nessie
$(ALGO_NAME)_PERFORMANCE_TEST := performance
$(ALGO_NAME)_OBJ := noekeon.o
-$(ALGO_NAME)_TEST_BIN := main-noekeon-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-noekeon-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_bc_test.o nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := test nessie
$(ALGO_NAME)_PERFORMANCE_TEST := performance
$(ALGO_NAME)_OBJ := noekeon_asm.o omac_noekeon.o memxor.o
-$(ALGO_NAME)_TEST_BIN := main-omac-noekeon-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-omac-noekeon-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_mac_test.o nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := test nessie
$(ALGO_NAME)_PERFORMANCE_TEST := performance
$(ALGO_NAME)_OBJ := noekeon_asm.o omac_noekeon_C.o memxor.o
-$(ALGO_NAME)_TEST_BIN := main-omac-noekeon-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-omac-noekeon-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_mac_test.o nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := test nessie
$(ALGO_NAME)_PERFORMANCE_TEST := performance
$(ALGO_NAME)_OBJ := present.o
-$(ALGO_NAME)_TEST_BIN := main-present-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-present-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_bc_test.o nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
$(ALGO_NAME)_PERFORMANCE_TEST := "performance"
$(ALGO_NAME)_OBJ := rc5.o
-$(ALGO_NAME)_TEST_BIN := main-rc5-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-rc5-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_bc_test.o \
nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := test nessie
$(ALGO_NAME)_OBJ := rc6.o
-$(ALGO_NAME)_TEST_BIN := main-rc6-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-rc6-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_bc_test.o nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := test nessie
$(ALGO_NAME)_PERFORMANCE_TEST := performance
BLOCK_CIPHERS += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := seed-asm.o
-$(ALGO_NAME)_TEST_BIN := main-seed-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-seed-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_bc_test.o nessie_common.o \
cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
BLOCK_CIPHERS += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := seed_C.o
-$(ALGO_NAME)_TEST_BIN := main-seed-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-seed-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_bc_test.o nessie_common.o \
cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
$(ALGO_NAME)_OBJ := serpent-asm.o serpent-sboxes-bitslice-asm.o memxor.o
-$(ALGO_NAME)_TEST_BIN := main-serpent-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-serpent-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_bc_test.o nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
$(ALGO_NAME)_PERFORMANCE_TEST := "performance"
$(ALGO_NAME)_OBJ := serpent-sboxes-bitslice-asm.o serpent-asm.o memxor.o
-$(ALGO_NAME)_TEST_BIN := main-serpent-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-serpent-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_bc_test.o nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
$(ALGO_NAME)_PERFORMANCE_TEST := "performance"
$(ALGO_NAME)_OBJ := serpent-asm.o serpent-sboxes-fast.o memxor.o
-$(ALGO_NAME)_TEST_BIN := main-serpent-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-serpent-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_bc_test.o nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
$(ALGO_NAME)_PERFORMANCE_TEST := "performance"
$(ALGO_NAME)_OBJ := serpent-asm.o serpent-sboxes-small.o memxor.o
-$(ALGO_NAME)_TEST_BIN := main-serpent-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-serpent-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_bc_test.o nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
$(ALGO_NAME)_PERFORMANCE_TEST := "performance"
$(ALGO_NAME)_OBJ := serpent.o serpent-sboxes_c.o memxor.o
-$(ALGO_NAME)_TEST_BIN := main-serpent-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-serpent-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_bc_test.o nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
$(ALGO_NAME)_PERFORMANCE_TEST := "performance"
HASHES += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := sha1-asm.o
-$(ALGO_NAME)_TEST_BIN := main-sha1-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-sha1-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_hash_test.o nessie_common.o cli.o string-extras.o \
performance_test.o hfal-basic.o hfal_sha1.o shavs.o dump.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
HASHES += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := sha1.o
-$(ALGO_NAME)_TEST_BIN := main-sha1-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-sha1-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_hash_test.o nessie_common.o cli.o string-extras.o \
performance_test.o hfal-basic.o hfal_sha1.o shavs.o dump.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
HASHES += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := sha256-asm.o
-$(ALGO_NAME)_TEST_BIN := main-sha256-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-sha256-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_hash_test.o nessie_common.o cli.o string-extras.o performance_test.o \
hfal-basic.o hfal_sha256.o shavs.o dump.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
HASHES += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := sha256.o
-$(ALGO_NAME)_TEST_BIN := main-sha256-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-sha256-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_hash_test.o nessie_common.o cli.o string-extras.o performance_test.o \
hfal-basic.o hfal_sha256.o shavs.o dump.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
BLOCK_CIPHERS += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := shabea.o sha256-asm.o memxor.o
-$(ALGO_NAME)_TEST_BIN := main-shabea-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-shabea-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_bc_test.o nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
$(ALGO_NAME)_PERFORMANCE_TEST := "performance"
$(ALGO_NAME)_OBJ := shacal1_enc.o sha1-asm.o
-$(ALGO_NAME)_TEST_BIN := main-shacal1_enc-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-shacal1_enc-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_bc_test.o nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
$(ALGO_NAME)_PERFORMANCE_TEST := "performance"
$(ALGO_NAME)_OBJ := shacal2_enc.o sha256-asm.o
-$(ALGO_NAME)_TEST_BIN := main-shacal2_enc-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-shacal2_enc-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_bc_test.o nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
$(ALGO_NAME)_PERFORMANCE_TEST := "performance"
BLOCK_CIPHERS += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := skipjack.o
-$(ALGO_NAME)_TEST_BIN := main-skipjack-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-skipjack-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_bc_test.o nessie_common.o cli.o string-extras.o \
performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
BLOCK_CIPHERS += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := des.o
-$(ALGO_NAME)_TEST_BIN := main-tdes-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-tdes-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_bc_test.o nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
$(ALGO_NAME)_PERFORMANCE_TEST := "performance"
STREAM_CIPHERS += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := trivium.o
-$(ALGO_NAME)_TEST_BIN := main-trivium-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-trivium-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_stream_test.o nessie_common.o cli.o string-extras.o \
performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
HASHES += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := twister-small-asm.o twister-asm.o twister224.o
-$(ALGO_NAME)_TEST_BIN := main-twister224-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-twister224-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_hash_test.o nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
$(ALGO_NAME)_PERFORMANCE_TEST := "performance"
HASHES += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := twister.o twister-small.o memxor.o gf256mul.o
-$(ALGO_NAME)_TEST_BIN := main-twister224-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-twister224-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_hash_test.o nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
$(ALGO_NAME)_PERFORMANCE_TEST := "performance"
HASHES += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := twister-asm.o twister-small-asm.o twister256.o
-$(ALGO_NAME)_TEST_BIN := main-twister256-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-twister256-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_hash_test.o nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
$(ALGO_NAME)_PERFORMANCE_TEST := "performance"
HASHES += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := twister.o twister-small.o memxor.o gf256mul.o
-$(ALGO_NAME)_TEST_BIN := main-twister256-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-twister256-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_hash_test.o nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
$(ALGO_NAME)_PERFORMANCE_TEST := "performance"
HASHES += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := twister-asm.o twister-big-asm.o twister384.o
-$(ALGO_NAME)_TEST_BIN := main-twister384-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-twister384-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_hash_test.o nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
$(ALGO_NAME)_PERFORMANCE_TEST := "performance"
HASHES += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := twister.o twister-big.o memxor.o gf256mul.o
-$(ALGO_NAME)_TEST_BIN := main-twister384-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-twister384-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_hash_test.o nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
$(ALGO_NAME)_PERFORMANCE_TEST := "performance"
HASHES += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := twister-asm.o twister-big-asm.o twister512.o
-$(ALGO_NAME)_TEST_BIN := main-twister512-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-twister512-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_hash_test.o nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
$(ALGO_NAME)_PERFORMANCE_TEST := "performance"
HASHES += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := twister.o twister-big.o memxor.o gf256mul.o
-$(ALGO_NAME)_TEST_BIN := main-twister512-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-twister512-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_hash_test.o nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
$(ALGO_NAME)_PERFORMANCE_TEST := "performance"
BLOCK_CIPHERS += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := xtea-asm.o
-$(ALGO_NAME)_TEST_BIN := main-xtea-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-xtea-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_bc_test.o nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
$(ALGO_NAME)_PERFORMANCE_TEST := "performance"
BLOCK_CIPHERS += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := xtea.o
-$(ALGO_NAME)_TEST_BIN := main-xtea-test.o debug.o uart.o serial-tools.o \
+$(ALGO_NAME)_TEST_BIN := main-xtea-test.o debug.o uart.o hexdigit_tab.o serial-tools.o \
nessie_bc_test.o nessie_common.o cli.o string-extras.o performance_test.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
$(ALGO_NAME)_PERFORMANCE_TEST := "performance"
.int 0x8f1bbcdc
.int 0xca62c1d6
sha1_nextBlock_JumpTable:
-jmp sha1_nextBlock_Ch
-jmp sha1_nextBlock_Parity
-jmp sha1_nextBlock_Maj
-jmp sha1_nextBlock_Parity
+rjmp sha1_nextBlock_Ch
+ nop
+rjmp sha1_nextBlock_Parity
+ nop
+rjmp sha1_nextBlock_Maj
+ nop
+rjmp sha1_nextBlock_Parity
/* X and Y still point at a[1] aka b ; return value in tmp1 */
sha1_nextBlock_Ch:
ldd tmp3, Y+7 /* load from d */
and tmp2, tmp3
eor tmp1, tmp2
- /**
- precall
- ldi r24, lo8(ch_str)
- ldi r25, hi8(ch_str)
- call uart_putstr_P
- postcall
- /**/
ret
sha1_nextBlock_Maj:
eor tmp1, tmp2
and tmp3, tmp4
eor tmp1, tmp3
- /**
- precall
- ldi r24, lo8(maj_str)
- ldi r25, hi8(maj_str)
- call uart_putstr_P
- postcall
- /**/
ret
sha1_nextBlock_Parity:
eor tmp1, tmp2
ldd tmp2, Y+7 /* load from d */
eor tmp1, tmp2
-
- /**
- precall
- ldi r24, lo8(parity_str)
- ldi r25, hi8(parity_str)
- call uart_putstr_P
- postcall
- /**/
ret
/*
ch_str: .asciz "\r\nCh"
#include "string-extras.h"
#include "cli.h"
#include "config.h"
+#include "hexdigit_tab.h"
cli_rx_fpt cli_rx = NULL;
cli_tx_fpt cli_tx = NULL;
* will have 2*n continous hexadecimal characters.
*/
void cli_hexdump(void* data, uint16_t length){
- char hex_tab[] = {'0', '1', '2', '3',
- '4', '5', '6', '7',
- '8', '9', 'A', 'B',
- 'C', 'D', 'E', 'F'};
if(!cli_tx)
return;
while(length--){
- cli_tx(hex_tab[(*((uint8_t*)data))>>4]);
- cli_tx(hex_tab[(*((uint8_t*)data))&0xf]);
+ cli_tx(pgm_read_byte(hexdigit_tab_P +((*((uint8_t*)data))>>4)));
+ cli_tx(pgm_read_byte(hexdigit_tab_P +((*((uint8_t*)data))&0xf)));
data = (uint8_t*)data +1;
}
}
+/**
+ * \brief dumps the contents of a buffer to the console
+ * This function behaves like cli_hexdump except that the
+ * bytes are dumped in reverse order. This is usefull to dump
+ * integers which ar e in little endian order.
+ */
+void cli_hexdump_rev(void* data, uint16_t length){
+ if(!cli_tx)
+ return;
+ data = (uint8_t*)data + length -1;
+ while(length--){
+ cli_tx(pgm_read_byte(hexdigit_tab_P +((*((uint8_t*)data))>>4)));
+ cli_tx(pgm_read_byte(hexdigit_tab_P +((*((uint8_t*)data))&0xf)));
+ data = (uint8_t*)data -1;
+ }
+}
+
/**
* \brief dumps the contents of a buffer to the console
* Like cli_hexdump but bytes are seperated with a single space
* on the console output.
*/
void cli_hexdump2(void* data, uint16_t length){
- char hex_tab[] = {'0', '1', '2', '3',
- '4', '5', '6', '7',
- '8', '9', 'A', 'B',
- 'C', 'D', 'E', 'F'};
if(!cli_tx)
return;
while(length--){
- cli_tx(hex_tab[(*((uint8_t*)data))>>4]);
- cli_tx(hex_tab[(*((uint8_t*)data))&0xf]);
+ cli_tx(pgm_read_byte(hexdigit_tab_P +((*((uint8_t*)data))>>4)));
+ cli_tx(pgm_read_byte(hexdigit_tab_P +((*((uint8_t*)data))&0xf)));
cli_tx(' ');
data = (uint8_t*)data +1;
}
cli_putstr_P(PSTR(" \t- 0x"));
}
}
- cli_hexdump(&item.cmd_function, 2);
+ cli_hexdump_rev(&item.cmd_function, 2);
cli_putstr_P(PSTR("\r\n"));
}
}
void cli_putstr(char* s);
void cli_putstr_P(PGM_P s);
void cli_hexdump(void* data, uint16_t length);
+void cli_hexdump_rev(void* data, uint16_t length);
void cli_hexdump2(void* data, uint16_t length);
void echo_ctrl(char* s);
int8_t cmd_interface(PGM_VOID_P cmd_desc);
#include <avr/io.h>
#include <avr/interrupt.h>
#include <stdlib.h>
-
+#include "hexdigit_tab.h"
#include "uart.h"
#ifdef ATMEGA128
void uart_hexdump(const void* buf, int len)
{
- unsigned char table[]={'0','1','2','3','4','5','6','7',
- '8','9','a','b','c','d','e','f'};
while(len--){
- uart_putc(table[((*((char*)buf))>>4)&0xf]);
- uart_putc(table[(*((char*)buf))&0xf]);
+ uart_putc(pgm_read_byte(hexdigit_tab_P + ((*((uint8_t*)buf))>>4)));
+ uart_putc(pgm_read_byte(hexdigit_tab_P + ((*((uint8_t*)buf))&0xf)));
uart_putc(' ');
buf=(uint8_t*)buf+1;
}