# Makefile for the AVR-Crypto-Lib project
# author: Daniel Otte
+SHELL = sh
BLOCK_CIPHERS :=
STREAM_CIPHERS :=
MACS :=
PRNGS :=
ENCODINGS :=
+AUX :=
# we use the gnu make standard library
include gmsl
include avr-makefile.inc
include mkfiles/*.mk
-ALGORITHMS = $(BLOCK_CIPHERS) $(STREAM_CIPHERS) $(HASHES) $(PRNGS) $(MACS) $(ENCODINGS)
+ALGORITHMS = $(BLOCK_CIPHERS) $(STREAM_CIPHERS) $(HASHES) $(PRNGS) $(MACS) $(ENCODINGS) $(AUX)
ALGORITHMS_OBJ = $(patsubst %,%_OBJ, $(ALGORITHMS))
ALGORITHMS_TEST_BIN = $(patsubst %,%_TEST_BIN, $(ALGORITHMS))
all_testrun: $(foreach algo, $(ALGORITHMS), $(algo)_TESTRUN)
+#-------------------------------------------------------------------------------
+
+define TESTSPEED_TEMPLATE
+$(1)_TESTSPEED: $(1)_FLASH
+ @echo "[speed]: $(1)"
+ $(RUBY) $(GET_PERFORMANCE) $(TESTPORT) $(TESTPORTBAUDR) 8 1 performance $(SPEEDLOG_DIR)$(SPEEDPREFIX) $(2)
+endef
+
+$(foreach algo, $(ALGORITHMS),$(eval $(call TESTSPEED_TEMPLATE, $(algo), $(call lc,$(algo)) )))
+
+all_testspeed: $(foreach algo, $(ALGORITHMS), $(algo)_TESTSPEED)
+hash_testspeed: $(foreach algo, $(HASHES), $(algo)_TESTSPEED)
+
+
#-------------------------------------------------------------------------------
define LISTING_TEMPLATE
TESTPORTBAUDR = 38400
TESTLOG_DIR = testlog/
TESTPREFIX = nessie-
+SPEEDLOG_DIR = speed_log/
+SPEEDPREFIX =
LIST_DIR = listings/
STAT_DIR = stats/
AUTOASM_DIR = autoasm/
SIZESTAT_FILE = sizestats.txt
-OBJCOPY = avr-objcopy
-OBJDUMP = avr-objdump
-SIZE = avr-size
-READELF = readelf
-RUBY = ruby
-GET_TEST = host/get_test.rb
-MAKE = make
-MAKE2GRAPH = ~/bin/make2graph.rb
-TWOPI = twopi
+OBJCOPY = avr-objcopy
+OBJDUMP = avr-objdump
+SIZE = avr-size
+READELF = readelf
+RUBY = ruby
+GET_TEST = host/get_test.rb
+GET_PERFORMANCE = host/get_performance.rb
+MAKE = make
+MAKE2GRAPH = ~/bin/make2graph.rb
+TWOPI = twopi
m = lb.match(/ctx2hash \(cycles\):[\s]*([\d]*)/)
convtime = m[1].to_i()
- printf("| %s || C || C || || %4d || %4d || %4d || %6d || %6d || %6.2f || %6d || || || \n|-\n" ,
- name, ctxsize, hashsize, blocksize, inittime, nextblocktime, nextblocktime.to_f/blocksize*8, lastblocktime+convtime)
+ printf("| %20s || %3s || %3s || || %4d || %4d || %4d ||" +
+ " %6d || %6d || %7.2f || %6d || || || \n|-\n" ,
+ name, $lang, $lang ,ctxsize, hashsize, blocksize,
+ inittime, nextblocktime, nextblocktime.to_f/blocksize*8,
+ lastblocktime+convtime)
end
def process_file(fname)
fin = File.open(fname, "r")
+ $lang = "asm"
+ $lang = "C" if fname.match(/_c.txt$/)
begin
begin
if fin.eof()
ALGO_NAME := UBI
# comment out the following line for removement of ubi from the build process
-HASHES += $(ALGO_NAME)
+AUX += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := threefish_mix.o threefish256_enc_asm.o ubi256_asm.o \