diff --git a/nimble/host/mesh/include/mesh/main.h b/nimble/host/mesh/include/mesh/main.h index 213950b17..dff5eb1db 100644 --- a/nimble/host/mesh/include/mesh/main.h +++ b/nimble/host/mesh/include/mesh/main.h @@ -287,7 +287,7 @@ int bt_mesh_input_number(uint32_t num); /** @brief Provide Device public key. * - * @param public_key Device public key. + * @param public_key Device public key in big-endian. * * @return Zero on success or (negative) error code otherwise. */ diff --git a/nimble/host/mesh/src/provisioner.c b/nimble/host/mesh/src/provisioner.c index 9e8df8937..7a8c40d8f 100644 --- a/nimble/host/mesh/src/provisioner.c +++ b/nimble/host/mesh/src/provisioner.c @@ -724,8 +724,7 @@ int bt_mesh_prov_remote_pub_key_set(const uint8_t public_key[64]) } /* Swap X and Y halves independently to big-endian */ - memcpy(&bt_mesh_prov_link.conf_inputs[81], public_key, 32); - memcpy(&bt_mesh_prov_link.conf_inputs[81 + 32], &public_key[32], 32); + memcpy(&bt_mesh_prov_link.conf_inputs[81], public_key, 64); return 0; }