40 #ifndef __TSCH_SECURITY_H__ 41 #define __TSCH_SECURITY_H__ 58 #ifdef TSCH_SECURITY_CONF_K1 59 #define TSCH_SECURITY_K1 TSCH_SECURITY_CONF_K1 61 #define TSCH_SECURITY_K1 { 0x36, 0x54, 0x69, 0x53, 0x43, 0x48, 0x20, 0x6D, 0x69, 0x6E, 0x69, 0x6D, 0x61, 0x6C, 0x31, 0x35 } 65 #ifdef TSCH_SECURITY_CONF_K2 66 #define TSCH_SECURITY_K2 TSCH_SECURITY_CONF_K2 68 #define TSCH_SECURITY_K2 { 0xde, 0xad, 0xbe, 0xef, 0xfa, 0xce, 0xca, 0xfe, 0xde, 0xad, 0xbe, 0xef, 0xfa, 0xce, 0xca, 0xfe } 72 #ifdef TSCH_SECURITY_CONF_KEY_INDEX_EB 73 #define TSCH_SECURITY_KEY_INDEX_EB TSCH_SECURITY_CONF_KEY_INDEX_EB 75 #define TSCH_SECURITY_KEY_INDEX_EB 1 79 #ifdef TSCH_SECURITY_CONF_SEC_LEVEL_EB 80 #define TSCH_SECURITY_KEY_SEC_LEVEL_EB TSCH_SECURITY_CONF_SEC_LEVEL_EB 82 #define TSCH_SECURITY_KEY_SEC_LEVEL_EB 1 86 #ifdef TSCH_SECURITY_CONF_KEY_INDEX_ACK 87 #define TSCH_SECURITY_KEY_INDEX_ACK TSCH_SECURITY_CONF_KEY_INDEX_ACK 89 #define TSCH_SECURITY_KEY_INDEX_ACK 2 93 #ifdef TSCH_SECURITY_CONF_SEC_LEVEL_ACK 94 #define TSCH_SECURITY_KEY_SEC_LEVEL_ACK TSCH_SECURITY_CONF_SEC_LEVEL_ACK 96 #define TSCH_SECURITY_KEY_SEC_LEVEL_ACK 5 100 #ifdef TSCH_SECURITY_CONF_KEY_INDEX_OTHER 101 #define TSCH_SECURITY_KEY_INDEX_OTHER TSCH_SECURITY_CONF_KEY_INDEX_OTHER 103 #define TSCH_SECURITY_KEY_INDEX_OTHER 2 107 #ifdef TSCH_SECURITY_CONF_SEC_LEVEL_OTHER 108 #define TSCH_SECURITY_KEY_SEC_LEVEL_OTHER TSCH_SECURITY_CONF_SEC_LEVEL_OTHER 110 #define TSCH_SECURITY_KEY_SEC_LEVEL_OTHER 5 116 typedef uint8_t aes_key[16];
130 int hdrlen,
int datalen,
140 const linkaddr_t *sender,
IEEE 802.15.4e Information Element (IE) creation and parsing.
unsigned int tsch_security_parse_frame(const uint8_t *hdr, int hdrlen, int datalen, const frame802154_t *frame, const linkaddr_t *sender, struct tsch_asn_t *asn)
Parse and check a frame protected with encryption and/or MIC.
Common functionality of 802.15.4-compliant llsec_drivers.
unsigned int tsch_security_mic_len(const frame802154_t *frame)
Return MIC length.
802.15.4 frame creation and parsing functions
Parameters used by the frame802154_create() function.
unsigned int tsch_security_secure_frame(uint8_t *hdr, uint8_t *outbuf, int hdrlen, int datalen, struct tsch_asn_t *asn)
Protect a frame with encryption and/or MIC.
The ASN is an absolute slot number over 5 bytes.