MOXA linux-2.6.x / linux-2.6.9-uc0 from sdlinux-moxaart.tgz
[linux-2.6.9-moxart.git] / drivers / net / wireless / rtlink / Module / md5.h
blob79b77be68dc77e6fd327b91123379f8b55d48c1a
1 #ifndef __MD5_H__
2 #define __MD5_H__
4 #define MD5_MAC_LEN 16
5 #define SHA_DIGEST_LEN 20
7 typedef struct _MD5_CTX {
8 ULONG Buf[4]; // buffers of four states
9 UCHAR Input[64]; // input message
10 ULONG LenInBitCount[2]; // length counter for input message, 0 up to 64 bits
11 } MD5_CTX;
13 VOID MD5Init(MD5_CTX *pCtx);
14 VOID MD5Update(MD5_CTX *pCtx, UCHAR *pData, ULONG LenInBytes);
15 VOID MD5Final(UCHAR Digest[16], MD5_CTX *pCtx);
16 VOID MD5Transform(ULONG Buf[4], ULONG Mes[16]);
18 void md5_mac(UCHAR *key, ULONG key_len, UCHAR *data, ULONG data_len, UCHAR *mac);
19 void hmac_md5(UCHAR *key, ULONG key_len, UCHAR *data, ULONG data_len, UCHAR *mac);
22 #endif // __MD5_H__
25 /******************************************************************************/
27 VOID SHAInit(SHA_CTX *pCtx);
28 UCHAR SHAUpdate(SHA_CTX *pCtx, UCHAR *pData, ULONG LenInBytes);
29 VOID SHAFinal(SHA_CTX *pCtx, UCHAR Digest[20]);
30 VOID SHATransform(ULONG Buf[5], ULONG Mes[20]);
32 void hmac_sha1(unsigned char *text, int text_len, unsigned char *key, int key_len, unsigned char *digest);
33 void F(char *password, unsigned char *ssid, int ssidlength, int iterations, int count, unsigned char *output);
34 int PasswordHash(char *password, unsigned char *ssid, int ssidlength, unsigned char *output);
36 /******************************************************************************/
37 #ifndef _AES_H
38 #define _AES_H
40 #ifndef uint8
41 #define uint8 unsigned char
42 #endif
44 #ifndef uint32
45 #define uint32 unsigned long int
46 #endif
48 typedef struct
50 uint32 erk[64]; /* encryption round keys */
51 uint32 drk[64]; /* decryption round keys */
52 int nr; /* number of rounds */
54 aes_context;
56 int aes_set_key( aes_context *ctx, uint8 *key, int nbits );
57 void aes_encrypt( aes_context *ctx, uint8 input[16], uint8 output[16] );
58 void aes_decrypt( aes_context *ctx, uint8 input[16], uint8 output[16] );
60 #endif /* aes.h */