2 * Copyright (C) 2014 Felix Fietkau <nbd@openwrt.org>
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 * This is an OpenSSL-compatible implementation of the RSA Data Security, Inc.
18 * MD5 Message-Digest Algorithm (RFC 1321).
21 * http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5
24 * Alexander Peslyak, better known as Solar Designer <solar at openwall.com>
26 * This software was written by Alexander Peslyak in 2001. No copyright is
27 * claimed, and the software is hereby placed in the public domain.
28 * In case this attempt to disclaim copyright and place the software in the
29 * public domain is deemed null and void, then the software is
30 * Copyright (c) 2001 Alexander Peslyak and it is hereby released to the
31 * general public under the following terms:
33 * Redistribution and use in source and binary forms, with or without
34 * modification, are permitted.
36 * There's ABSOLUTELY NO WARRANTY, express or implied.
38 * See md5.c for more information.
41 #ifndef _LIBUBOX_MD5_H
42 #define _LIBUBOX_MD5_H
47 typedef struct md5_ctx {
50 unsigned char buffer[64];
53 extern void md5_begin(md5_ctx_t *ctx);
54 extern void md5_hash(const void *data, size_t length, md5_ctx_t *ctx);
55 extern void md5_end(void *resbuf, md5_ctx_t *ctx);
56 int md5sum(char *file, void *md5_buf);