Lines Matching full:level

25 int ieee802154_security_setup_session(struct ieee802154_security_ctx *sec_ctx, uint8_t level,  in ieee802154_security_setup_session()  argument
31 if (level > IEEE802154_SECURITY_LEVEL_ENC_MIC_128 || in ieee802154_security_setup_session()
37 if (level > IEEE802154_SECURITY_LEVEL_NONE && in ieee802154_security_setup_session()
43 sec_ctx->level = level; in ieee802154_security_setup_session()
45 if (level == IEEE802154_SECURITY_LEVEL_NONE) { in ieee802154_security_setup_session()
50 if (level > IEEE802154_SECURITY_LEVEL_ENC) { in ieee802154_security_setup_session()
51 authtag_len = level_2_authtag_len[level - 4]; in ieee802154_security_setup_session()
52 } else if (level < IEEE802154_SECURITY_LEVEL_ENC) { in ieee802154_security_setup_session()
53 authtag_len = level_2_authtag_len[level]; in ieee802154_security_setup_session()
93 if (sec_ctx->level == IEEE802154_SECURITY_LEVEL_NONE) { in ieee802154_security_teardown_session()
99 sec_ctx->level = IEEE802154_SECURITY_LEVEL_NONE; in ieee802154_security_teardown_session()
102 static void prepare_cipher_aead_pkt(uint8_t *frame, uint8_t level, uint8_t ll_hdr_len, in prepare_cipher_aead_pkt() argument
109 __ASSERT_NO_MSG(level != IEEE802154_SECURITY_LEVEL_ENC); in prepare_cipher_aead_pkt()
111 is_encrypted = level > IEEE802154_SECURITY_LEVEL_ENC; in prepare_cipher_aead_pkt()
112 is_authenticated = level != IEEE802154_SECURITY_LEVEL_NONE; in prepare_cipher_aead_pkt()
138 uint8_t level; in ieee802154_decrypt_auth() local
141 if (!sec_ctx || sec_ctx->level == IEEE802154_SECURITY_LEVEL_NONE) { in ieee802154_decrypt_auth()
145 level = sec_ctx->level; in ieee802154_decrypt_auth()
150 nonce[12] = level; in ieee802154_decrypt_auth()
152 prepare_cipher_aead_pkt(frame, level, ll_hdr_len, payload_len, authtag_len, &apkt, &pkt); in ieee802154_decrypt_auth()
171 uint8_t level; in ieee802154_encrypt_auth() local
174 if (!sec_ctx || sec_ctx->level == IEEE802154_SECURITY_LEVEL_NONE) { in ieee802154_encrypt_auth()
178 level = sec_ctx->level; in ieee802154_encrypt_auth()
180 if (level == IEEE802154_SECURITY_LEVEL_RESERVED) { in ieee802154_encrypt_auth()
193 nonce[12] = level; in ieee802154_encrypt_auth()
195 prepare_cipher_aead_pkt(frame, level, ll_hdr_len, payload_len, authtag_len, &apkt, &pkt); in ieee802154_encrypt_auth()