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 int _rtw_ccmp_encrypt(_adapter *padapter, u8 *key, u32 key_len, uint hdrlen, u8 *frame, uint plen); 22 int _rtw_ccmp_decrypt(_adapter *padapter, u8 *key, u32 key_len, uint hdrlen, u8 *frame, uint plen); 23 24 int _rtw_gcmp_encrypt(_adapter *padapter, u8 *key, u32 key_len, uint hdrlen, u8 *frame, uint plen); 25 int _rtw_gcmp_decrypt(_adapter *padapter, u8 *key, u32 key_len, uint hdrlen, u8 *frame, uint plen); 26 27 #ifdef CONFIG_RTW_MESH_AEK 28 int _aes_siv_encrypt(const u8 *key, size_t key_len, 29 const u8 *pw, size_t pwlen, 30 size_t num_elem, const u8 *addr[], const size_t *len, u8 *out); 31 int _aes_siv_decrypt(const u8 *key, size_t key_len, 32 const u8 *iv_crypt, size_t iv_c_len, 33 size_t num_elem, const u8 *addr[], const size_t *len, u8 *out); 34 #endif 35 36 #if defined(CONFIG_IEEE80211W) | defined(CONFIG_TDLS) 37 u8 _bip_ccmp_protect(const u8 *key, size_t key_len, 38 const u8 *data, size_t data_len, u8 *mic); 39 u8 _bip_gcmp_protect(u8 *whdr_pos, size_t len, 40 const u8 *key, size_t key_len, 41 const u8 *data, size_t data_len, u8 *mic); 42 #endif /* CONFIG_IEEE80211W */ 43 44 #ifdef CONFIG_TDLS 45 void _tdls_generate_tpk(void *sta, const u8 *own_addr, const u8 *bssid); 46 #endif /* CONFIG_TDLS */ 47 48 #endif /* __RTW_SWCRYPTO_H_ */ 49 50