nrfxlib API
3.4.99
Toggle main menu visibility
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
44
extern
"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
53
typedef
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
;
59
uint8_t
plain_text_data_len
;
60
uint8_t
nonce
[
NRF_802154_AES_CCM_NONCE_SIZE
];
61
uint8_t
mic_level
;
62
uint8_t *
raw_frame
;
63
}
nrf_802154_aes_ccm_data_t
;
64
68
void
nrf_802154_aes_ccm_transform_reset
(
void
);
69
78
bool
nrf_802154_aes_ccm_transform_prepare
(
const
nrf_802154_aes_ccm_data_t
* p_aes_ccm_data);
79
90
void
nrf_802154_aes_ccm_transform_start
(uint8_t * p_frame);
91
97
void
nrf_802154_aes_ccm_transform_abort
(uint8_t * p_frame);
98
99
#endif
// NRF_802154_AES_CCM_H_
NRF_802154_AES_CCM_NONCE_SIZE
#define NRF_802154_AES_CCM_NONCE_SIZE
Definition
nrf_802154_aes_ccm.h:48
nrf_802154_aes_ccm_transform_reset
void nrf_802154_aes_ccm_transform_reset(void)
Resets AES-CCM* transformation.
nrf_802154_aes_ccm_transform_start
void nrf_802154_aes_ccm_transform_start(uint8_t *p_frame)
Starts AES-CCM* transformation.
nrf_802154_aes_ccm_transform_abort
void nrf_802154_aes_ccm_transform_abort(uint8_t *p_frame)
Aborts AES-CCM* transformation.
nrf_802154_aes_ccm_transform_prepare
bool nrf_802154_aes_ccm_transform_prepare(const nrf_802154_aes_ccm_data_t *p_aes_ccm_data)
Prepares AES-CCM* transformation.
AES_CCM_KEY_SIZE
#define AES_CCM_KEY_SIZE
Definition
nrf_802154_const.h:169
nrf_802154_const.h
nrf_802154_aes_ccm_data_t::key
uint8_t key[AES_CCM_KEY_SIZE]
Pointer to AES-CCM* key.
Definition
nrf_802154_aes_ccm.h:55
nrf_802154_aes_ccm_data_t::plain_text_data
uint8_t * plain_text_data
Pointer to AES-CCM* plain text data for encryption and authorization.
Definition
nrf_802154_aes_ccm.h:58
nrf_802154_aes_ccm_data_t::raw_frame
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
nrf_802154_aes_ccm_data_t::mic_level
uint8_t mic_level
Message Integrity Code level.
Definition
nrf_802154_aes_ccm.h:61
nrf_802154_aes_ccm_data_t::nonce
uint8_t nonce[(15 - 2)]
Pointer to AES-CCM* nonce.
Definition
nrf_802154_aes_ccm.h:60
nrf_802154_aes_ccm_data_t::auth_data
uint8_t * auth_data
Pointer to AES-CCM* authorization data.
Definition
nrf_802154_aes_ccm.h:56
nrf_802154_aes_ccm_data_t::plain_text_data_len
uint8_t plain_text_data_len
Length of plain text data.
Definition
nrf_802154_aes_ccm.h:59
nrf_802154_aes_ccm_data_t::auth_data_len
uint64_t auth_data_len
Length of AES-CCM* authorization data.
Definition
nrf_802154_aes_ccm.h:57
nrf_802154_aes_ccm_data_t
Data necessary for a single AES-CCM* operation.
Definition
nrf_802154_aes_ccm.h:54
nrf_802154
driver
src
nrf_802154_aes_ccm.h
Generated on
for nrfxlib API by
1.17.0