diff options
Diffstat (limited to 'drivers/staging/rtl8188eu/include/rtw_security.h')
-rw-r--r-- | drivers/staging/rtl8188eu/include/rtw_security.h | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/drivers/staging/rtl8188eu/include/rtw_security.h b/drivers/staging/rtl8188eu/include/rtw_security.h index f8d9151fe6e3..8ba02a7cea60 100644 --- a/drivers/staging/rtl8188eu/include/rtw_security.h +++ b/drivers/staging/rtl8188eu/include/rtw_security.h @@ -37,7 +37,6 @@ enum { ENCRYP_PROTOCOL_MAX }; - #ifndef Ndis802_11AuthModeWPA2 #define Ndis802_11AuthModeWPA2 (Ndis802_11AuthModeWPANone + 1) #endif @@ -209,7 +208,6 @@ do { \ } \ } while (0) - #define GET_TKIP_PN(iv, dot11txpn) \ do { \ dot11txpn._byte_.TSC0 = iv[2]; \ @@ -220,9 +218,8 @@ do { \ dot11txpn._byte_.TSC5 = iv[7]; \ } while (0) - -#define ROL32(A, n) (((A) << (n)) | (((A)>>(32-(n))) & ((1UL << (n)) - 1))) -#define ROR32(A, n) ROL32((A), 32-(n)) +#define ROL32(A, n) (((A) << (n)) | (((A) >> (32 - (n))) & ((1UL << (n)) - 1))) +#define ROR32(A, n) ROL32((A), 32 - (n)) struct mic_data { u32 K0, K1; /* Key */ @@ -278,12 +275,12 @@ static const unsigned long K[64] = { /* Various logical functions */ #define RORc(x, y) \ - (((((unsigned long)(x) & 0xFFFFFFFFUL) >> (unsigned long)((y)&31)) | \ - ((unsigned long)(x) << (unsigned long)(32-((y)&31)))) & 0xFFFFFFFFUL) + (((((unsigned long)(x) & 0xFFFFFFFFUL) >> (unsigned long)((y) & 31)) | \ + ((unsigned long)(x) << (unsigned long)(32 - ((y) & 31)))) & 0xFFFFFFFFUL) #define Ch(x, y, z) (z ^ (x & (y ^ z))) #define Maj(x, y, z) (((x | y) & z) | (x & y)) #define S(x, n) RORc((x), (n)) -#define R(x, n) (((x)&0xFFFFFFFFUL)>>(n)) +#define R(x, n) (((x) & 0xFFFFFFFFUL) >> (n)) #define Sigma0(x) (S(x, 2) ^ S(x, 13) ^ S(x, 22)) #define Sigma1(x) (S(x, 6) ^ S(x, 11) ^ S(x, 25)) #define Gamma0(x) (S(x, 7) ^ S(x, 18) ^ R(x, 3)) @@ -295,11 +292,11 @@ void rtw_secmicappend(struct mic_data *pmicdata, u8 *src, u32 nBytes); void rtw_secgetmic(struct mic_data *pmicdata, u8 *dst); void rtw_seccalctkipmic(u8 *key, u8 *header, u8 *data, u32 data_len, u8 *Miccode, u8 priority); -u32 rtw_aes_encrypt(struct adapter *padapter, u8 *pxmitframe); -u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe); -void rtw_wep_encrypt(struct adapter *padapter, u8 *pxmitframe); -u32 rtw_aes_decrypt(struct adapter *padapter, u8 *precvframe); -u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe); -int rtw_wep_decrypt(struct adapter *padapter, u8 *precvframe); +u32 rtw_aes_encrypt(struct adapter *padapter, struct xmit_frame *pxmitframe); +u32 rtw_tkip_encrypt(struct adapter *padapter, struct xmit_frame *pxmitframe); +void rtw_wep_encrypt(struct adapter *padapter, struct xmit_frame *pxmitframe); +u32 rtw_aes_decrypt(struct adapter *padapter, struct recv_frame *precvframe); +u32 rtw_tkip_decrypt(struct adapter *padapter, struct recv_frame *precvframe); +int rtw_wep_decrypt(struct adapter *padapter, struct recv_frame *precvframe); #endif /* __RTL871X_SECURITY_H_ */ |