summaryrefslogtreecommitdiff
path: root/lib/mbedtls/mbedtls_def_config.h
diff options
context:
space:
mode:
authorRaymond Mao <raymond.mao@linaro.org>2024-10-03 14:50:20 -0700
committerTom Rini <trini@konsulko.com>2024-10-14 17:58:32 -0600
commitc60e99ff629c384aa7b9ac4f7badcf3cfdf953c1 (patch)
treefd52a9667773b1fe729c0d5b76d061af9fa93a24 /lib/mbedtls/mbedtls_def_config.h
parentbdc3f44a6bf4de61d99c818b3e8e71b07a9eea52 (diff)
mbedtls: Enable smaller implementation for SHA256/512
Smaller implementation for SHA256 and SHA512 helps to reduce the ROM footprint though it has a certain impact on performance. As a trade-off, enable it as a default config when MbedTLS is enabled can reduce the target size significantly with acceptable performance loss. Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'lib/mbedtls/mbedtls_def_config.h')
-rw-r--r--lib/mbedtls/mbedtls_def_config.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/mbedtls/mbedtls_def_config.h b/lib/mbedtls/mbedtls_def_config.h
index 6fba053bd7c..1af911c2003 100644
--- a/lib/mbedtls/mbedtls_def_config.h
+++ b/lib/mbedtls/mbedtls_def_config.h
@@ -35,6 +35,9 @@
#if defined CONFIG_MBEDTLS_LIB_CRYPTO_ALT
#define MBEDTLS_SHA256_ALT
#endif
+#if CONFIG_IS_ENABLED(SHA256_SMALLER)
+#define MBEDTLS_SHA256_SMALLER
+#endif
#endif
#if CONFIG_IS_ENABLED(SHA384)
@@ -48,6 +51,9 @@
#if defined CONFIG_MBEDTLS_LIB_CRYPTO_ALT
#define MBEDTLS_SHA512_ALT
#endif
+#if CONFIG_IS_ENABLED(SHA512_SMALLER)
+#define MBEDTLS_SHA512_SMALLER
+#endif
#endif
#if defined CONFIG_MBEDTLS_LIB_X509