]> git.cryptolib.org Git - avr-crypto-lib.git/commitdiff
updated sha1
authorbg <bg@b1d182e4-1ff8-0310-901f-bddb46175740>
Tue, 10 Feb 2009 00:37:51 +0000 (00:37 +0000)
committerbg <bg@b1d182e4-1ff8-0310-901f-bddb46175740>
Tue, 10 Feb 2009 00:37:51 +0000 (00:37 +0000)
58 files changed:
config.h
hashfunction_descriptor.h
hfal-basic.c
hfal-basic.h
host/get_test.rb
mkfiles/a5_1.mk
mkfiles/aes.mk
mkfiles/aes_asm_faster.mk
mkfiles/aes_c.mk
mkfiles/arcfour.mk
mkfiles/arcfour_c.mk
mkfiles/camellia.mk
mkfiles/cast5.mk
mkfiles/des.mk
mkfiles/entropium.mk
mkfiles/grain.mk
mkfiles/hmac-sha1.mk
mkfiles/hmac-sha256.mk
mkfiles/md5.mk
mkfiles/md5_asm.mk
mkfiles/noekeon.mk
mkfiles/noekeon_c.mk
mkfiles/omac_noekeon.mk
mkfiles/omac_noekeon_c.mk
mkfiles/present.mk
mkfiles/rc5.mk
mkfiles/rc6.mk
mkfiles/seed.mk
mkfiles/seed_C.mk
mkfiles/serpent-bitslice.mk
mkfiles/serpent_asm_bitslice.mk
mkfiles/serpent_asm_fast.mk
mkfiles/serpent_asm_small.mk
mkfiles/serpent_c.mk
mkfiles/sha1.mk
mkfiles/sha1_c.mk
mkfiles/sha256.mk
mkfiles/sha256_c.mk
mkfiles/shabea.mk
mkfiles/shacal1enc.mk
mkfiles/shacal2enc.mk
mkfiles/skipjack.mk
mkfiles/tdes.mk
mkfiles/trivium.mk
mkfiles/twister224.mk
mkfiles/twister224_c.mk
mkfiles/twister256.mk
mkfiles/twister256_c.mk
mkfiles/twister384.mk
mkfiles/twister384_c.mk
mkfiles/twister512.mk
mkfiles/twister512_c.mk
mkfiles/xtea.mk
mkfiles/xtea_c.mk
sha1-asm.S
test_src/cli.c
test_src/cli.h
test_src/uart.c

index 21404d4acb8ed341c62207f396034c2a3c7efafe..00d10efa607bdc03250985a29df82e8fd7a64c8f 100644 (file)
--- a/config.h
+++ b/config.h
@@ -19,9 +19,9 @@
 #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
 
 
 
index 3440cd0dcec468ed924ec27f09404fa1607a7797..e1347dcaccbc54015e1dc71ea111706808263dd7 100644 (file)
@@ -15,7 +15,7 @@ typedef void(*hf_nextBlock_fpt)(void*, const void*);
 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
index b0ec35c5782c4ca5fe0fd9671d0b5bba3639db62..1be95d37baf310735a7ddb067773fb8473a60c7b 100644 (file)
@@ -88,13 +88,13 @@ void hfal_hash_mem(const hfdesc_t* hash_descriptor, void* dest, const void* msg,
        }
 } 
 
-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;
index b00e46bec432be88c48f26ed623ae521f4cb44f3..7737e0546c01cb0ae505d7c7c5e05fb5a29b2b1e 100644 (file)
@@ -29,7 +29,7 @@ void hfal_hash_lastBlock(hfgen_ctx_t* ctx, const void* block, uint16_t length_b)
 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_ */
index cfc3b33a093a67e2e6382c5638132ad1003e0f2c..2a12de1334459d73e81297980b504c7c57f2decc 100644 (file)
@@ -60,8 +60,9 @@ def readTestVector(param)
     if(m) 
       fname+=m[1]+".";
     end
+    return false if lb==nil
     buffer+=lb;
-       lb = read_line();
+    lb = read_line();
   end
   if(param!="")
     fname+=param+".";
index d4617f0e8bc49741e06e96ff51c1283efc5e9063..1264b31e213d12ad27fbe893e7f0ea27ea9254ff 100644 (file)
@@ -5,7 +5,7 @@ ALGO_NAME := A51
 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"
