nRF5 SDK is not maintained anymore
More Info: Consider nRF Connect SDK for new designs

Replace Oberon backend with uECC backend in LESC device app

In my project I use nRF52832 embedded in MuRata module. I have a BLE service with capabilities very similar to NUS service.

I've managed to add support for LESC + SEC_MITM to my BLE service while using the Oberon backend. I've also managed to build a working Secure Bootloader with OTA DFU using uECC library.

The projects are built with SEGGER Embedded Studio and nRF5 SDK.

The projects are built with nRF5 SDK 16.0.0

But I am struggling to replace the Oberon backend with the uECC backend.

While using the uECC backend I get the following errors while pairing:

<info> app: BLE UART started.
<info> app: Debug logging for UART over RTT started.
<info> app:
<*> Connected

<info> app: conn_sup_timeout = 72
<info> app: min_conn_interval = 24
<info> app: max_conn_interval = 24
<info> app: slave_latency = 0
<info> app: Data len is set to 0xF4(244)
<warning> nrf_ble_lesc: Creating invalid shared secret to make LESC fail.
<info> nrf_ble_lesc: Calling sd_ble_gap_lesc_dhkey_reply on conn_handle: 0
<info> peer_manager_handler: Connection security failed: role: Peripheral, conn_handle: 0x0, procedure: Bonding, error: 136

Please help.

Parents
  • Hello,

    Please make sure you are building your project with these uECC_* flags like in the ecdh crypto example (/examples/crypto/nrf_crypto/ecdh)
    :

    The last symbol highlighted in read is the most important one. Without it, the nrf crypto library will assume the uECC backend is big endian like the others and cause computation of the shared secret to fail.

    Best regards,

    Vidar

  • Hello Vidar,

    Please see the flags I use to build the uECC library:

    uECC_ENABLE_VLI_API=0

    uECC_OPTIMIZATION_LEVEL=3

    uECC_SQUARE_FUNC=0

    uECC_SUPPORT_COMPRESSED_POINT=0

    uECC_VLI_NATIVE_LITTLE_ENDIAN=1

    I see no issue here, it is probably something else.

    Best Regards,

    Ron.

  • Hello Ron,

    Ron. said:
    I see no issue here, it is probably something else.

    Probably. But I'm not really sure what it could be considering uECC is just another backend for nRF crypto (i.e. should only be a matter of changing some config. settings)

    Please try to run the project below and see if you get the same result. It's a modified version of the ble_app_hrs example from SDK 16 that I made to test out LESC pairing with uECC instead of Oberon. It did not get any pairing failures when I tested it at least.

    Best regards,

    Vidar

Reply
  • Hello Ron,

    Ron. said:
    I see no issue here, it is probably something else.

    Probably. But I'm not really sure what it could be considering uECC is just another backend for nRF crypto (i.e. should only be a matter of changing some config. settings)

    Please try to run the project below and see if you get the same result. It's a modified version of the ble_app_hrs example from SDK 16 that I made to test out LESC pairing with uECC instead of Oberon. It did not get any pairing failures when I tested it at least.

    Best regards,

    Vidar

Children
No Data
Related