thanks for the answer. We are working with a Nordic chip and need to implement the Bluetooth Low Energy Security Encryped connection and we are working on a microcontroller.
With the wolfSSL we are generating the private and public key of our side:
result = wc_InitRng(&rng);
result = wc_ecc_init(&priv);
result = wc_ecc_set_curve(&priv, 32, ECC_SECP256R1);
result = wc_ecc_make_key(&rng, 32, &priv); // make public/private key pair
now we receive a "BLE_GAP_EVT_LESC_DHKEY_REQUEST" from the nordic softdevice from the peer, in this event-case we need to calculate the agreed secret and send this secret back.
The format of the received data is a x,y (32bit value each) of the ECC keys. But as far as I understand the
needs a p and q value.
Is the 'wc_ecc_shared_secret_gen' not the solution better function? But then what to use for the z-value? 1?
I think this little last calculation is missing and when we have this, the Bluetooth connection is encrypted, so I do not think that the other approach makes more sense. Or probably you can short describe which steps are necessary to reach the goal there.
Thank you again for the support and kind Regards