This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

[nrf5_SDK_for_Mesh_v2.0.0_src]How to calculate the device key

Hi,

nrf5_SDK_for_Mesh_v2.0.0_src

When complete provision a provisionee , provisioner will assign provisionee a mesh key and device key.

Now i want to know how to calculate the device key , any API can I use ?

Best Regards!

  • hello,

    From the SIG Mesh specification...

    And within the nRF5 Mesh Stack... look into the light_switch_provisioner example (prov_utils.c) for the prov_utils_derive_keys function:

        /* DeviceKey = k1(ECDHSecret, ProvisioningSalt, "prdk") */
        enc_k1(p_ctx->shared_secret, NRF_MESH_ECDH_SHARED_SECRET_SIZE,
               provisioning_salt,
               DEVICE_KEY_INFO, DEVICE_KEY_INFO_SIZE,
               p_device_key);

    Regards,

Related