NimBLE-Arduino 2.1.2
Loading...
Searching...
No Matches
ble_aes_ccm.h
1/*
2 * SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
3 *
4 * SPDX-License-Identifier: Unlicense OR CC0-1.0
5 */
6
7#ifndef _BLE_AES_CCM_
8#define _BLE_AES_CCM_
9
10#include "nimble/porting/nimble/include/syscfg/syscfg.h"
11#include "nimble/porting/nimble/include/os/queue.h"
12#include "ble_hs.h"
13
14#if MYNEWT_VAL(BLE_CRYPTO_STACK_MBEDTLS)
15#include "mbedtls/aes.h"
16#else
18#endif
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24#if MYNEWT_VAL(ENC_ADV_DATA)
25
26const char *ble_aes_ccm_hex(const void *buf, size_t len);
27int ble_aes_ccm_encrypt_be(const uint8_t *key, const uint8_t *plaintext, uint8_t *enc_data);
28int ble_aes_ccm_decrypt(const uint8_t key[16], uint8_t nonce[13], const uint8_t *enc_data,
29 size_t len, const uint8_t *aad, size_t aad_len,
30 uint8_t *plaintext, size_t mic_size);
31int ble_aes_ccm_encrypt(const uint8_t key[16], uint8_t nonce[13], const uint8_t *enc_data,
32 size_t len, const uint8_t *aad, size_t aad_len,
33 uint8_t *plaintext, size_t mic_size);
34
35#endif /* ENC_ADV_DATA */
36
37#ifdef __cplusplus
38}
39#endif
40
41#endif /* _BLE_AES_CCM_ */
– Interface to an AES-128 implementation.