diff --git a/src/shared/crypto.c b/src/shared/crypto.c
index aa66dac..6de5514 100644
--- a/src/shared/crypto.c
+++ b/src/shared/crypto.c
return bt_crypto_e(crypto, k, res, res);
}
-static bool aes_cmac(struct bt_crypto *crypto, uint8_t key[16], uint8_t *msg,
- size_t msg_len, uint8_t res[16])
+static bool aes_cmac(struct bt_crypto *crypto, const uint8_t key[16],
+ const uint8_t *msg, size_t msg_len, uint8_t res[16])
{
uint8_t key_msb[16], out[16], msg_msb[CMAC_MSG_MAX];
ssize_t len;
return true;
}
+
+bool bt_crypto_h6(struct bt_crypto *crypto, const uint8_t w[16],
+ const uint8_t keyid[4], uint8_t res[16])
+{
+ if (!aes_cmac(crypto, w, keyid, 4, res))
+ return false;
+
+ return true;
+}
diff --git a/src/shared/crypto.h b/src/shared/crypto.h
index 9ba5803..84d4992 100644
--- a/src/shared/crypto.h
+++ b/src/shared/crypto.h
uint8_t a1[7], uint8_t a2[7], uint8_t res[16]);
bool bt_crypto_g2(struct bt_crypto *crypto, uint8_t u[32], uint8_t v[32],
uint8_t x[16], uint8_t y[16], uint32_t *val);
+bool bt_crypto_h6(struct bt_crypto *crypto, const uint8_t w[16],
+ const uint8_t keyid[4], uint8_t res[16]);
bool bt_crypto_sign_att(struct bt_crypto *crypto, const uint8_t key[16],
const uint8_t *m, uint16_t m_len,
uint32_t sign_cnt, uint8_t signature[12]);