1
2
3
4
5
6
7
8 #ifndef EYEFI_H
9 #define EYEFI_H
10
11 #include <stddef.h>
12 #include <stdlib.h>
13
14
15
16
17 typedef unsigned int u32;
18 typedef unsigned short u16;
19 typedef unsigned char u8;
20
21
22 #define host_to_be32(n) __builtin_bswap32(n)
23
24 #define os_memset memset
25 #define os_memcpy memcpy
26 #define os_strlen strlen
27 #define os_strcpy strcpy
28
29 #define SHA1_MAC_LEN 20
30 #define MD5_MAC_LEN 16
31 void md5_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac);
32 void hmac_md5_vector(const u8 *key, size_t key_len, size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac);
33 void hmac_md5(const u8 *key, size_t key_len, const u8 *data, size_t data_len, u8 *mac);
34 void pbkdf2_sha1(const char *passphrase, const char *ssid, size_t ssid_len, int iterations, u8 *buf, size_t buflen);
35
36
37 #endif