Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
rtl871x_security.c File Reference
#include <linux/compiler.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/kref.h>
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <linux/circ_buf.h>
#include <linux/uaccess.h>
#include <asm/byteorder.h>
#include <linux/atomic.h>
#include <linux/semaphore.h>
#include "osdep_service.h"
#include "drv_types.h"
#include "wifi.h"
#include "osdep_intf.h"

Go to the source code of this file.

Data Structures

struct  arc4context
 

Macros

#define _RTL871X_SECURITY_C_
 
#define CRC32_POLY   0x04c11db7
 
#define RotR1(v16)   ((((v16) >> 1) & 0x7FFF) ^ (((v16) & 1) << 15))
 
#define Lo8(v16)   ((u8)((v16) & 0x00FF))
 
#define Hi8(v16)   ((u8)(((v16) >> 8) & 0x00FF))
 
#define Lo16(v32)   ((u16)((v32) & 0xFFFF))
 
#define Hi16(v32)   ((u16)(((v32) >> 16) & 0xFFFF))
 
#define Mk16(hi, lo)   ((lo) ^ (((u16)(hi)) << 8))
 
#define TK16(N)   Mk16(tk[2 * (N) + 1], tk[2 * (N)])
 
#define _S_(v16)   (Sbox1[0][Lo8(v16)] ^ Sbox1[1][Hi8(v16)])
 
#define PHASE1_LOOP_CNT   8 /* this needs to be "big enough" */
 
#define TA_SIZE   6 /* 48-bit transmitter address */
 
#define TK_SIZE   16 /* 128-bit temporal key */
 
#define P1K_SIZE   10 /* 80-bit Phase1 key */
 
#define RC4_KEY_SIZE   16 /* 128-bit RC4KEY (104 bits unknown) */
 
#define MAX_MSG_SIZE   2048
 

Functions

void r8712_wep_encrypt (struct _adapter *padapter, u8 *pxmitframe)
 
void r8712_wep_decrypt (struct _adapter *padapter, u8 *precvframe)
 
void r8712_secmicsetkey (struct mic_data *pmicdata, u8 *key)
 
void r8712_secmicappend (struct mic_data *pmicdata, u8 *src, u32 nbytes)
 
void r8712_secgetmic (struct mic_data *pmicdata, u8 *dst)
 
void seccalctkipmic (u8 *key, u8 *header, u8 *data, u32 data_len, u8 *mic_code, u8 pri)
 
u32 r8712_tkip_encrypt (struct _adapter *padapter, u8 *pxmitframe)
 
u32 r8712_tkip_decrypt (struct _adapter *padapter, u8 *precvframe)
 
u32 r8712_aes_encrypt (struct _adapter *padapter, u8 *pxmitframe)
 
u32 r8712_aes_decrypt (struct _adapter *padapter, u8 *precvframe)
 
void r8712_use_tkipkey_handler (void *FunctionContext)
 

Macro Definition Documentation

#define _RTL871X_SECURITY_C_

Definition at line 29 of file rtl871x_security.c.

#define _S_ (   v16)    (Sbox1[0][Lo8(v16)] ^ Sbox1[1][Hi8(v16)])

Definition at line 390 of file rtl871x_security.c.

#define CRC32_POLY   0x04c11db7

Definition at line 53 of file rtl871x_security.c.

#define Hi16 (   v32)    ((u16)(((v32) >> 16) & 0xFFFF))

Definition at line 383 of file rtl871x_security.c.

#define Hi8 (   v16)    ((u8)(((v16) >> 8) & 0x00FF))

Definition at line 381 of file rtl871x_security.c.

#define Lo16 (   v32)    ((u16)((v32) & 0xFFFF))

Definition at line 382 of file rtl871x_security.c.

#define Lo8 (   v16)    ((u8)((v16) & 0x00FF))

Definition at line 380 of file rtl871x_security.c.

#define MAX_MSG_SIZE   2048

Definition at line 713 of file rtl871x_security.c.

#define Mk16 (   hi,
  lo 
)    ((lo) ^ (((u16)(hi)) << 8))

Definition at line 384 of file rtl871x_security.c.

#define P1K_SIZE   10 /* 80-bit Phase1 key */

Definition at line 396 of file rtl871x_security.c.

#define PHASE1_LOOP_CNT   8 /* this needs to be "big enough" */

Definition at line 393 of file rtl871x_security.c.

#define RC4_KEY_SIZE   16 /* 128-bit RC4KEY (104 bits unknown) */

Definition at line 397 of file rtl871x_security.c.

#define RotR1 (   v16)    ((((v16) >> 1) & 0x7FFF) ^ (((v16) & 1) << 15))

Definition at line 379 of file rtl871x_security.c.

#define TA_SIZE   6 /* 48-bit transmitter address */

Definition at line 394 of file rtl871x_security.c.

#define TK16 (   N)    Mk16(tk[2 * (N) + 1], tk[2 * (N)])

Definition at line 387 of file rtl871x_security.c.

#define TK_SIZE   16 /* 128-bit temporal key */

Definition at line 395 of file rtl871x_security.c.

Function Documentation

u32 r8712_aes_decrypt ( struct _adapter padapter,
u8 precvframe 
)

Definition at line 1360 of file rtl871x_security.c.

u32 r8712_aes_encrypt ( struct _adapter padapter,
u8 pxmitframe 
)

Definition at line 1152 of file rtl871x_security.c.

void r8712_secgetmic ( struct mic_data pmicdata,
u8 dst 
)

Definition at line 332 of file rtl871x_security.c.

void r8712_secmicappend ( struct mic_data pmicdata,
u8 src,
u32  nbytes 
)

Definition at line 323 of file rtl871x_security.c.

void r8712_secmicsetkey ( struct mic_data pmicdata,
u8 key 
)

Definition at line 291 of file rtl871x_security.c.

u32 r8712_tkip_decrypt ( struct _adapter padapter,
u8 precvframe 
)

Definition at line 651 of file rtl871x_security.c.

u32 r8712_tkip_encrypt ( struct _adapter padapter,
u8 pxmitframe 
)

Definition at line 574 of file rtl871x_security.c.

void r8712_use_tkipkey_handler ( void FunctionContext)

Definition at line 1399 of file rtl871x_security.c.

void r8712_wep_decrypt ( struct _adapter padapter,
u8 precvframe 
)

Definition at line 223 of file rtl871x_security.c.

void r8712_wep_encrypt ( struct _adapter padapter,
u8 pxmitframe 
)

Definition at line 168 of file rtl871x_security.c.

void seccalctkipmic ( u8 key,
u8 header,
u8 data,
u32  data_len,
u8 mic_code,
u8  pri 
)

Definition at line 350 of file rtl871x_security.c.