Module for handling LESC related events. More...
Modules | |
Le Secure Connection configuration | |
Functions | |
ret_code_t | nrf_ble_lesc_init (void) |
Function for initializing the LESC module. More... | |
ret_code_t | nrf_ble_lesc_keypair_generate (void) |
Function for generating ECC keypair used for the LESC procedure. More... | |
ble_gap_lesc_p256_pk_t * | nrf_ble_lesc_public_key_get (void) |
Function for accessing the ECC public key used for LESC DH key generation. More... | |
ret_code_t | nrf_ble_lesc_request_handler (void) |
Function for responding to a DH key requests. More... | |
void | nrf_ble_lesc_on_ble_evt (ble_evt_t const *p_ble_evt) |
Function for handling BLE stack events. More... | |
Module for handling LESC related events.
ret_code_t nrf_ble_lesc_init | ( | void | ) |
Function for initializing the LESC module.
This function initializes the nrf_crypto for ECC and ECDH calculations, which are required to handle LESC authentication procedures.
NRF_SUCCESS | If the operation was successful. |
Other | Other error codes might be returned by the nrf_crypto_init or nrf_ble_lesc_keypair_generate functions. |
ret_code_t nrf_ble_lesc_keypair_generate | ( | void | ) |
Function for generating ECC keypair used for the LESC procedure.
This function generates an ECC key pair, which consists of a private and public key. Keys are generated using ECC and are used to create LESC DH key during authentication procedures.
NRF_SUCCESS | If the operation was successful. |
NRF_ERROR_BUSY | If any pending request needs to be processed by nrf_ble_lesc_request_handler. |
Other | Other error codes might be returned by the nrf_crypto_ecc_key_pair_generate, nrf_crypto_ecc_public_key_to_raw and nrf_crypto_ecc_byte_order_invert functions. |
void nrf_ble_lesc_on_ble_evt | ( | ble_evt_t const * | p_ble_evt | ) |
Function for handling BLE stack events.
This function handles events from the BLE stack that are of interest to the module.
[in] | p_ble_evt | Event received from the BLE stack. |
ble_gap_lesc_p256_pk_t* nrf_ble_lesc_public_key_get | ( | void | ) |
Function for accessing the ECC public key used for LESC DH key generation.
This function can be used to access the ECC public key, which is required to generate a LESC DH key at the peer side.
ret_code_t nrf_ble_lesc_request_handler | ( | void | ) |
Function for responding to a DH key requests.
This function calculates DH keys and supplies them to the SoftDevice if there are any pending requests for keys.
NRF_SUCCESS | If the operation was successful. |
NRF_ERROR_INTERNAL | If the LESC module encountered an internal error. The only way to recover from this type of error is to reset the application. |
Other | Other error codes might be returned by the nrf_crypto_ecdh_compute, nrf_crypto_ecc_byte_order_invert, and sd_ble_gap_lesc_dhkey_reply functions. |