33 #ifndef __TSCH_SECURITY_H__
34 #define __TSCH_SECURITY_H__
53 #if LLSEC802154_ENABLED && !LLSEC802154_USES_EXPLICIT_KEYS
54 #error LLSEC802154_ENABLED set but LLSEC802154_USES_EXPLICIT_KEYS unset
56 #if LLSEC802154_ENABLED && LLSEC802154_USES_FRAME_COUNTER
57 #error LLSEC802154_ENABLED set but LLSEC802154_USES_FRAME_COUNTER set
61 #ifdef TSCH_SECURITY_CONF_K1
62 #define TSCH_SECURITY_K1 TSCH_SECURITY_CONF_K1
64 #define TSCH_SECURITY_K1 { 0x36, 0x54, 0x69, 0x53, 0x43, 0x48, 0x20, 0x6D, 0x69, 0x6E, 0x69, 0x6D, 0x61, 0x6C, 0x31, 0x35 }
68 #ifdef TSCH_SECURITY_CONF_K2
69 #define TSCH_SECURITY_K2 TSCH_SECURITY_CONF_K2
71 #define TSCH_SECURITY_K2 { 0xde, 0xad, 0xbe, 0xef, 0xfa, 0xce, 0xca, 0xfe, 0xde, 0xad, 0xbe, 0xef, 0xfa, 0xce, 0xca, 0xfe }
75 #ifdef TSCH_SECURITY_CONF_KEY_INDEX_EB
76 #define TSCH_SECURITY_KEY_INDEX_EB TSCH_SECURITY_CONF_KEY_INDEX_EB
78 #define TSCH_SECURITY_KEY_INDEX_EB 1
82 #ifdef TSCH_SECURITY_CONF_SEC_LEVEL_EB
83 #define TSCH_SECURITY_KEY_SEC_LEVEL_EB TSCH_SECURITY_CONF_SEC_LEVEL_EB
85 #define TSCH_SECURITY_KEY_SEC_LEVEL_EB 1
89 #ifdef TSCH_SECURITY_CONF_KEY_INDEX_ACK
90 #define TSCH_SECURITY_KEY_INDEX_ACK TSCH_SECURITY_CONF_KEY_INDEX_ACK
92 #define TSCH_SECURITY_KEY_INDEX_ACK 2
96 #ifdef TSCH_SECURITY_CONF_SEC_LEVEL_ACK
97 #define TSCH_SECURITY_KEY_SEC_LEVEL_ACK TSCH_SECURITY_CONF_SEC_LEVEL_ACK
99 #define TSCH_SECURITY_KEY_SEC_LEVEL_ACK 5
103 #ifdef TSCH_SECURITY_CONF_KEY_INDEX_OTHER
104 #define TSCH_SECURITY_KEY_INDEX_OTHER TSCH_SECURITY_CONF_KEY_INDEX_OTHER
106 #define TSCH_SECURITY_KEY_INDEX_OTHER 2
110 #ifdef TSCH_SECURITY_CONF_SEC_LEVEL_OTHER
111 #define TSCH_SECURITY_KEY_SEC_LEVEL_OTHER TSCH_SECURITY_CONF_SEC_LEVEL_OTHER
113 #define TSCH_SECURITY_KEY_SEC_LEVEL_OTHER 5
118 typedef uint8_t aes_key[16];
123 int tsch_security_secure_frame(uint8_t *hdr, uint8_t *outbuf,
124 int hdrlen,
int datalen,
struct asn_t *asn);
125 int tsch_security_parse_frame(
const uint8_t *hdr,
int hdrlen,
int datalen,
126 const frame802154_t *frame,
const linkaddr_t *sender,
struct asn_t *asn);
Private TSCH definitions (meant for use by TSCH implementation files only) ...
Common functionality of 802.15.4-compliant llsec_drivers.
TSCH 5-Byte Absolute Slot Number (ASN) management
IEEE 802.15.4e Information Element (IE) creation and parsing.
802.15.4 frame creation and parsing functions
Parameters used by the frame802154_create() function.