Module for handling LESC DHKey requests. More...
Modules | |
Handles LESC pairing and key management configuration | |
Functions | |
ret_code_t | ble_lesc_init (void) |
Function to initialize the ble_lesc module. More... | |
ret_code_t | ble_lesc_ecc_keypair_generate_and_set (void) |
Function to generate a ECC key pair to use in LESC. More... | |
ret_code_t | ble_lesc_ecc_local_public_key_get (ble_gap_lesc_p256_pk_t const **pp_lesc_public_key) |
Function to get the current LESC ECC local public key. More... | |
ret_code_t | ble_lesc_service_request_handler (void) |
Function to service LESC ECDH calculations. More... | |
Module for handling LESC DHKey requests.
ret_code_t ble_lesc_ecc_keypair_generate_and_set | ( | void | ) |
Function to generate a ECC key pair to use in LESC.
This function initializes the crypto system by calling nrf_crypto_init and nrf_crypto_rng_init before calling the required functions to generate the ECC key pair. If the key generation was successful this function sets the LESC local public key in peer manager by calling pm_lesc_public_key_set.
NRF_SUCCESS | Generating ECC key pair was successful. |
ret_code_t ble_lesc_ecc_local_public_key_get | ( | ble_gap_lesc_p256_pk_t const ** | pp_lesc_public_key | ) |
Function to get the current LESC ECC local public key.
This function gets the current ECC local public key used LESC pairing procedure the format of this key is in a type usable by peer manager, NFC (OOB) and SoftDevice.
NRF_SUCCESS | Getting the local public key was successful. |
NRF_ERROR_NULL | pp_lesc_public_key was NULL. |
NRF_ERROR_INVALID_STATE | No ECC keypair was generated prior to this call |
ret_code_t ble_lesc_init | ( | void | ) |
Function to initialize the ble_lesc module.
This function initializes the nrf_crypto for key generation and ECDH calculations.
NRF_SUCCESS | Initalization was successful. |
ret_code_t ble_lesc_service_request_handler | ( | void | ) |
Function to service LESC ECDH calculations.
This function will calculate a LESC ECDH key (also known as shared secret) as long as BLE_GAP_EVT_LESC_DHKEY_REQUEST event has been received from SoftDevice.
NRF_SUCCESS | Service operation was successful. |