MOXA linux-2.6.x / linux-2.6.9-uc0 from sdlinux-moxaart.tgz
[linux-2.6.9-moxart.git] / drivers / net / wireless / rtlink.org / md5.h
blobb9c6c67c56bb425d6151dcd112d9705dbfa28c45
1 #ifndef MD5_H
2 #define MD5_H
4 #define MD5_MAC_LEN 16
5 #define SHA_DIGEST_LEN 20
7 struct MD5Context {
8 u32 buf[4];
9 u32 bits[2];
10 u8 in[64];
13 void MD5Init(struct MD5Context *context);
14 void MD5Update(struct MD5Context *context, unsigned char *buf, unsigned len);
15 void MD5Final(unsigned char digest[16], struct MD5Context *context);
16 void MD5Transform(u32 buf[4], u32 in[16]);
18 typedef struct MD5Context MD5_CTX;
21 void md5_mac(u8 *key, size_t key_len, u8 *data, size_t data_len, u8 *mac);
22 void hmac_md5(u8 *key, size_t key_len, u8 *data, size_t data_len, u8 *mac);
24 #endif /* MD5_H */
26 #ifndef _AES_H
27 #define _AES_H
29 #ifndef uint8
30 #define uint8 unsigned char
31 #endif
33 #ifndef uint32
34 #define uint32 unsigned long int
35 #endif
37 typedef struct
39 uint32 erk[64]; /* encryption round keys */
40 uint32 drk[64]; /* decryption round keys */
41 int nr; /* number of rounds */
43 aes_context;
45 int aes_set_key( aes_context *ctx, uint8 *key, int nbits );
46 void aes_encrypt( aes_context *ctx, uint8 input[16], uint8 output[16] );
47 void aes_decrypt( aes_context *ctx, uint8 input[16], uint8 output[16] );
50 void SHAInit(SHA_CTX *ctx);
51 void SHAUpdate(SHA_CTX *ctx, unsigned char *dataIn, int len);
52 void SHAFinal(SHA_CTX *ctx, unsigned char hashout[20]);
53 void SHAHashBlock(SHA_CTX *ctx);
54 void hmac_sha1(unsigned char *text, int text_len, unsigned char *key, int key_len, unsigned char *digest);
55 void F(char *password, unsigned char *ssid, int ssidlength, int iterations, int count, unsigned char *output);
56 int PasswordHash(char *password, unsigned char *ssid, int ssidlength, unsigned char *output);
58 #endif /* aes.h */