@@ -223,7 +223,11 @@ static bool acp_credentials(struct mesh_prov_acceptor *prov)
print_packet("PublicKeyProv", prov->conf_inputs.prv_pub_key, 64);
print_packet("PublicKeyDev", prov->conf_inputs.dev_pub_key, 64);
+
+ /* Normalize for debug out -- No longer needed for calculations */
+ swap_u256_bytes(prov->private_key);
print_packet("PrivateKeyLocal", prov->private_key, 32);
+
print_packet("ConfirmationInputs", &prov->conf_inputs,
sizeof(prov->conf_inputs));
print_packet("ECDHSecret", prov->secret, 32);
@@ -307,11 +311,13 @@ static void priv_key_cb(void *user_data, int err, uint8_t *key, uint32_t len)
return;
}
+ /* API delivers Mesh byte order, switch to little endian */
+ swap_u256_bytes(key);
memcpy(prov->private_key, key, 32);
ecc_make_public_key(prov->private_key,
prov->conf_inputs.dev_pub_key);
- /* Convert to Mesh byte order */
+ /* Convert Public key to Mesh byte order */
swap_u256_bytes(prov->conf_inputs.dev_pub_key);
swap_u256_bytes(prov->conf_inputs.dev_pub_key + 32);
@@ -222,6 +222,9 @@ static bool int_credentials(struct mesh_prov_initiator *prov)
print_packet("PublicKeyProv", prov->conf_inputs.prv_pub_key, 64);
print_packet("PublicKeyDev", prov->conf_inputs.dev_pub_key, 64);
+
+ /* Print DBG out in Mesh order */
+ swap_u256_bytes(prov->private_key);
print_packet("PrivateKeyLocal", prov->private_key, 32);
print_packet("ConfirmationInputs", &prov->conf_inputs,
sizeof(prov->conf_inputs));