diff --git a/common/build.mk b/common/build.mk index c3a9023fcb..6c13a9c4d0 100644 --- a/common/build.mk +++ b/common/build.mk @@ -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 diff --git a/include/config.h b/include/config.h index 94ddba963c..19a6653161 100644 --- a/include/config.h +++ b/include/config.h @@ -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)