[crypto] add feature flag around kEntropyMinThreshold (#7381)

To avoid "unused variable" compiler warning.
This commit is contained in:
Jonathan Hui
2022-01-31 14:33:04 -08:00
committed by GitHub
parent 216b40e4bf
commit dbcd04ef86
+4 -2
View File
@@ -67,7 +67,9 @@ using namespace Crypto;
#if !OPENTHREAD_RADIO
static mbedtls_ctr_drbg_context sCtrDrbgContext;
static mbedtls_entropy_context sEntropyContext;
static constexpr uint16_t kEntropyMinThreshold = 16;
#ifndef OT_MBEDTLS_STRONG_DEFAULT_ENTROPY_PRESENT
static constexpr uint16_t kEntropyMinThreshold = 16;
#endif
#endif
OT_TOOL_WEAK void otPlatCryptoInit(void)
@@ -461,7 +463,7 @@ OT_TOOL_WEAK void otPlatCryptoRandomInit(void)
#ifndef OT_MBEDTLS_STRONG_DEFAULT_ENTROPY_PRESENT
mbedtls_entropy_add_source(&sEntropyContext, handleMbedtlsEntropyPoll, nullptr, kEntropyMinThreshold,
MBEDTLS_ENTROPY_SOURCE_STRONG);
#endif // OT_MBEDTLS_STRONG_DEFAULT_ENTROPY_PRESENT
#endif
mbedtls_ctr_drbg_init(&sCtrDrbgContext);