mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-13 03:15:06 +00:00
Add option to adjust compiler optimization on RSA
Using -O3 optimization level rather than -Os results in a large speed-up for a minor code size increase for the RSA code with our current GCC toolchain. Add the CONFIG_RSA_OPTIMIZED option to do it on platforms which are not too size-constrained. On cortex-M4 based STM32L432, I'm measuring a 37 to 40% speed increase (depending on CPU frequency) for a 200 bytes code size delta. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=none TEST=manual: benchmark RSA2048 with F4 exponent on STM32L432: -Os -O3 @16Mhz 185163 us --> 111942 us @80Mhz 39286 us --> 24582 us Change-Id: I8c2e4b757f037f4f645fb73ba0faaaa471b24896 Reviewed-on: https://chromium-review.googlesource.com/445218 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
This commit is contained in:
committed by
chrome-bot
parent
7757a8e872
commit
a1c8d50e9b
@@ -127,3 +127,8 @@ else
|
||||
common-y+=test_util.o
|
||||
endif
|
||||
common-$(TEST_BUILD)+=sensor_common.o
|
||||
|
||||
ifneq ($(CONFIG_RSA_OPTIMIZED),)
|
||||
$(out)/RW/common/rsa.o: CFLAGS+=-O3
|
||||
$(out)/RO/common/rsa.o: CFLAGS+=-O3
|
||||
endif
|
||||
|
||||
@@ -1782,6 +1782,12 @@
|
||||
/* Use RSA exponent 3 instead of F4 (65537) */
|
||||
#undef CONFIG_RSA_EXPONENT_3
|
||||
|
||||
/*
|
||||
* Adjust the compiler optimization flags for the RSA code to get a speed-up
|
||||
* at the expense of a small code size delta.
|
||||
*/
|
||||
#undef CONFIG_RSA_OPTIMIZED
|
||||
|
||||
/*
|
||||
* Verify the RW firmware using the RSA signature.
|
||||
* (for accessories without software sync)
|
||||
|
||||
Reference in New Issue
Block a user