Declare new config.h option MBEDTLS_SHA512_NO_SHA384

This commit is contained in:
Manuel Pégourié-Gonnard 2019-07-17 14:58:03 +02:00
parent 448d1cc854
commit ad6cb11461
4 changed files with 22 additions and 0 deletions

View File

@ -1033,6 +1033,16 @@
*/ */
//#define MBEDTLS_SHA512_SMALLER //#define MBEDTLS_SHA512_SMALLER
/**
* \def MBEDTLS_SHA512_NO_SHA384
*
* Disable the SHA-384 option of the SHA-512 module. Use this to save some
* code size on devices that don't use SHA-384.
*
* Uncomment to disable SHA-384
*/
//#define MBEDTLS_SHA512_NO_SHA384
/** /**
* \def MBEDTLS_THREADING_ALT * \def MBEDTLS_THREADING_ALT
* *

View File

@ -414,6 +414,9 @@ static const char * const features[] = {
#if defined(MBEDTLS_SHA512_SMALLER) #if defined(MBEDTLS_SHA512_SMALLER)
"MBEDTLS_SHA512_SMALLER", "MBEDTLS_SHA512_SMALLER",
#endif /* MBEDTLS_SHA512_SMALLER */ #endif /* MBEDTLS_SHA512_SMALLER */
#if defined(MBEDTLS_SHA512_NO_SHA384)
"MBEDTLS_SHA512_NO_SHA384",
#endif /* MBEDTLS_SHA512_NO_SHA384 */
#if defined(MBEDTLS_THREADING_ALT) #if defined(MBEDTLS_THREADING_ALT)
"MBEDTLS_THREADING_ALT", "MBEDTLS_THREADING_ALT",
#endif /* MBEDTLS_THREADING_ALT */ #endif /* MBEDTLS_THREADING_ALT */

View File

@ -1132,6 +1132,14 @@ int query_config( const char *config )
} }
#endif /* MBEDTLS_SHA512_SMALLER */ #endif /* MBEDTLS_SHA512_SMALLER */
#if defined(MBEDTLS_SHA512_NO_SHA384)
if( strcmp( "MBEDTLS_SHA512_NO_SHA384", config ) == 0 )
{
MACRO_EXPANSION_TO_STR( MBEDTLS_SHA512_NO_SHA384 );
return( 0 );
}
#endif /* MBEDTLS_SHA512_NO_SHA384 */
#if defined(MBEDTLS_THREADING_ALT) #if defined(MBEDTLS_THREADING_ALT)
if( strcmp( "MBEDTLS_THREADING_ALT", config ) == 0 ) if( strcmp( "MBEDTLS_THREADING_ALT", config ) == 0 )
{ {

View File

@ -183,6 +183,7 @@ def include_in_full(name):
'MBEDTLS_PSA_CRYPTO_SPM', 'MBEDTLS_PSA_CRYPTO_SPM',
'MBEDTLS_PSA_INJECT_ENTROPY', 'MBEDTLS_PSA_INJECT_ENTROPY',
'MBEDTLS_RSA_NO_CRT', 'MBEDTLS_RSA_NO_CRT',
'MBEDTLS_SHA512_NO_SHA384',
'MBEDTLS_TEST_NULL_ENTROPY', 'MBEDTLS_TEST_NULL_ENTROPY',
]: ]:
return False return False