Thread (267 messages) flat view 267 messages, 5 authors, 2012-09-27

Re: [RFCv2 14/20] Bluetooth: AMP: Add AMP key calculation

From: Andrei Emeltchenko <hidden>
Date: 2012-07-25 09:12:24

Hi Gustavo,

On Tue, Jul 24, 2012 at 06:29:44PM -0300, Gustavo Padovan wrote:
quoted
+
+	hexdump(keybuf, HCI_AMP_LINK_KEY_SIZE);
Is these hex prints worthwhile? Seems kind expensive, right?
Yes, I will remove this print.
quoted
+	result = hmac_sha256(keybuf, HCI_AMP_LINK_KEY_SIZE, "gamp", 4,
+			     gamp_key);
+	hexdump(gamp_key, HCI_AMP_LINK_KEY_SIZE);
+
+	if (result)
+		goto done;
+
+	if (conn->key_type == 3) {
+		BT_DBG("gamp_key");
+		hexdump(gamp_key, HCI_AMP_LINK_KEY_SIZE);
+		memcpy(data, gamp_key, HCI_AMP_LINK_KEY_SIZE);
+		goto done;
+	}
+
+	result = hmac_sha256(gamp_key, HCI_AMP_LINK_KEY_SIZE, "802b", 4,
+			     b802_key);
Can't you pass data directly here, instead of b802_key? This could avoid an
extra memcpy.
Yes, will do this way.

Best regards 
Andrei Emeltchenko 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help