Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
ead.h
Go to the documentation of this file.
1/* Copyright (c) 2023 Nordic Semiconductor ASA
2 * SPDX-License-Identifier: Apache-2.0
3 */
4
5#include <stddef.h>
6#include <stdint.h>
7
8#ifndef ZEPHYR_INCLUDE_BLUETOOTH_EAD_H_
9#define ZEPHYR_INCLUDE_BLUETOOTH_EAD_H_
10
11#include <zephyr/kernel.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
26#define BT_EAD_RANDOMIZER_SIZE 5
28#define BT_EAD_KEY_SIZE 16
30#define BT_EAD_IV_SIZE 8
32#define BT_EAD_MIC_SIZE 4
33
37#define BT_EAD_ENCRYPTED_PAYLOAD_SIZE(payload_size) \
38 ((payload_size) + BT_EAD_RANDOMIZER_SIZE + BT_EAD_MIC_SIZE)
39
43#define BT_EAD_DECRYPTED_PAYLOAD_SIZE(encrypted_payload_size) \
44 ((encrypted_payload_size) - (BT_EAD_RANDOMIZER_SIZE + BT_EAD_MIC_SIZE))
45
78 const uint8_t *payload, size_t payload_size, uint8_t *encrypted_payload);
79
104 const uint8_t *encrypted_payload, size_t encrypted_payload_size,
105 uint8_t *payload);
106
111#ifdef __cplusplus
112}
113#endif
114
115#endif /* ZEPHYR_INCLUDE_BLUETOOTH_EAD_H_ */
Bluetooth subsystem core APIs.
#define BT_EAD_IV_SIZE
Initialisation Vector size in bytes.
Definition: ead.h:30
int bt_ead_encrypt(const uint8_t session_key[16], const uint8_t iv[8], const uint8_t *payload, size_t payload_size, uint8_t *encrypted_payload)
Encrypt and authenticate the given advertising data.
#define BT_EAD_KEY_SIZE
Key size in bytes.
Definition: ead.h:28
int bt_ead_decrypt(const uint8_t session_key[16], const uint8_t iv[8], const uint8_t *encrypted_payload, size_t encrypted_payload_size, uint8_t *payload)
Decrypt and authenticate the given encrypted advertising data.
Public kernel APIs.
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88