xref: /OK3568_Linux_fs/external/rkwifibt/drivers/rtl8852be/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 #if 0 //RTW_PHL_TX: mark un-finished codes for reading
22*4882a593Smuzhiyun int _rtw_core_ccmp_encrypt(u8 *key, u32 key_len, uint hdrlen, u8 *phdr, uint datalen, u8 *pdata);
23*4882a593Smuzhiyun #endif
24*4882a593Smuzhiyun 
25*4882a593Smuzhiyun 
26*4882a593Smuzhiyun int _rtw_ccmp_encrypt(_adapter *padapter, u8 *key, u32 key_len, uint hdrlen, u8 *frame, uint plen);
27*4882a593Smuzhiyun int _rtw_ccmp_decrypt(_adapter *padapter, u8 *key, u32 key_len, uint hdrlen, u8 *frame, uint plen);
28*4882a593Smuzhiyun 
29*4882a593Smuzhiyun int _rtw_gcmp_encrypt(_adapter *padapter, u8 *key, u32 key_len, uint hdrlen, u8 *frame, uint plen);
30*4882a593Smuzhiyun int _rtw_gcmp_decrypt(_adapter *padapter, u8 *key, u32 key_len, uint hdrlen, u8 *frame, uint plen);
31*4882a593Smuzhiyun 
32*4882a593Smuzhiyun #ifdef CONFIG_RTW_MESH_AEK
33*4882a593Smuzhiyun int _aes_siv_encrypt(const u8 *key, size_t key_len,
34*4882a593Smuzhiyun 	const u8 *pw, size_t pwlen,
35*4882a593Smuzhiyun 	size_t num_elem, const u8 *addr[], const size_t *len, u8 *out);
36*4882a593Smuzhiyun int _aes_siv_decrypt(const u8 *key, size_t key_len,
37*4882a593Smuzhiyun 	const u8 *iv_crypt, size_t iv_c_len,
38*4882a593Smuzhiyun 	size_t num_elem, const u8 *addr[], const size_t *len, u8 *out);
39*4882a593Smuzhiyun #endif
40*4882a593Smuzhiyun 
41*4882a593Smuzhiyun #if defined(CONFIG_IEEE80211W) | defined(CONFIG_TDLS)
42*4882a593Smuzhiyun u8 _bip_ccmp_protect(const u8 *key, size_t key_len,
43*4882a593Smuzhiyun 	const u8 *data, size_t data_len, u8 *mic);
44*4882a593Smuzhiyun u8 _bip_gcmp_protect(u8 *whdr_pos, size_t len,
45*4882a593Smuzhiyun 	const u8 *key, size_t key_len,
46*4882a593Smuzhiyun 	const u8 *data, size_t data_len, u8 *mic);
47*4882a593Smuzhiyun #endif /* CONFIG_IEEE80211W */
48*4882a593Smuzhiyun 
49*4882a593Smuzhiyun #ifdef CONFIG_TDLS
50*4882a593Smuzhiyun void _tdls_generate_tpk(void *sta, const u8 *own_addr, const u8 *bssid);
51*4882a593Smuzhiyun #endif /* CONFIG_TDLS */
52*4882a593Smuzhiyun 
53*4882a593Smuzhiyun #endif /* __RTW_SWCRYPTO_H_ */
54*4882a593Smuzhiyun 
55