⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 zdmic.h

📁 该代码为linux下通过usb驱动实现的无线网络驱动程序,在2.6.18的内核下调试通过
💻 H
字号:
/*
   $Id: zdmic.h,v 1.1.1.1 2006/07/13 10:27:54 mzcai Exp $
*/
/***********************************************************************/
/*          Copyright 2003 by ZyDAS Technology     Corporation         */
/*                                                                     */
/***********************************************************************/
/***********************************************************************/
/*                                                                     */
/*    FILE DESCRIPTION                          MIChael.h              */
/*      Header file required for TKIP  MIC                             */
/*                                                                     */
/*    ROUTINES                                                         */
/*      XXX                                                            */
/*                                                                     */
/*    NOTES                                                            */
/*      XXX                                                            */
/*                                                                     */
/*    MAINTAINER                                                       */
/*      Liam,Hwu            ZyDAS Technology   Corporation     2003    */
/*                                                                     */
/***********************************************************************/
#ifndef _ZDMIC_H_
#define _ZDMIC_H_


// Rotation functions on 32 bit values
#define ROL32(A, n) \
 		( ((A) << (n)) | ( ((A)>>(32-(n)))  & ( (1UL << (n)) - 1 ) ) )
 		
#define ROR32(A, n) ROL32( (A), 32-(n) )


//variable.
typedef struct
{
	U32  K0, K1;	// Key
    U32  L, R;   	// Current state
    U32  M;      	// Message accumulator (single word)
    int  nBytesInM; // # bytes in M
} MICvar;			// variable for MIC


// Clear the internal message, 
// resets the object to the state just after construction.
void MICclear(MICvar *MIC);


// Set the key to a new value
void MICsetKey(U8 *key, MICvar *MIC);


// Get the MIC result. Destination should accept 8 bytes of result.
// This also resets the message to empty.

void MICgetMIC(U8 *dst, MICvar *MIC);


// Add a single byte to the internal message
void MICappendByte(U8 b, MICvar *MIC);
void MICappendArr(U8 *pb, MICvar *MIC, U32 Size);


// Get U32 from 4 bytes LSByte first
U32 getUInt32(U8 *p);


// Put U32 into 4 bytes LSByte first
void putUInt32(U8 *p, U32 val);

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -