WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
hmac_crypto_tkip.h
浏览该文件的文档.
1/*
2 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2020-2022. All rights reserved.
3 * Description: tkip crypto head file.
4 */
5
6#ifndef __HMAC_CRYPTO_TKIP_H__
7#define __HMAC_CRYPTO_TKIP_H__
8
9/*****************************************************************************
10 1 其他头文件包含
11*****************************************************************************/
12#include "oal_net.h"
13#include "wlan_types_common.h"
14
15#ifdef __cplusplus
16#if __cplusplus
17extern "C" {
18#endif
19#endif
20
21/*****************************************************************************
22 2 宏定义
23*****************************************************************************/
24#define IEEE80211_WEP_MICLEN 8 /* trailing MIC */
25
26#define IEEE80211_FC1_DIR_NODS 0x00 /* STA->STA */
27#define IEEE80211_FC1_DIR_TODS 0x01 /* STA->AP */
28#define IEEE80211_FC1_DIR_FROMDS 0x02 /* AP ->STA */
29#define IEEE80211_FC1_DIR_DSTODS 0x03 /* AP ->AP */
30
31#define IEEE80211_NON_QOS_SEQ 16 /* index for non-QoS (including management) sequence number space */
32#define IEEE80211_FC0_TYPE_MASK 0x0c
33#define IEEE80211_FC0_SUBTYPE_QOS 0x80
34#define IEEE80211_FC0_TYPE_DATA 0x08
35
36
37#define WEP_IV_FIELD_SIZE 4 /* wep IV field size */
38#define EXT_IV_FIELD_SIZE 4 /* ext IV field size */
39
40
41/*****************************************************************************
42 3 枚举定义
43*****************************************************************************/
44
45
46/*****************************************************************************
47 4 全局变量声明
48*****************************************************************************/
49
50
51/*****************************************************************************
52 5 消息头定义
53*****************************************************************************/
54
55
56/*****************************************************************************
57 6 消息定义
58*****************************************************************************/
59
60
61/*****************************************************************************
62 7 STRUCT定义
63*****************************************************************************/
64
65
66/*****************************************************************************
67 8 UNION定义
68*****************************************************************************/
69
70
71/*****************************************************************************
72 9 OTHERS定义
73*****************************************************************************/
74
75
76/*****************************************************************************
77 10 函数声明
78*****************************************************************************/
79
81{
82 return (val << (osal_u32)bits) | (val >> (osal_u32)(32 - bits)); /* 4*8bit共计32位 */
83}
84
85
87{
88 return (val >> (osal_u32)bits) | (val << (osal_u32)(32 - bits)); /* 4*8bit共计32位 */
89}
90
91
93{
94 return ((val & 0x00ff00ff) << 8) | ((val & 0xff00ff00) >> 8); /* 左移8位、右移8位 */
95}
96
97
99{
100 return b0 | (b1 << 8) | (b2 << 16) | (b3 << 24); /* 左移8、16、24位 */
101}
102
104{
105 return get_le32_split(p[0], p[1], p[2], p[3]); /* uint8的地址第0、1、2、3位得到uint32 */
106}
108{
109 p[0] = (osal_u8)v;
110 p[1] = (osal_u8)(v >> 8); /* 第1位右移8位 */
111 p[2] = (osal_u8)(v >> 16); /* 第2位右移16位 */
112 p[3] = (osal_u8)(v >> 24); /* 第3位右移24位 */
113}
114
117
118#ifdef __cplusplus
119#if __cplusplus
120}
121#endif
122#endif
123
124#endif /* end of hmac_crypto_tkip.h */
#define OAL_INLINE
Definition driver_soc_common.h:47
OAL_STATIC OAL_INLINE osal_void put_le32(osal_u8 *p, osal_u32 v)
Definition hmac_crypto_tkip.h:107
OAL_STATIC OAL_INLINE osal_u32 get_le32(const osal_u8 *p)
Definition hmac_crypto_tkip.h:103
OAL_STATIC OAL_INLINE osal_u32 get_le32_split(osal_u8 b0, osal_u8 b1, osal_u8 b2, osal_u8 b3)
Definition hmac_crypto_tkip.h:98
OAL_STATIC OAL_INLINE osal_u32 xswap(osal_u32 val)
Definition hmac_crypto_tkip.h:92
osal_u32 hmac_crypto_tkip_enmic_etc(wlan_priv_key_param_stru *pst_key, oal_netbuf_stru *pst_netbuf)
osal_u32 hmac_crypto_tkip_demic_etc(wlan_priv_key_param_stru *pst_key, oal_netbuf_stru *pst_netbuf)
int osal_s32
Definition osal_types.h:19
unsigned char osal_u8
Definition osal_types.h:11
void osal_void
Definition osal_types.h:29
unsigned int osal_u32
Definition osal_types.h:13
#define rotr(x, n)
Definition sha256.c:16
#define rotl(x, n)
Definition sha256.c:15
#define OAL_STATIC
Definition soc_wifi_service_api.c:30
Definition oal_skbuff.h:82
Definition wlan_types.h:758