nrfxlib API 0.1.0
Loading...
Searching...
No Matches
nrf_802154_aes_ccm.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021, Nordic Semiconductor ASA
3 * All rights reserved.
4 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright notice, this
11 * list of conditions and the following disclaimer.
12 *
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 *
17 * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
18 * contributors may be used to endorse or promote products derived from this
19 * software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
25 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
32 *
33 */
34
35#ifndef NRF_802154_AES_CCM_H_
36#define NRF_802154_AES_CCM_H_
37
38#include <stdbool.h>
39#include <stdint.h>
40
41#include "nrf_802154_const.h"
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
47#define NRF_802154_AES_CCM_L_VALUE 2 // Annex B3.2 Mode of operation d)
48#define NRF_802154_AES_CCM_NONCE_SIZE (15 - NRF_802154_AES_CCM_L_VALUE) // Annex B4.1 CCM* mode encryption and authentication transformation b)
49
53typedef struct
54{
55 uint8_t key[AES_CCM_KEY_SIZE];
56 uint8_t * auth_data;
57 uint64_t auth_data_len;
58 uint8_t * plain_text_data;
61 uint8_t mic_level;
62 uint8_t * raw_frame;
64
69
79
90void nrf_802154_aes_ccm_transform_start(uint8_t * p_frame);
91
97void nrf_802154_aes_ccm_transform_abort(uint8_t * p_frame);
98
99#endif // NRF_802154_AES_CCM_H_
#define NRF_802154_AES_CCM_NONCE_SIZE
Definition: nrf_802154_aes_ccm.h:48
void nrf_802154_aes_ccm_transform_reset(void)
Resets AES-CCM* transformation.
void nrf_802154_aes_ccm_transform_start(uint8_t *p_frame)
Starts AES-CCM* transformation.
void nrf_802154_aes_ccm_transform_abort(uint8_t *p_frame)
Aborts AES-CCM* transformation.
bool nrf_802154_aes_ccm_transform_prepare(const nrf_802154_aes_ccm_data_t *p_aes_ccm_data)
Prepares AES-CCM* transformation.
#define AES_CCM_KEY_SIZE
Size of AES CCM Key.
Definition: nrf_802154_const.h:169
uint8_t * plain_text_data
Pointer to AES-CCM* plain text data for encryption and authorization.
Definition: nrf_802154_aes_ccm.h:58
uint8_t * raw_frame
Pointer to the buffer that contains the PHR and PSDU of the transmitted frame.
Definition: nrf_802154_aes_ccm.h:62
uint8_t mic_level
Message Integrity Code level.
Definition: nrf_802154_aes_ccm.h:61
uint8_t * auth_data
Pointer to AES-CCM* authorization data.
Definition: nrf_802154_aes_ccm.h:56
uint8_t plain_text_data_len
Length of plain text data.
Definition: nrf_802154_aes_ccm.h:59
uint64_t auth_data_len
Length of AES-CCM* authorization data.
Definition: nrf_802154_aes_ccm.h:57
Data necessary for a single AES-CCM* operation.
Definition: nrf_802154_aes_ccm.h:54