Lines Matching refs:pn
201 u64 pn; in tkip_encrypt_skb() local
233 pn = atomic64_inc_return(&key->conf.tx_pn); in tkip_encrypt_skb()
234 pos = ieee80211_tkip_add_iv(pos, &key->conf, pn); in tkip_encrypt_skb()
315 static void ccmp_special_blocks(struct sk_buff *skb, u8 *pn, u8 *b_0, u8 *aad) in ccmp_special_blocks() argument
359 memcpy(&b_0[8], pn, IEEE80211_CCMP_PN_LEN); in ccmp_special_blocks()
382 static inline void ccmp_pn2hdr(u8 *hdr, u8 *pn, int key_id) in ccmp_pn2hdr() argument
384 hdr[0] = pn[5]; in ccmp_pn2hdr()
385 hdr[1] = pn[4]; in ccmp_pn2hdr()
388 hdr[4] = pn[3]; in ccmp_pn2hdr()
389 hdr[5] = pn[2]; in ccmp_pn2hdr()
390 hdr[6] = pn[1]; in ccmp_pn2hdr()
391 hdr[7] = pn[0]; in ccmp_pn2hdr()
395 static inline void ccmp_hdr2pn(u8 *pn, u8 *hdr) in ccmp_hdr2pn() argument
397 pn[0] = hdr[7]; in ccmp_hdr2pn()
398 pn[1] = hdr[6]; in ccmp_hdr2pn()
399 pn[2] = hdr[5]; in ccmp_hdr2pn()
400 pn[3] = hdr[4]; in ccmp_hdr2pn()
401 pn[4] = hdr[1]; in ccmp_hdr2pn()
402 pn[5] = hdr[0]; in ccmp_hdr2pn()
414 u8 pn[6]; in ccmp_encrypt_skb() local
457 pn[5] = pn64; in ccmp_encrypt_skb()
458 pn[4] = pn64 >> 8; in ccmp_encrypt_skb()
459 pn[3] = pn64 >> 16; in ccmp_encrypt_skb()
460 pn[2] = pn64 >> 24; in ccmp_encrypt_skb()
461 pn[1] = pn64 >> 32; in ccmp_encrypt_skb()
462 pn[0] = pn64 >> 40; in ccmp_encrypt_skb()
464 ccmp_pn2hdr(pos, pn, key->conf.keyidx); in ccmp_encrypt_skb()
471 ccmp_special_blocks(skb, pn, b_0, aad); in ccmp_encrypt_skb()
503 u8 pn[IEEE80211_CCMP_PN_LEN]; in ieee80211_crypto_ccmp_decrypt() local
533 ccmp_hdr2pn(pn, skb->data + hdrlen); in ieee80211_crypto_ccmp_decrypt()
537 res = memcmp(pn, key->u.ccmp.rx_pn[queue], in ieee80211_crypto_ccmp_decrypt()
549 ccmp_special_blocks(skb, pn, b_0, aad); in ieee80211_crypto_ccmp_decrypt()
559 memcpy(key->u.ccmp.rx_pn[queue], pn, IEEE80211_CCMP_PN_LEN); in ieee80211_crypto_ccmp_decrypt()
561 memcpy(rx->ccm_gcm.pn, pn, IEEE80211_CCMP_PN_LEN); in ieee80211_crypto_ccmp_decrypt()
573 static void gcmp_special_blocks(struct sk_buff *skb, u8 *pn, u8 *j_0, u8 *aad) in gcmp_special_blocks() argument
580 memcpy(&j_0[ETH_ALEN], pn, IEEE80211_GCMP_PN_LEN); in gcmp_special_blocks()
621 static inline void gcmp_pn2hdr(u8 *hdr, const u8 *pn, int key_id) in gcmp_pn2hdr() argument
623 hdr[0] = pn[5]; in gcmp_pn2hdr()
624 hdr[1] = pn[4]; in gcmp_pn2hdr()
627 hdr[4] = pn[3]; in gcmp_pn2hdr()
628 hdr[5] = pn[2]; in gcmp_pn2hdr()
629 hdr[6] = pn[1]; in gcmp_pn2hdr()
630 hdr[7] = pn[0]; in gcmp_pn2hdr()
633 static inline void gcmp_hdr2pn(u8 *pn, const u8 *hdr) in gcmp_hdr2pn() argument
635 pn[0] = hdr[7]; in gcmp_hdr2pn()
636 pn[1] = hdr[6]; in gcmp_hdr2pn()
637 pn[2] = hdr[5]; in gcmp_hdr2pn()
638 pn[3] = hdr[4]; in gcmp_hdr2pn()
639 pn[4] = hdr[1]; in gcmp_hdr2pn()
640 pn[5] = hdr[0]; in gcmp_hdr2pn()
650 u8 pn[6]; in gcmp_encrypt_skb() local
694 pn[5] = pn64; in gcmp_encrypt_skb()
695 pn[4] = pn64 >> 8; in gcmp_encrypt_skb()
696 pn[3] = pn64 >> 16; in gcmp_encrypt_skb()
697 pn[2] = pn64 >> 24; in gcmp_encrypt_skb()
698 pn[1] = pn64 >> 32; in gcmp_encrypt_skb()
699 pn[0] = pn64 >> 40; in gcmp_encrypt_skb()
701 gcmp_pn2hdr(pos, pn, key->conf.keyidx); in gcmp_encrypt_skb()
708 gcmp_special_blocks(skb, pn, j_0, aad); in gcmp_encrypt_skb()
736 u8 pn[IEEE80211_GCMP_PN_LEN]; in ieee80211_crypto_gcmp_decrypt() local
765 gcmp_hdr2pn(pn, skb->data + hdrlen); in ieee80211_crypto_gcmp_decrypt()
769 res = memcmp(pn, key->u.gcmp.rx_pn[queue], in ieee80211_crypto_gcmp_decrypt()
781 gcmp_special_blocks(skb, pn, j_0, aad); in ieee80211_crypto_gcmp_decrypt()
792 memcpy(key->u.gcmp.rx_pn[queue], pn, IEEE80211_GCMP_PN_LEN); in ieee80211_crypto_gcmp_decrypt()
794 memcpy(rx->ccm_gcm.pn, pn, IEEE80211_CCMP_PN_LEN); in ieee80211_crypto_gcmp_decrypt()
922 static inline void bip_ipn_set64(u8 *d, u64 pn) in bip_ipn_set64() argument
924 *d++ = pn; in bip_ipn_set64()
925 *d++ = pn >> 8; in bip_ipn_set64()
926 *d++ = pn >> 16; in bip_ipn_set64()
927 *d++ = pn >> 24; in bip_ipn_set64()
928 *d++ = pn >> 32; in bip_ipn_set64()
929 *d = pn >> 40; in bip_ipn_set64()