40 #ifndef __TSCH_SECURITY_H__ 41 #define __TSCH_SECURITY_H__ 57 #if LLSEC802154_ENABLED && !LLSEC802154_USES_EXPLICIT_KEYS 58 #error LLSEC802154_ENABLED set but LLSEC802154_USES_EXPLICIT_KEYS unset 62 #ifdef TSCH_SECURITY_CONF_K1 63 #define TSCH_SECURITY_K1 TSCH_SECURITY_CONF_K1 65 #define TSCH_SECURITY_K1 { 0x36, 0x54, 0x69, 0x53, 0x43, 0x48, 0x20, 0x6D, 0x69, 0x6E, 0x69, 0x6D, 0x61, 0x6C, 0x31, 0x35 } 69 #ifdef TSCH_SECURITY_CONF_K2 70 #define TSCH_SECURITY_K2 TSCH_SECURITY_CONF_K2 72 #define TSCH_SECURITY_K2 { 0xde, 0xad, 0xbe, 0xef, 0xfa, 0xce, 0xca, 0xfe, 0xde, 0xad, 0xbe, 0xef, 0xfa, 0xce, 0xca, 0xfe } 76 #ifdef TSCH_SECURITY_CONF_KEY_INDEX_EB 77 #define TSCH_SECURITY_KEY_INDEX_EB TSCH_SECURITY_CONF_KEY_INDEX_EB 79 #define TSCH_SECURITY_KEY_INDEX_EB 1 83 #ifdef TSCH_SECURITY_CONF_SEC_LEVEL_EB 84 #define TSCH_SECURITY_KEY_SEC_LEVEL_EB TSCH_SECURITY_CONF_SEC_LEVEL_EB 86 #define TSCH_SECURITY_KEY_SEC_LEVEL_EB 1 90 #ifdef TSCH_SECURITY_CONF_KEY_INDEX_ACK 91 #define TSCH_SECURITY_KEY_INDEX_ACK TSCH_SECURITY_CONF_KEY_INDEX_ACK 93 #define TSCH_SECURITY_KEY_INDEX_ACK 2 97 #ifdef TSCH_SECURITY_CONF_SEC_LEVEL_ACK 98 #define TSCH_SECURITY_KEY_SEC_LEVEL_ACK TSCH_SECURITY_CONF_SEC_LEVEL_ACK 100 #define TSCH_SECURITY_KEY_SEC_LEVEL_ACK 5 104 #ifdef TSCH_SECURITY_CONF_KEY_INDEX_OTHER 105 #define TSCH_SECURITY_KEY_INDEX_OTHER TSCH_SECURITY_CONF_KEY_INDEX_OTHER 107 #define TSCH_SECURITY_KEY_INDEX_OTHER 2 111 #ifdef TSCH_SECURITY_CONF_SEC_LEVEL_OTHER 112 #define TSCH_SECURITY_KEY_SEC_LEVEL_OTHER TSCH_SECURITY_CONF_SEC_LEVEL_OTHER 114 #define TSCH_SECURITY_KEY_SEC_LEVEL_OTHER 5 120 typedef uint8_t aes_key[16];
134 int hdrlen,
int datalen,
144 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.