Brian Waters | 13d9601 | 2017-12-08 16:53:31 -0600 | [diff] [blame] | 1 | /*********************************************************************************/ |
| 2 | /* freeDiameter author note: |
| 3 | * The content from this file comes directly from the hostap project. |
| 4 | * It is redistributed under the terms of the BSD license, as allowed |
| 5 | * by the original copyright reproduced below. |
| 6 | */ |
| 7 | |
| 8 | /*********************************************************************************/ |
| 9 | |
| 10 | /* |
| 11 | * MD5 hash implementation and interface functions |
| 12 | * Copyright (c) 2003-2005, Jouni Malinen <j@w1.fi> |
| 13 | * |
| 14 | * This program is free software; you can redistribute it and/or modify |
| 15 | * it under the terms of the GNU General Public License version 2 as |
| 16 | * published by the Free Software Foundation. |
| 17 | * |
| 18 | * Alternatively, this software may be distributed under the terms of BSD |
| 19 | * license. |
| 20 | * |
| 21 | * See README and COPYING for more details. |
| 22 | */ |
| 23 | |
| 24 | #ifndef MD5_H |
| 25 | #define MD5_H |
| 26 | |
| 27 | #define MD5_MAC_LEN 16 |
| 28 | |
| 29 | void hmac_md5_vector(const u8 *key, size_t key_len, size_t num_elem, |
| 30 | const u8 *addr[], const size_t *len, u8 *mac); |
| 31 | void hmac_md5(const u8 *key, size_t key_len, const u8 *data, size_t data_len, |
| 32 | u8 *mac); |
| 33 | |
| 34 | #ifdef CONFIG_CRYPTO_INTERNAL |
| 35 | struct MD5Context; |
| 36 | |
| 37 | void MD5Init(struct MD5Context *context); |
| 38 | void MD5Update(struct MD5Context *context, unsigned char const *buf, |
| 39 | unsigned len); |
| 40 | void MD5Final(unsigned char digest[16], struct MD5Context *context); |
| 41 | #endif /* CONFIG_CRYPTO_INTERNAL */ |
| 42 | |
| 43 | /* Forward declaration: */ |
| 44 | void md5_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac); |
| 45 | |
| 46 | #endif /* MD5_H */ |