From 551bdb7e235f7ac27f9083db344cb47a3dde6a53 Mon Sep 17 00:00:00 2001 From: Shen Weilong Date: Tue, 4 Mar 2025 15:04:52 +0800 Subject: [PATCH] Replace "&curve_secp256r1" with "uECC_secp256r1()" for uECC operation --- nimble/host/src/ble_sm_alg.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nimble/host/src/ble_sm_alg.c b/nimble/host/src/ble_sm_alg.c index e0dc71c5d..87fd89d48 100644 --- a/nimble/host/src/ble_sm_alg.c +++ b/nimble/host/src/ble_sm_alg.c @@ -598,11 +598,11 @@ exit: } #else - if (uECC_valid_public_key(pk, &curve_secp256r1) < 0) { + if (uECC_valid_public_key(pk, uECC_secp256r1()) < 0) { return BLE_HS_EUNKNOWN; } - rc = uECC_shared_secret(pk, priv, dh, &curve_secp256r1); + rc = uECC_shared_secret(pk, priv, dh, uECC_secp256r1()); if (rc == TC_CRYPTO_FAIL) { return BLE_HS_EUNKNOWN; } @@ -711,7 +711,7 @@ ble_sm_alg_gen_key_pair(uint8_t *pub, uint8_t *priv) return BLE_HS_EUNKNOWN; } #else - if (uECC_make_key(pk, priv, &curve_secp256r1) != TC_CRYPTO_SUCCESS) { + if (uECC_make_key(pk, priv, uECC_secp256r1()) != TC_CRYPTO_SUCCESS) { return BLE_HS_EUNKNOWN; } #endif