updated sha1
This commit is contained in:
parent
5fe96fa58f
commit
74fe0d1999
4
config.h
4
config.h
|
@ -19,8 +19,8 @@
|
|||
#ifndef __CONFIG_H__
|
||||
#define __CONFIG_H__
|
||||
#include <avr/io.h>
|
||||
|
||||
#define F_CPU 16000000 /* Oszillator-Frequenz in Hz */
|
||||
#define F_CPU 20000000
|
||||
// #define F_CPU 16000000 /* Oszillator-Frequenz in Hz */
|
||||
// #define F_CPU 14745600
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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_ */
|
||||
|
|
|
@ -60,6 +60,7 @@ def readTestVector(param)
|
|||
if(m)
|
||||
fname+=m[1]+".";
|
||||
end
|
||||
return false if lb==nil
|
||||
buffer+=lb;
|
||||
lb = read_line();
|
||||
end
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
33
sha1-asm.S
33
sha1-asm.S
|
@ -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"
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue