Module for handling LESC DHKey requests.
More...
Module for handling LESC DHKey requests.
ret_code_t ble_lesc_ecc_keypair_generate_and_set |
( |
void |
| ) |
|
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.
- Note
- Run ble_lesc_ecc_keypair_generate_and_set before calling this function.
- Return values
-
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 |
Function to initialize the ble_lesc module.
This function initializes the nrf_crypto for key generation and ECDH calculations.
- Return values
-
NRF_SUCCESS | Initalization was successful. |
- Returns
- Any error code reported by nrf_crypto_init.
-
Any error code reported by nrf_crypto_rng_init.
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.
- Note
- This function should be run in a low interrupt priority like an idle-loop in the main application context.
- Warning
- Any error code reported by this function that is not NRF_SUCCESS is critical and should be handled by aborting all ongoing BLE operations and resetting the device. Failure to do is a security risk.
- Return values
-
NRF_SUCCESS | Service operation was successful. |
- Returns
- Any other error code than NRF_SUCCESS which indicates that the device is in a critical state and must be restarted.