xref: /OK3568_Linux_fs/external/rkwifibt/drivers/rtl8821cs/include/rtw_swcrypto.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /******************************************************************************
2*4882a593Smuzhiyun  *
3*4882a593Smuzhiyun  * Copyright(c) 2007 - 2017 Realtek Corporation.
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * This program is free software; you can redistribute it and/or modify it
6*4882a593Smuzhiyun  * under the terms of version 2 of the GNU General Public License as
7*4882a593Smuzhiyun  * published by the Free Software Foundation.
8*4882a593Smuzhiyun  *
9*4882a593Smuzhiyun  * This program is distributed in the hope that it will be useful, but WITHOUT
10*4882a593Smuzhiyun  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11*4882a593Smuzhiyun  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12*4882a593Smuzhiyun  * more details.
13*4882a593Smuzhiyun  *
14*4882a593Smuzhiyun  *****************************************************************************/
15*4882a593Smuzhiyun 
16*4882a593Smuzhiyun #ifndef __RTW_SWCRYPTO_H_
17*4882a593Smuzhiyun #define __RTW_SWCRYPTO_H_
18*4882a593Smuzhiyun 
19*4882a593Smuzhiyun #define NEW_CRYPTO 1
20*4882a593Smuzhiyun 
21*4882a593Smuzhiyun int _rtw_ccmp_encrypt(_adapter *padapter, u8 *key, u32 key_len, uint hdrlen, u8 *frame, uint plen);
22*4882a593Smuzhiyun int _rtw_ccmp_decrypt(_adapter *padapter, u8 *key, u32 key_len, uint hdrlen, u8 *frame, uint plen);
23*4882a593Smuzhiyun 
24*4882a593Smuzhiyun int _rtw_gcmp_encrypt(_adapter *padapter, u8 *key, u32 key_len, uint hdrlen, u8 *frame, uint plen);
25*4882a593Smuzhiyun int _rtw_gcmp_decrypt(_adapter *padapter, u8 *key, u32 key_len, uint hdrlen, u8 *frame, uint plen);
26*4882a593Smuzhiyun 
27*4882a593Smuzhiyun #ifdef CONFIG_RTW_MESH_AEK
28*4882a593Smuzhiyun int _aes_siv_encrypt(const u8 *key, size_t key_len,
29*4882a593Smuzhiyun 	const u8 *pw, size_t pwlen,
30*4882a593Smuzhiyun 	size_t num_elem, const u8 *addr[], const size_t *len, u8 *out);
31*4882a593Smuzhiyun int _aes_siv_decrypt(const u8 *key, size_t key_len,
32*4882a593Smuzhiyun 	const u8 *iv_crypt, size_t iv_c_len,
33*4882a593Smuzhiyun 	size_t num_elem, const u8 *addr[], const size_t *len, u8 *out);
34*4882a593Smuzhiyun #endif
35*4882a593Smuzhiyun 
36*4882a593Smuzhiyun #if defined(CONFIG_IEEE80211W) | defined(CONFIG_TDLS)
37*4882a593Smuzhiyun u8 _bip_ccmp_protect(const u8 *key, size_t key_len,
38*4882a593Smuzhiyun 	const u8 *data, size_t data_len, u8 *mic);
39*4882a593Smuzhiyun u8 _bip_gcmp_protect(u8 *whdr_pos, size_t len,
40*4882a593Smuzhiyun 	const u8 *key, size_t key_len,
41*4882a593Smuzhiyun 	const u8 *data, size_t data_len, u8 *mic);
42*4882a593Smuzhiyun #endif /* CONFIG_IEEE80211W */
43*4882a593Smuzhiyun 
44*4882a593Smuzhiyun #ifdef CONFIG_TDLS
45*4882a593Smuzhiyun void _tdls_generate_tpk(void *sta, const u8 *own_addr, const u8 *bssid);
46*4882a593Smuzhiyun #endif /* CONFIG_TDLS */
47*4882a593Smuzhiyun 
48*4882a593Smuzhiyun #endif /* __RTW_SWCRYPTO_H_ */
49*4882a593Smuzhiyun 
50