aboutsummaryrefslogtreecommitdiff
path: root/libraries/libtfm
diff options
context:
space:
mode:
authorPaul Selkirk <paul@psgd.org>2018-12-05 14:40:16 -0500
committerPaul Selkirk <paul@psgd.org>2018-12-05 14:40:16 -0500
commita89dcb22ca549ae17742a8ee3c08f2d7fd606771 (patch)
treef34d6dd56068d54542a75df5ec16dc878b722574 /libraries/libtfm
parentb333546b2fdb752388a1454969d23f6bf96c41bf (diff)
Tell libtfm that the ARM is little-endian, so it can optimize fp_read_unsigned_bin().
This enables some overflow-detection code, which fixes CT-01-009. It also saves 484us/call, which adds up to 6.3ms/RSA signature.
Diffstat (limited to 'libraries/libtfm')
-rw-r--r--libraries/libtfm/Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/libraries/libtfm/Makefile b/libraries/libtfm/Makefile
index b50421c..359729b 100644
--- a/libraries/libtfm/Makefile
+++ b/libraries/libtfm/Makefile
@@ -38,7 +38,7 @@ STM32_LIBTFM_CFLAGS_OPTIMIZATION := -O3 -funroll-loops -fomit-frame-pointer
endif
CFLAGS := $(subst ${STM32_CFLAGS_OPTIMIZATION},${STM32_LIBTFM_CFLAGS_OPTIMIZATION},${CFLAGS})
-CFLAGS += -DTFM_ARM -Dasm=__asm__ -Wa,-mimplicit-it=thumb
+CFLAGS += -DTFM_ARM -DENDIAN_LITTLE -Dasm=__asm__ -Wa,-mimplicit-it=thumb
CFLAGS += -I${LIBTFM_SRC}/tomsfastmath/src/headers
CFLAGS += -DFP_MAX_SIZE="(${BITS}*2+(8*DIGIT_BIT))"
CFLAGS += -Wall -W -Wshadow -Wno-uninitialized