Add ability to use a statically generated ecmult context.

This vastly shrinks the size of the context required for signing on devices with
memory-mapped Flash.

Tables are generated by the new gen_context tool into a header.
This commit is contained in:
Thomas Daede
2015-05-19 17:32:35 -07:00
parent 0cbc8600f3
commit fbecc38a89
9 changed files with 269 additions and 3 deletions

View File

@@ -74,4 +74,22 @@ tests_LDFLAGS = -static
TESTS = tests
endif
if USE_ECMULT_STATIC_PRECOMPUTATION
CPPFLAGS_FOR_BUILD +=-I.
CFLAGS_FOR_BUILD += -Wall -Wextra -Wno-unused-function
gen_context_OBJECTS = gen_context.o
gen_%.o: src/gen_%.c
$(CC_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) -c $< -o $@
gen_context$(BUILD_EXEEXT): $(gen_context_OBJECTS)
$(CC_FOR_BUILD) $^ -o $@
BUILT_SOURCES = src/ecmult_static_context.h
src/ecmult_static_context.h: gen_context
./gen_context
endif
EXTRA_DIST = autogen.sh