Zephyr Project API  3.4.0
A Scalable Open Source RTOS
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#include <zephyr/kernel.h>
10
12#define BT_EAD_RANDOMIZER_SIZE 5
14#define BT_EAD_KEY_SIZE 16
16#define BT_EAD_IV_SIZE 8
18#define BT_EAD_MIC_SIZE 4
19
23#define BT_EAD_ENCRYPTED_PAYLOAD_SIZE(payload_size) \
24 ((payload_size) + BT_EAD_RANDOMIZER_SIZE + BT_EAD_MIC_SIZE)
25
29#define BT_EAD_DECRYPTED_PAYLOAD_SIZE(encrypted_payload_size) \
30 ((encrypted_payload_size) - (BT_EAD_RANDOMIZER_SIZE + BT_EAD_MIC_SIZE))
31
64 const uint8_t *payload, size_t payload_size, uint8_t *encrypted_payload);
65
90 const uint8_t *encrypted_payload, size_t encrypted_payload_size,
91 uint8_t *payload);
Bluetooth subsystem core APIs.
#define BT_EAD_IV_SIZE
Definition: ead.h:16
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
Definition: ead.h:14
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