index bfb0b8aea3a23f40ce908fbab41b2394c20ce5bc..950f740e56710c9fd05cc61d54e4c04dce557031 100644 (file)
@@ -7,7 +7,7 @@ BLOCK_CIPHERS += $(ALGO_NAME)
 
 $(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
index 6a6079b885417d62f89a95a90f9c9ceaf6344e12..75ae39ef3973ab4a1701b3a23a53b6465a810a5f 100644 (file)
@@ -7,7 +7,7 @@ BLOCK_CIPHERS += $(ALGO_NAME)
 
 $(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
index dcd224021b6132b55c152fa5a420cabfc1b66e16..81da3cb2815cfaa17cccec87b6fad165abcf6ca7 100644 (file)
@@ -9,7 +9,7 @@ $(ALGO_NAME)_OBJ      := aes_enc.o aes_dec.o aes_sbox.o aes_invsbox.o \
                          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
index 7e8e33b8df5d5fdf667bec92d11f8d674731306a..7c37869e03d84838aa2bc04c6044a96450c6a3e1 100644 (file)
@@ -5,7 +5,7 @@ ALGO_NAME := ARCFOUR
 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"
index b34961421074307a5ef149bc55b57ebd32233521..33ce65f4a60f4099922b0e2d40888cffa21340e2 100644 (file)
@@ -5,7 +5,7 @@ ALGO_NAME := ARCFOUR_C
 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"
index db85f5012f99b769b8ff6c7a750b59e60b554458..4b7974b006f15e99f817e0b85269c3606001e017 100644 (file)
@@ -5,7 +5,7 @@ ALGO_NAME := CAMELLIA
 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"
index dacc1772b09c8cd784befed9a7bf9bc6bfa411fe..18dd483691d37ed40a871d9ff85c34e45018f1ca 100644 (file)
@@ -5,7 +5,7 @@ ALGO_NAME := CAST5
 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"
index 8e2b162c17e9b283eeeed59b2ca7b1d02e300197..7a1287350a18866e5e169ead3b8cf16acd3cb79f 100644 (file)
@@ -5,7 +5,7 @@ ALGO_NAME := DES
 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"
index 2ee6de6e8f5a65092e7aac5ff3fe9e533e250436..14cc8bdd233674c45937d4109a5f9bb71c98d2a4 100644 (file)
@@ -5,7 +5,7 @@ ALGO_NAME := ENTROPIUM
 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"
index 8d83a81a6d2533cce62a3fc4925dc426610230b4..406bc4d739a80c1bd3a39555b3cfa2a754271ade 100644 (file)
@@ -5,7 +5,7 @@ ALGO_NAME := GRAIN
 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"
index 428177beb3265f950f2d657c2e86be170b78504f..d5bec0325c7c3d332def01461fcfb7f3e0b1c8bd 100644 (file)
@@ -5,7 +5,7 @@ ALGO_NAME := HMAC-SHA1
 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"
index e7ec3d8172d6ea1726c16669c4deef8dbfd6f0b6..adfe48cb31e83c8ba532e3015c035b1502059e17 100644 (file)
@@ -5,7 +5,7 @@ ALGO_NAME := HMAC-SHA256
 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"
index de4498b0f3f2d66264a0b66fa27f50b490deac36..1d55c1ea4e5e0969d94acbea98c971a672d72e1f 100644 (file)
@@ -5,7 +5,7 @@ ALGO_NAME := MD5
 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"
index a0603b718524f4d1321f595acb8b41cb57dd180d..41dcac88c78e24859bff098c042fac7fd80ebd48 100644 (file)
@@ -5,7 +5,7 @@ ALGO_NAME := MD5_ASM
 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"
index db2252b4265eb4e1f27a8101e9e4cf8f6a18a44c..b3fdccf66fb949ff363a2028765f6ae28eddb29f 100644 (file)
@@ -6,7 +6,7 @@ BLOCK_CIPHERS += $(ALGO_NAME)
 
 
 $(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
index d69c370c9296ef9093bc557e793ae858763aed1b..ad0aa590822c9f395105a63c1e4843fd7a9f343c 100644 (file)
@@ -6,7 +6,7 @@ BLOCK_CIPHERS += $(ALGO_NAME)
 
 
 $(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
index f5a8d0c1cc1bfbdb3e7deff5c39995262e45ef98..d59b22fb6dcabe282eb2cb519fc611ef4d64d6d2 100644 (file)
@@ -6,7 +6,7 @@ MACS += $(ALGO_NAME)
 
 
 $(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
index fedd27154d93043eb12ae1a13ef9c04d02b82e22..efd6e6c42df2c7e364d3158a816eb76b2fe68f0f 100644 (file)
@@ -6,7 +6,7 @@ MACS += $(ALGO_NAME)
 
 
 $(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
index 6a1a614708ca5f0e3f05f84c9b4cd09c0cebf10d..b60eb81df38ec1fb9348678fd906f23f91b67c5e 100644 (file)
@@ -6,7 +6,7 @@ BLOCK_CIPHERS += $(ALGO_NAME)
 
 
 $(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"
index d165950e20904acefd1ebb452be21376409b5b6c..3852d7b64b09a6b793d72b27640ade6efc27f715 100644 (file)
@@ -6,7 +6,7 @@ BLOCK_CIPHERS += $(ALGO_NAME)
 
 
 $(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
index 4f15d03d4bcfdfcfd25c8964dbc1d629dbe40d2a..1b357eb1707007cd5a5cac43d63ec45d55270648 100644 (file)
@@ -6,7 +6,7 @@ BLOCK_CIPHERS += $(ALGO_NAME)
 
 
 $(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
index 25723b49d7ec78b33f6b063524b7086434d17ab7..a79f78ac6e4c21cdd5e5598dd2dd8c75aa1badae 100644 (file)
@@ -5,7 +5,7 @@ ALGO_NAME := SEED
 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"
index 970c3dd31bd7207b3e8b613193117bb82945a59f..05fd25d3600526786e6a541f73fbf76939c74879 100644 (file)
@@ -5,7 +5,7 @@ ALGO_NAME := SEED_C
 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"
index 4fa8936c1062060a651f21191dbf75192cd3b3ca..4d68c22b5360c6f6f22826a7390a22ec2e79370f 100644 (file)
@@ -6,7 +6,7 @@ BLOCK_CIPHERS += $(ALGO_NAME)
 
 
 $(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"
index 731bf7b5893978c8b3c576d30e58d560f31b0356..80e69bf0e51aaf2c86a788d4d0f747fdd1885747 100644 (file)
@@ -6,7 +6,7 @@ BLOCK_CIPHERS += $(ALGO_NAME)
 
 
 $(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"
index b73460ff7d4ca0048c80eeae4509587b420bc40b..195f83ac67f07eda64a43fe734ef8ebfcb351c47 100644 (file)
@@ -6,7 +6,7 @@ BLOCK_CIPHERS += $(ALGO_NAME)
 
 
 $(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"
index c0f550906d3e3908ef5fcac3af329b2f620e0424..46ad45e63c41e5c504b3a778a13193e323833171 100644 (file)
@@ -6,7 +6,7 @@ BLOCK_CIPHERS += $(ALGO_NAME)
 
 
 $(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"
index bc2411f05cc2c4ec65b0d9e0113e0a627bf97b93..c6162a78de55fd539ff3b65794b4a84976521197 100644 (file)
@@ -6,7 +6,7 @@ BLOCK_CIPHERS += $(ALGO_NAME)
 
 
 $(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"
index ebedba00ed7ae46a33869da2fe7abbb255d70100..335cafb264903e1a3e357c578130177858bc5c84 100644 (file)
@@ -5,7 +5,7 @@ ALGO_NAME := SHA1
 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"
index 16d13774635d96e4c1b7a5f5058ff250683df116..8a141c4e18c2f39d223cfdc5d6b94a664911bbf0 100644 (file)
@@ -5,7 +5,7 @@ ALGO_NAME := SHA1_C
 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"
index ef14ba450967893c35a9c06ba38434e26cd96b74..35c271a1445b38359c3edaaa09a609ed54f0ec31 100644 (file)
@@ -5,7 +5,7 @@ ALGO_NAME := SHA256
 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"
index ceca8f8f8d37086543e0289282b7f7adcfc897e9..7ad81d06ebcf6bb711ff11bc302a079c37c01771 100644 (file)
@@ -5,7 +5,7 @@ ALGO_NAME := SHA256_C
 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"
index eb9ff266f0e014be959a942c1b3873f7b04ab311..29525e608471f4f28702c054f4e62f402d221311 100644 (file)
@@ -5,7 +5,7 @@ ALGO_NAME := SHABEA
 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"
index b4a99ab60db05ceb5531b7f3da788a6012df0a7a..0bccab15ea2a418c2f391dd26683f5f486784a99 100644 (file)
@@ -6,7 +6,7 @@ BLOCK_CIPHERS += $(ALGO_NAME)
 
 
 $(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"
index 77f03345f24216d2c90d650d168f11a00544953e..0265b10fe5efb480b038894dac157b215e1915f6 100644 (file)
@@ -6,7 +6,7 @@ BLOCK_CIPHERS += $(ALGO_NAME)
 
 
 $(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"
index e0db90b698486223c1a3736f141fe39ffabb5d0e..e546ea3e51b1fd42ec3aa828eff260e34286a05c 100644 (file)
@@ -5,7 +5,7 @@ ALGO_NAME := SKIPJACK
 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"
index 898b7c2807eb655e9cf5cae56f3be13c228c52c7..4e03c9f3ed08006bdcf56a0b9ded37bffb502a31 100644 (file)
@@ -5,7 +5,7 @@ ALGO_NAME := TDES
 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"
index 79cfeb6f38fbcf9d505d8a39e8d012e9562dc727..4f4f0efa9896f9ad955769d80f4ff1e411945cc2 100644 (file)
@@ -5,7 +5,7 @@ ALGO_NAME := TRIVIUM
 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"
index 65b7851ff79a4c600c227c44915196a53130bc5c..d57e00d3197d7f0388981e07a286acaaf8050bd7 100644 (file)
@@ -5,7 +5,7 @@ ALGO_NAME := TWISTER224
 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"
index 5e5f0e7c72c7781c608af254122f1e583b0b7fc9..6ea6ad6ef5f36ed08ca55f62633811c692da7bb0 100644 (file)
@@ -5,7 +5,7 @@ ALGO_NAME := TWISTER224_C
 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"
index a95aeaa33b07824ad98978db25b1f1c9e7cf97c8..8bd3ff8174cd166d41f5671ec7107533af29688d 100644 (file)
@@ -5,7 +5,7 @@ ALGO_NAME := TWISTER256
 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"
index e9cac663f2dd08de889ffc0838a024eb26ec57bb..39d2829a294584e0e037dc1e7f99457d876c6a44 100644 (file)
@@ -5,7 +5,7 @@ ALGO_NAME := TWISTER256_C
 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"
index ef04aa8c75912c09c2104c9610b10fed291b5887..dcc40138697e5ba0d31af40006346deb11271642 100644 (file)
@@ -5,7 +5,7 @@ ALGO_NAME := TWISTER384
 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"
index 247d4d9821963d2c01687fcd888f8e139f195e73..3358dec909af5ff5078253eb22824d0a38441570 100644 (file)
@@ -5,7 +5,7 @@ ALGO_NAME := TWISTER384_C
 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"
index 0d7455b164ef6db85cac9983faffc41c72496766..acd7bab56566fd79516973bf9d0a34843b4066e0 100644 (file)
@@ -5,7 +5,7 @@ ALGO_NAME := TWISTER512
 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"
index 07ce27a1a2dcde734b243fce6c7a4fea579f0941..75b23e028297d8ab968d2505618da668e639cc9c 100644 (file)
@@ -5,7 +5,7 @@ ALGO_NAME := TWISTER512_C
 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"
index bfe5f17c30c89fbe01579cdaa37dcb5c45e1c63d..01dcedfe5106df5c0ac5533c1597ece2eea5d353 100644 (file)
@@ -5,7 +5,7 @@ ALGO_NAME := XTEA
 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"
index 6d88540da01c76a1d36648dafdae7f1568e02995..b5b59b7a225d45bd3c83c40cf3cfba8e91252dd9 100644 (file)
@@ -5,7 +5,7 @@ ALGO_NAME := XTEA_C
 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"
index 74d7c11223aa7a35f1e12638c25d1537c4cdaa04..577d9e812f9896be6d54fe06083b531b7d3208c2 100644 (file)
@@ -799,10 +799,13 @@ sha1_nextBlock_KTable:
 .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:
@@ -814,13 +817,6 @@ 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:
@@ -833,13 +829,6 @@ 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:
@@ -848,14 +837,6 @@ 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"
index 12f4a0a528e74c6539280f2135ae44c1e4fb6811..68d6cf6fbbbdff3ff8895841da5d44b4e82c7922 100644 (file)
@@ -34,6 +34,7 @@
 #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;
@@ -126,34 +127,43 @@ uint8_t cli_getsn(char* s, uint16_t n){
  * 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;
        }
@@ -193,7 +203,7 @@ void cli_auto_help(uint16_t maxcmdlength, PGM_VOID_P cmdlist){
                                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"));
        }
 }
index 018c4dad1f0b7251af4229b3d75fb8d90502bee3..3156d7e541f5ccbdf6e7306fb0dacf6447953bff 100644 (file)
@@ -60,6 +60,7 @@ uint8_t cli_getsn(char* s, uint16_t 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);
index 06b3cec0db0e2f2a7581657e10a4a93bd999a35c..0c9943c914340aa8b715c4daf274443b88a67703 100644 (file)
@@ -23,7 +23,7 @@
 #include <avr/io.h>
 #include <avr/interrupt.h>
 #include <stdlib.h>
-
+#include "hexdigit_tab.h"
 #include "uart.h"
 
 #ifdef ATMEGA128
@@ -279,11 +279,9 @@ void uart_putstr_P(PGM_P str) {
 
 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;
        }