MOXA linux-2.6.x / linux-2.6.9-uc0 from sdlinux-moxaart.tgz
[linux-2.6.9-moxart.git] / drivers / usb / net / Zydas / zdmic.h
blobdf12619be0ca408efda53935dda45bad10f2f7f1
1 /*
2 $Id: zdmic.h,v 1.1.1.1 2006/07/13 10:27:54 mzcai Exp $
3 */
4 /***********************************************************************/
5 /* Copyright 2003 by ZyDAS Technology Corporation */
6 /* */
7 /***********************************************************************/
8 /***********************************************************************/
9 /* */
10 /* FILE DESCRIPTION MIChael.h */
11 /* Header file required for TKIP MIC */
12 /* */
13 /* ROUTINES */
14 /* XXX */
15 /* */
16 /* NOTES */
17 /* XXX */
18 /* */
19 /* MAINTAINER */
20 /* Liam,Hwu ZyDAS Technology Corporation 2003 */
21 /* */
22 /***********************************************************************/
23 #ifndef _ZDMIC_H_
24 #define _ZDMIC_H_
27 // Rotation functions on 32 bit values
28 #define ROL32(A, n) \
29 ( ((A) << (n)) | ( ((A)>>(32-(n))) & ( (1UL << (n)) - 1 ) ) )
31 #define ROR32(A, n) ROL32( (A), 32-(n) )
34 //variable.
35 typedef struct
37 U32 K0, K1; // Key
38 U32 L, R; // Current state
39 U32 M; // Message accumulator (single word)
40 int nBytesInM; // # bytes in M
41 } MICvar; // variable for MIC
44 // Clear the internal message,
45 // resets the object to the state just after construction.
46 void MICclear(MICvar *MIC);
49 // Set the key to a new value
50 void MICsetKey(U8 *key, MICvar *MIC);
53 // Get the MIC result. Destination should accept 8 bytes of result.
54 // This also resets the message to empty.
56 void MICgetMIC(U8 *dst, MICvar *MIC);
59 // Add a single byte to the internal message
60 void MICappendByte(U8 b, MICvar *MIC);
61 void MICappendArr(U8 *pb, MICvar *MIC, U32 Size);
64 // Get U32 from 4 bytes LSByte first
65 U32 getUInt32(U8 *p);
68 // Put U32 into 4 bytes LSByte first
69 void putUInt32(U8 *p, U32 val);
71 #endif