Skip to content

Commit 2306d15

Browse files
committed
Declare new config.h option MBEDTLS_SHA512_SMALLER
1 parent b6229e3 commit 2306d15

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

include/mbedtls/config.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,16 @@
982982
*/
983983
//#define MBEDTLS_SHA256_SMALLER
984984

985+
/**
986+
* \def MBEDTLS_SHA512_SMALLER
987+
*
988+
* Enable an implementation of SHA-512 that has lower ROM footprint but also
989+
* lower performance.
990+
*
991+
* Uncomment to enable the smaller implementation of SHA512.
992+
*/
993+
//#define MBEDTLS_SHA512_SMALLER
994+
985995
/**
986996
* \def MBEDTLS_THREADING_ALT
987997
*

library/version_features.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,9 @@ static const char *features[] = {
405405
#if defined(MBEDTLS_SHA256_SMALLER)
406406
"MBEDTLS_SHA256_SMALLER",
407407
#endif /* MBEDTLS_SHA256_SMALLER */
408+
#if defined(MBEDTLS_SHA512_SMALLER)
409+
"MBEDTLS_SHA512_SMALLER",
410+
#endif /* MBEDTLS_SHA512_SMALLER */
408411
#if defined(MBEDTLS_THREADING_ALT)
409412
"MBEDTLS_THREADING_ALT",
410413
#endif /* MBEDTLS_THREADING_ALT */

programs/test/query_config.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,6 +1109,14 @@ int query_config( const char *config )
11091109
}
11101110
#endif /* MBEDTLS_SHA256_SMALLER */
11111111

1112+
#if defined(MBEDTLS_SHA512_SMALLER)
1113+
if( strcmp( "MBEDTLS_SHA512_SMALLER", config ) == 0 )
1114+
{
1115+
MACRO_EXPANSION_TO_STR( MBEDTLS_SHA512_SMALLER );
1116+
return( 0 );
1117+
}
1118+
#endif /* MBEDTLS_SHA512_SMALLER */
1119+
11121120
#if defined(MBEDTLS_THREADING_ALT)
11131121
if( strcmp( "MBEDTLS_THREADING_ALT", config ) == 0 )
11141122
{

0 commit comments

Comments
 (0)