diff --git a/components/bt/controller/esp32c2/bt.c b/components/bt/controller/esp32c2/bt.c index 1daade25f86..2b71956a661 100644 --- a/components/bt/controller/esp32c2/bt.c +++ b/components/bt/controller/esp32c2/bt.c @@ -1459,12 +1459,13 @@ static const char *TAG_SM_ALG = "ble_sm_alg"; #include "tinycrypt/ecc_dh.h" +#if CONFIG_BT_CONTROLLER_ONLY /* Used by uECC to get random data */ static int ecc_rand_func(uint8_t *dst, unsigned int len) { int offset_cnt = 0; uint8_t *u8ptr = dst; - uint64_t random_64 = 0; + uint64_t random64 = 0; while(len > 0) { random64 = (uint64_t)esp_random(); @@ -1478,6 +1479,7 @@ static int ecc_rand_func(uint8_t *dst, unsigned int len) return 1; } +#endif // CONFIG_BT_CONTROLLER_ONLY #endif // CONFIG_BT_LE_SM_SC #endif // CONFIG_BT_LE_CRYPTO_STACK_MBEDTLS diff --git a/components/bt/controller/esp32c6/bt.c b/components/bt/controller/esp32c6/bt.c index 5eb26edc600..01f27451b65 100644 --- a/components/bt/controller/esp32c6/bt.c +++ b/components/bt/controller/esp32c6/bt.c @@ -1669,12 +1669,13 @@ static const char *TAG_SM_ALG = "ble_sm_alg"; #include "tinycrypt/cmac_mode.h" #include "tinycrypt/ecc_dh.h" +#if CONFIG_BT_CONTROLLER_ONLY /* Used by uECC to get random data */ static int ecc_rand_func(uint8_t *dst, unsigned int len) { int offset_cnt = 0; uint8_t *u8ptr = dst; - uint64_t random_64 = 0; + uint64_t random64 = 0; while(len > 0) { random64 = (uint64_t)esp_random(); @@ -1687,6 +1688,7 @@ static int ecc_rand_func(uint8_t *dst, unsigned int len) return 1; } +#endif // CONFIG_BT_CONTROLLER_ONLY #endif // CONFIG_BT_LE_SM_SC #endif // CONFIG_BT_LE_CRYPTO_STACK_MBEDTLS diff --git a/components/bt/controller/esp32h2/bt.c b/components/bt/controller/esp32h2/bt.c index 3b7c5be0113..44d1ed41236 100644 --- a/components/bt/controller/esp32h2/bt.c +++ b/components/bt/controller/esp32h2/bt.c @@ -1619,12 +1619,13 @@ void esp_ble_controller_log_dump_all(bool output) #include "tinycrypt/cmac_mode.h" #include "tinycrypt/ecc_dh.h" +#if CONFIG_BT_CONTROLLER_ONLY /* Used by uECC to get random data */ static int ecc_rand_func(uint8_t *dst, unsigned int len) { int offset_cnt = 0; uint8_t *u8ptr = dst; - uint64_t random_64 = 0; + uint64_t random64 = 0; while(len > 0) { random64 = (uint64_t)esp_random(); @@ -1637,6 +1638,7 @@ static int ecc_rand_func(uint8_t *dst, unsigned int len) return 1; } +#endif // CONFIG_BT_CONTROLLER_ONLY #endif // CONFIG_BT_LE_SM_SC #endif // CONFIG_BT_LE_CRYPTO_STACK_MBEDTLS