/* Software CCMP (AES-CCM): see ccmp.c. * * The 7265D firmware's RX crypto path can fail to use keys that are correctly * installed with ADD_STA_KEY (SEC_ENC_ERR with the matching key ID), while TX * works. The RX path therefore decrypts the frame in software using the * same TK/GTK. */ #ifndef CCMP_H #define CCMP_H /* Decrypt one FromDS CCMP-protected MPDU in place. * * frame the 802.11 MPDU (header, CCMP header, ciphertext, 8-byte MIC) * len full MPDU length * hdr 802.11 header length (24, or 26 with a QoS control field) * key 16-byte CCMP key (TK for key ID 0, GTK for the group key ID) * * Returns 0 and leaves the plaintext at frame + hdr + 8, or -1 on a MIC * failure or malformed frame. */ int ccmp_rx_decrypt(unsigned char *frame, unsigned int len, unsigned int hdr, const unsigned char key[16]); /* Encrypt one ToDS CCMP MPDU in place (the RTL8821AU runs with its crypto * engine off). * * frame header, the filled-in 8-byte CCMP header (PN, ExtIV, key ID) and * the plaintext; the buffer must have 8 more bytes for the MIC * len header + CCMP header + plaintext length (without the MIC) * hdr 802.11 header length (24 or 26) * * Returns 0 (the MPDU is then len + 8 bytes long) or -1. */ int ccmp_tx_encrypt(unsigned char *frame, unsigned int len, unsigned int hdr, const unsigned char key[16]); #endif