00001 /* 00002 * luau (Lib Update/Auto-Update): Simple Update Library 00003 * Copyright (C) 2003 David Eklund 00004 * 00005 * - This library is free software; you can redistribute it and/or - 00006 * - modify it under the terms of the GNU Lesser General Public - 00007 * - License as published by the Free Software Foundation; either - 00008 * - version 2.1 of the License, or (at your option) any later version. - 00009 * - - 00010 * - This library is distributed in the hope that it will be useful, - 00011 * - but WITHOUT ANY WARRANTY; without even the implied warranty of - 00012 * - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - 00013 * - Lesser General Public License for more details. - 00014 * - - 00015 * - You should have received a copy of the GNU Lesser General Public - 00016 * - License along with this library; if not, write to the Free Software - 00017 * - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - 00018 */ 00019 00026 /* 00027 * md5.h and md5.c are based off of md5hl.c, md5c.c, and md5.h from libmd, which in turn are 00028 * based off the FreeBSD libmd library. Their respective copyright notices follow: 00029 */ 00030 00031 /* 00032 * This code implements the MD5 message-digest algorithm. 00033 * The algorithm is due to Ron Rivest. This code was 00034 * written by Colin Plumb in 1993, no copyright is claimed. 00035 * This code is in the public domain; do with it what you wish. 00036 * 00037 * Equivalent code is available from RSA Data Security, Inc. 00038 * This code has been tested against that, and is equivalent, 00039 * except that you don't need to include two pages of legalese 00040 * with every copy. 00041 */ 00042 00043 /* ---------------------------------------------------------------------------- 00044 * "THE BEER-WARE LICENSE" (Revision 42): 00045 * <phk@login.dkuug.dk> wrote this file. As long as you retain this notice you 00046 * can do whatever you want with this stuff. If we meet some day, and you think 00047 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp 00048 * ---------------------------------------------------------------------------- 00049 * 00050 * $Id: md5.h,v 1.1.1.1 2004/04/02 05:11:38 deklund2 Exp $ 00051 * 00052 */ 00053 00054 #ifndef MD5_H 00055 #define MD5_H 00056 00057 #ifdef HAVE_CONFIG_H 00058 # include <config.h> 00059 #endif 00060 00061 #include <sys/types.h> 00062 00063 #define MD5_HASHBYTES 16 00064 00065 typedef struct MD5Context { 00066 u_int32_t buf[4]; 00067 u_int32_t bits[2]; 00068 unsigned char in[64]; 00069 } MD5_CTX; 00070 00072 char* lutil_md5_file(const char *filename, char *buf); 00074 char* lutil_md5_data(const unsigned char *data, unsigned int len, char *buf); 00075 00076 #endif /* MD5_H */