I'm studying the BT core spec v5.1 to understand the security features and how everything fits together. I am looking at Secure Connections for now.

p. 1768

In the field "Key generation" it says it uses P-256 ECDH and HMAC-SHA-256 for this. However, when we read a little bit closer about the different functions themselves, it says that it uses AES-CMAC for key generation.


What's going on here?

  • $\begingroup$ Interesting. It could be that a master key is generated using HMAC-SHA-256 and that the subsequent keys are generated by CMAC, but that's just guesswork. $\endgroup$
    – Maarten Bodewes
    Jun 27, 2019 at 16:28

2 Answers 2


The Diffie-Hellman key exchange is performed in the device pairing phase with P-256 elliptic curve to generate a shared secret DHKey. The function $\texttt{f}_5$ is then used to derive the long-term keys LTK and MacKey from DHKey according to this equation:

MacKey || LTK = $\texttt{f}_5$ (DHKey, N_master, N_slave, BD_ADDR_master, BD_ADDR_slave)

where N_master is the random number sent by the master to the slave, N_slave is the random number sent by the slave to the master, BD_ADDR_master is the device address of the master and BD_ADDR_slave is the device address of the slave.

This is very similar to TLS, where a master secret is generated using Diffie-Hellman key exchange and then the individual encryption keys are derived from the master secret using symmetric primitives.


You are looking at different things. The table is Classic Bluetooth (BR/EDR) security, whereas the paragraph is LE security.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.