xref: /titanic_41/usr/src/cmd/cmd-inet/usr.lib/wpad/wpa_enc.h (revision a399b7655a1d835aa8606c2b29e4e777baac8635)
1 /*
2  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 
6 /*
7  * Copyright (c) 2003-2004, Jouni Malinen <jkmaline@cc.hut.fi>
8  * Sun elects to license this software under the BSD license.
9  * See README for more details.
10  */
11 #ifndef __WPA_ENC_H
12 #define	__WPA_ENC_H
13 
14 #pragma ident	"%Z%%M%	%I%	%E% SMI"
15 
16 #include <openssl/sha.h>
17 #include <openssl/md5.h>
18 
19 #ifdef	__cplusplus
20 extern "C" {
21 #endif
22 
23 #define	SHA1_MAC_LEN	SHA_DIGEST_LENGTH
24 #define	MD5_MAC_LEN	MD5_DIGEST_LENGTH
25 
26 void aes_wrap(uint8_t *, int, uint8_t *, uint8_t *);
27 int aes_unwrap(uint8_t *, int, uint8_t *, uint8_t *);
28 
29 void hmac_sha1_vector(unsigned char *, unsigned int,
30     size_t, unsigned char *[], unsigned int *, unsigned char *);
31 
32 void hmac_sha1(unsigned char *, unsigned int,
33     unsigned char *, unsigned int, unsigned char *);
34 
35 void sha1_prf(unsigned char *, unsigned int,
36     char *, unsigned char *, unsigned int, unsigned char *, size_t);
37 
38 void pbkdf2_sha1(char *, char *, size_t, int, unsigned char *, size_t);
39 
40 void rc4_skip(uint8_t *, size_t, size_t, uint8_t *, size_t);
41 void rc4(uint8_t *, size_t, uint8_t *, size_t);
42 
43 void hmac_md5_vector(uint8_t *, size_t, size_t,
44     uint8_t *[], size_t *, uint8_t *);
45 void hmac_md5(uint8_t *, size_t, uint8_t *, size_t, uint8_t *);
46 
47 #ifdef __cplusplus
48 }
49 #endif
50 
51 #endif /* __WPA_ENC_H */
52