From 2306d1534450e29bdf85581e0458c07806fb0228 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Wed, 17 Jul 2019 12:36:53 +0200 Subject: [PATCH] Declare new config.h option MBEDTLS_SHA512_SMALLER --- include/mbedtls/config.h | 10 ++++++++++ library/version_features.c | 3 +++ programs/test/query_config.c | 8 ++++++++ 3 files changed, 21 insertions(+) diff --git a/include/mbedtls/config.h b/include/mbedtls/config.h index 56ad01c40..f1b6605b2 100644 --- a/include/mbedtls/config.h +++ b/include/mbedtls/config.h @@ -982,6 +982,16 @@ */ //#define MBEDTLS_SHA256_SMALLER +/** + * \def MBEDTLS_SHA512_SMALLER + * + * Enable an implementation of SHA-512 that has lower ROM footprint but also + * lower performance. + * + * Uncomment to enable the smaller implementation of SHA512. + */ +//#define MBEDTLS_SHA512_SMALLER + /** * \def MBEDTLS_THREADING_ALT * diff --git a/library/version_features.c b/library/version_features.c index 4f1da6aea..7feeee419 100644 --- a/library/version_features.c +++ b/library/version_features.c @@ -405,6 +405,9 @@ static const char *features[] = { #if defined(MBEDTLS_SHA256_SMALLER) "MBEDTLS_SHA256_SMALLER", #endif /* MBEDTLS_SHA256_SMALLER */ +#if defined(MBEDTLS_SHA512_SMALLER) + "MBEDTLS_SHA512_SMALLER", +#endif /* MBEDTLS_SHA512_SMALLER */ #if defined(MBEDTLS_THREADING_ALT) "MBEDTLS_THREADING_ALT", #endif /* MBEDTLS_THREADING_ALT */ diff --git a/programs/test/query_config.c b/programs/test/query_config.c index fc25353fa..10634306a 100644 --- a/programs/test/query_config.c +++ b/programs/test/query_config.c @@ -1109,6 +1109,14 @@ int query_config( const char *config ) } #endif /* MBEDTLS_SHA256_SMALLER */ +#if defined(MBEDTLS_SHA512_SMALLER) + if( strcmp( "MBEDTLS_SHA512_SMALLER", config ) == 0 ) + { + MACRO_EXPANSION_TO_STR( MBEDTLS_SHA512_SMALLER ); + return( 0 ); + } +#endif /* MBEDTLS_SHA512_SMALLER */ + #if defined(MBEDTLS_THREADING_ALT) if( strcmp( "MBEDTLS_THREADING_ALT", config ) == 0 ) {