Lines Matching refs:pn
70 __be64 pn; member
78 __be32 pn; member
304 const struct macsec_secy *secy, u32 pn, in macsec_fill_sectag() argument
323 h->packet_number = htonl(pn); in macsec_fill_sectag()
438 static void macsec_fill_iv_xpn(unsigned char *iv, ssci_t ssci, u64 pn, in macsec_fill_iv_xpn() argument
444 gcm_iv->pn = cpu_to_be64(pn) ^ salt.pn; in macsec_fill_iv_xpn()
447 static void macsec_fill_iv(unsigned char *iv, sci_t sci, u32 pn) in macsec_fill_iv() argument
452 gcm_iv->pn = htonl(pn); in macsec_fill_iv()
480 pn_t pn; in tx_sa_update_pn() local
484 pn = tx_sa->next_pn_halves; in tx_sa_update_pn()
494 return pn; in tx_sa_update_pn()
609 pn_t pn; in macsec_encrypt() local
650 pn = tx_sa_update_pn(tx_sa, secy); in macsec_encrypt()
651 if (pn.full64 == 0) { in macsec_encrypt()
656 macsec_fill_sectag(hh, secy, pn.lower, sci_present); in macsec_encrypt()
688 macsec_fill_iv_xpn(iv, tx_sa->ssci, pn.full64, tx_sa->key.salt); in macsec_encrypt()
690 macsec_fill_iv(iv, secy->sci, pn.lower); in macsec_encrypt()
735 static bool macsec_post_decrypt(struct sk_buff *skb, struct macsec_secy *secy, u32 pn) in macsec_post_decrypt() argument
749 if (secy->replay_protect && pn < lowest_pn && in macsec_post_decrypt()
750 (!secy->xpn || pn_same_half(pn, lowest_pn))) { in macsec_post_decrypt()
787 } else if (pn < lowest_pn) { in macsec_post_decrypt()
795 if (pn < lowest_pn) { in macsec_post_decrypt()
804 if (pn + 1 > rx_sa->next_pn_halves.lower) { in macsec_post_decrypt()
805 rx_sa->next_pn_halves.lower = pn + 1; in macsec_post_decrypt()
807 !pn_same_half(pn, rx_sa->next_pn_halves.lower)) { in macsec_post_decrypt()
809 rx_sa->next_pn_halves.lower = pn + 1; in macsec_post_decrypt()
850 u32 pn; in macsec_decrypt_done() local
858 pn = ntohl(macsec_ethhdr(skb)->packet_number); in macsec_decrypt_done()
859 if (!macsec_post_decrypt(skb, &macsec->secy, pn)) { in macsec_decrypt_done()
3182 u64 pn; in dump_secy() local
3211 pn = tx_sa->next_pn; in dump_secy()
3214 pn = tx_sa->next_pn_halves.lower; in dump_secy()
3219 nla_put(skb, MACSEC_SA_ATTR_PN, pn_len, &pn) || in dump_secy()
3282 u64 pn; in dump_secy() local
3316 pn = rx_sa->next_pn; in dump_secy()
3319 pn = rx_sa->next_pn_halves.lower; in dump_secy()
3324 nla_put(skb, MACSEC_SA_ATTR_PN, pn_len, &pn) || in dump_secy()