Mercurial > hg > freeDiameter
annotate extensions/app_sip/md5.h @ 972:ce3cacbbccc9
Fix some typos.
author | Thomas Klausner <tk@giga.or.at> |
---|---|
date | Thu, 14 Mar 2013 17:31:00 +0100 |
parents | 1740bee6c821 |
children |
rev | line source |
---|---|
360
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
1 /*********************************************************************************/ |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
2 /* freeDiameter author note: |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
3 * The content from this file comes directly from the hostap project. |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
4 * It is redistributed under the terms of the BSD license, as allowed |
972 | 5 * by the original copyright reproduced below. |
360
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
6 * The file has not been modified, except for this notice. |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
7 */ |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
8 /*********************************************************************************/ |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
9 |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
10 /* |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
11 * MD5 hash implementation and interface functions |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
12 * Copyright (c) 2003-2005, Jouni Malinen <j@w1.fi> |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
13 * |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
14 * This program is free software; you can redistribute it and/or modify |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
15 * it under the terms of the GNU General Public License version 2 as |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
16 * published by the Free Software Foundation. |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
17 * |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
18 * Alternatively, this software may be distributed under the terms of BSD |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
19 * license. |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
20 * |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
21 * See README and COPYING for more details. |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
22 */ |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
23 |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
24 #ifndef MD5_H |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
25 #define MD5_H |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
26 |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
27 #define MD5_MAC_LEN 16 |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
28 |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
29 typedef uint64_t u64; |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
30 typedef uint32_t u32; |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
31 typedef uint16_t u16; |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
32 typedef uint8_t u8; |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
33 typedef int64_t s64; |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
34 typedef int32_t s32; |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
35 typedef int16_t s16; |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
36 typedef int8_t s8; |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
37 |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
38 #define HASHLEN 16 |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
39 typedef char HASH[HASHLEN]; |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
40 #define HASHHEXLEN 32 |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
41 typedef char HASHHEX[HASHHEXLEN+1]; |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
42 #define IN |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
43 #define OUT |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
44 |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
45 struct MD5Context { |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
46 u32 buf[4]; |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
47 u32 bits[2]; |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
48 u8 in[64]; |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
49 }; |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
50 typedef struct MD5Context MD5_CTX; |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
51 #define os_memcpy(d, s, n) memcpy((d), (s), (n)) |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
52 #define os_memset(s, c, n) memset(s, c, n) |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
53 |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
54 |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
55 void MD5Init(struct MD5Context *ctx); |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
56 void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len); |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
57 void MD5Final(unsigned char digest[16], struct MD5Context *ctx); |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
58 |
1740bee6c821
Initial App_SIP import
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
diff
changeset
|
59 #endif /* MD5_H */ |