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 #include <openssl/sha.h> 15 #include <openssl/md5.h> 16 17 #ifdef __cplusplus 18 extern "C" { 19 #endif 20 21 #define SHA1_MAC_LEN SHA_DIGEST_LENGTH 22 #define MD5_MAC_LEN MD5_DIGEST_LENGTH 23 24 void aes_wrap(uint8_t *, int, uint8_t *, uint8_t *); 25 int aes_unwrap(uint8_t *, int, uint8_t *, uint8_t *); 26 27 void hmac_sha1_vector(unsigned char *, unsigned int, 28 size_t, unsigned char *[], unsigned int *, unsigned char *); 29 30 void hmac_sha1(unsigned char *, unsigned int, 31 unsigned char *, unsigned int, unsigned char *); 32 33 void sha1_prf(unsigned char *, unsigned int, 34 char *, unsigned char *, unsigned int, unsigned char *, size_t); 35 36 void pbkdf2_sha1(char *, char *, size_t, int, unsigned char *, size_t); 37 38 void rc4_skip(uint8_t *, size_t, size_t, uint8_t *, size_t); 39 void rc4(uint8_t *, size_t, uint8_t *, size_t); 40 41 void hmac_md5_vector(uint8_t *, size_t, size_t, 42 uint8_t *[], size_t *, uint8_t *); 43 void hmac_md5(uint8_t *, size_t, uint8_t *, size_t, uint8_t *); 44 45 #ifdef __cplusplus 46 } 47 #endif 48 49 #endif /* __WPA_ENC_H */ 50