openaliro
Aliro reader: UWB/CCC core and ESP32-S3/C5/C6 port
Loading...
Searching...
No Matches
advertising_core.h
1/*
2 * Aliro BLE advertising primitives.
3 *
4 * Kept as portable C so the byte-order rules can be tested on the host using
5 * the specification's published known-answer vectors.
6 */
7#pragma once
8
9#include <stdint.h>
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15enum {
16 WOZ_ALIRO_BLE_ADDRESS_SIZE = 6,
17 WOZ_ALIRO_DYNAMIC_TAG_INPUT_SIZE = 16,
18 WOZ_ALIRO_DYNAMIC_TAG_SIZE = 7,
19};
20
21/* address_le uses Zephyr/bt_addr_t storage order. The generated AES input is
22 * 6 zero pad bytes || AdvA most-significant-byte first || expiry big-endian. */
23void woz_aliro_dynamic_tag_input(const uint8_t address_le[WOZ_ALIRO_BLE_ADDRESS_SIZE],
24 uint32_t expiry_timestamp,
25 uint8_t plaintext[WOZ_ALIRO_DYNAMIC_TAG_INPUT_SIZE]);
26
27/* The dynamic tag is the seven most-significant AES ciphertext octets. */
28void woz_aliro_dynamic_tag_from_ciphertext(
29 const uint8_t ciphertext[WOZ_ALIRO_DYNAMIC_TAG_INPUT_SIZE],
30 uint8_t tag[WOZ_ALIRO_DYNAMIC_TAG_SIZE]);
31
32#ifdef __cplusplus
33}
34#endif