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