ble/crypto.h header reference
[Bluetooth Low Energy library module]
The source code of this header can be browsed online.
Description [link]
Those functions are from "Cryptographic toolbox" chapter of Bluetooth Core Specification. See Core_v4.2, Vol. 3, Part. H.
Members [link]
Types [link]
- struct ble_dh_key
- struct ble_dh_private_key
- struct ble_dh_public_key
Functions [link]
- error_t ble_aes_cmac(const struct device_crypto_s *dev, const uint8_t *k, const uint8_t *data, size_t size, uint8_t *out)
- error_t ble_ah(const struct device_crypto_s *dev, const uint8_t *k, const uint8_t *r, uint8_t *out)
- error_t ble_c1(const struct device_crypto_s *dev, const uint8_t *k, const uint8_t *r, const uint8_t *preq, const uint8_t *pres, const struct ble_addr_s *ia, const struct ble_addr_s *ra, uint8_t *out)
- error_t ble_ccm_decrypt(struct device_crypto_s *dev, const uint8_t *k, const uint8_t *iv, uint32_t packet_count, uint8_t way, const struct buffer_s *ciphered, struct buffer_s *clear)
- error_t ble_ccm_encrypt(struct device_crypto_s *dev, const uint8_t *k, const uint8_t *iv, uint32_t packet_count, uint8_t way, const struct buffer_s *clear, struct buffer_s *ciphered)
- error_t ble_d1(const uint8_t *k, uint16_t d, uint16_t r, uint8_t *out)
- error_t ble_e(const struct device_crypto_s *dev, const uint8_t *key, const uint8_t *in, uint8_t *out)
- error_t ble_f4(const struct device_crypto_s *dev, const uint8_t *u, const uint8_t *v, const uint8_t *x, uint8_t z, uint8_t *out)
- error_t ble_f5(const struct device_crypto_s *dev, const uint8_t *w, const uint8_t *n1, const uint8_t *n2, const struct ble_addr_s *a1, const struct ble_addr_s *a2, uint8_t *out)
- error_t ble_f6(const struct device_crypto_s *dev, const uint8_t *w, const uint8_t *n1, const uint8_t *n2, const uint8_t *r, uint32_t io_cap, const struct ble_addr_s *a1, const struct ble_addr_s *a2, uint8_t *out)
- error_t ble_g2(const struct device_crypto_s *dev, const uint8_t *u, const uint8_t *v, const uint8_t *x, const uint8_t *y, uint32_t *out)
- error_t ble_s1(const struct device_crypto_s *dev, const uint8_t *k, const uint8_t *r1, const uint8_t *r2, uint8_t *out)
- error_t ble_sk_derive(const uint8_t *lstk, const uint8_t *skd, uint8_t *sk)
Constant [link]
- const struct ble_dh_key ble_dh_debug_key
Members detail [link]
#define BLE_CRYPTO_H_ [link]
This macro is declared in ble/crypto.h source file, line 21.
error_t ble_aes_cmac(const struct device_crypto_s *dev, const uint8_t *k, const uint8_t *data, size_t size, uint8_t *out) [link]
This function is declared in ble/crypto.h source file, line 155.
Cryptographic toolbox AES-CMAC function (2.2.5)
Key and out are in bluetooth (little-endian) order.
data and size point a byte-stream.
error_t ble_ah(const struct device_crypto_s *dev, const uint8_t *k, const uint8_t *r, uint8_t *out) [link]
This function is declared in ble/crypto.h source file, line 116.
Cryptographic toolbox ah function (2.2.2)
k is in Bluetooth order. r and out both are 3-byte long.
This function is usually used for random address resolution with IRK.
error_t ble_c1(const struct device_crypto_s *dev, const uint8_t *k, const uint8_t *r, const uint8_t *preq, const uint8_t *pres, const struct ble_addr_s *ia, const struct ble_addr_s *ra, uint8_t *out) [link]
This function is declared in ble/crypto.h source file, line 130.
Cryptographic toolbox c1 function (2.2.3)
This function is usually used for (legacy) pairing confirmation.
error_t ble_ccm_decrypt(struct device_crypto_s *dev, const uint8_t *k, const uint8_t *iv, uint32_t packet_count, uint8_t way, const struct buffer_s *ciphered, struct buffer_s *clear) [link]
This function is declared in ble/crypto.h source file, line 102.
this function is a BLE-customized AES-CCM decrypt. Expected clear and ciphered buffers contain link-layer header.
iv is in Bluetooth network order.
error_t ble_ccm_encrypt(struct device_crypto_s *dev, const uint8_t *k, const uint8_t *iv, uint32_t packet_count, uint8_t way, const struct buffer_s *clear, struct buffer_s *ciphered) [link]
This function is declared in ble/crypto.h source file, line 88.
this function is a BLE-customized AES-CCM encrypt. Expected clear and ciphered buffers contain link-layer header.
iv is in Bluetooth network order.
This function is declared in ble/crypto.h source file, line 209.
Key management diversifying function d1 function (Appendix B, B.2.1)
This function is usually used for session key generation from LTK.
const struct ble_dh_key ble_dh_debug_key [link]
This constant is declared in ble/crypto.h source file, line 220.
this constant is Specification-defined debug key for secure pairing testing.
struct ble_dh_key [link]
This struct is declared in ble/crypto.h source file, line 56.
this struct defines a key pair object
Field | Description |
---|---|
struct ble_dh_public_key pub; | |
struct ble_dh_private_key priv; |
struct ble_dh_private_key [link]
This struct is declared in ble/crypto.h source file, line 49.
this struct defines a private key object
struct ble_dh_public_key [link]
This struct is declared in ble/crypto.h source file, line 41.
this struct defines a public key object
error_t ble_e(const struct device_crypto_s *dev, const uint8_t *key, const uint8_t *in, uint8_t *out) [link]
This function is declared in ble/crypto.h source file, line 74.
Cryptographic toolbox e function (2.2.1) Actually, a AES encrypt.
Key, in and out are in usual ECB order (what Bluetooth spec explains as big-endian).
error_t ble_f4(const struct device_crypto_s *dev, const uint8_t *u, const uint8_t *v, const uint8_t *x, uint8_t z, uint8_t *out) [link]
This function is declared in ble/crypto.h source file, line 167.
Cryptographic toolbox f4 function (2.2.6)
This function is usually used for (secure) pairing confirmation.
error_t ble_f5(const struct device_crypto_s *dev, const uint8_t *w, const uint8_t *n1, const uint8_t *n2, const struct ble_addr_s *a1, const struct ble_addr_s *a2, uint8_t *out) [link]
This function is declared in ble/crypto.h source file, line 179.
Cryptographic toolbox f5 function (2.2.7)
This function is usually used for key generation.
error_t ble_f6(const struct device_crypto_s *dev, const uint8_t *w, const uint8_t *n1, const uint8_t *n2, const uint8_t *r, uint32_t io_cap, const struct ble_addr_s *a1, const struct ble_addr_s *a2, uint8_t *out) [link]
This function is declared in ble/crypto.h source file, line 192.
Cryptographic toolbox f6 function (2.2.8)
This function is usually used for (secure) connection check.
error_t ble_g2(const struct device_crypto_s *dev, const uint8_t *u, const uint8_t *v, const uint8_t *x, const uint8_t *y, uint32_t *out) [link]
This function is declared in ble/crypto.h source file, line 202.
Cryptographic toolbox g2 function (2.2.9)
This function is usually used for (secure) passkey check.
error_t ble_s1(const struct device_crypto_s *dev, const uint8_t *k, const uint8_t *r1, const uint8_t *r2, uint8_t *out) [link]
This function is declared in ble/crypto.h source file, line 142.
Cryptographic toolbox s1 function (2.2.4)
Key, r1, r2 and out are in Bluetooth (little-endian) order.
This function is declared in ble/crypto.h source file, line 214.
this function derives a session key from a LTK/STK and SKD.