• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17  */
18 
19 #ifndef __HMAC_WAPI_WPI_H__
20 #define __HMAC_WAPI_WPI_H__
21 
22 /* ****************************************************************************
23   1 头文件包含
24 **************************************************************************** */
25 #ifdef __cplusplus
26 #if __cplusplus
27 extern "C" {
28 #endif
29 #endif
30 
31 #define WPI_PR_KEYIN_LEN 32
32 
33 typedef struct {
34     hi_u8 *puc_key;
35     hi_u8 *puc_iv;
36     hi_u8  key_len;
37     hi_u8  iv_len;
38     hi_u8  resv[2]; /* resv 2byte */
39 } hmac_wapi_crypt_stru;
40 
41 /* ****************************************************************************
42   2 函数声明
43 **************************************************************************** */
44 hi_u32 hmac_wpi_encrypt(hmac_wapi_crypt_stru wpi_key, hi_u8 *puc_bufin, hi_u32 buflen, hi_u8 *puc_bufout);
45 hi_u32 hmac_wpi_decrypt(hmac_wapi_crypt_stru wpi_key, hi_u8 *puc_bufin, hi_u32 buflen, hi_u8 *puc_bufout);
46 hi_u32 hmac_wpi_pmac(hmac_wapi_crypt_stru wpi_key, hi_u8 *puc_buf, hi_u32 pamclen, hi_u8 *puc_mic, hi_u8 mic_len);
47 
48 #ifdef __cplusplus
49 #if __cplusplus
50 }
51 #endif
52 #endif
53 
54 #endif /* __HMAC_WAPI_WPI_H__ */
55