Eneboo - Documentación para desarrolladores
|
00001 /* 00002 Copyright (C) 2001-2002 by theKompany.com <www.thekompany.com> 00003 This program is free software; you can redistribute it and/or modify 00004 it under the terms of the GNU General Public License as published by 00005 the Free Software Foundation; either version 2 of the License, or 00006 (at your option) any later version. 00007 00008 This program is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 GNU General Public License for more details. 00012 00013 You should have received a copy of the GNU General Public License 00014 along with this program; if not, write to the Free Software 00015 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00016 00017 By PLUGINS we mean the commercial plug-ins developed by theKompany.com 00018 for Aethera. 00019 00020 In addition, as a special exception, theKompany.com gives permission 00021 to link the code of this program with PLUGINS (or with 00022 modified versions of PLUGINS that use the same license as PLUGINS), 00023 and distribute linked combinations including the two. You must obey 00024 the GNU General Public License in all respects for all of the code used 00025 other than PLUGINS. If you modify this file, you may extend this 00026 exception to your version of the file, but you are not obligated to do so. 00027 If you do not wish to do so, delete this exception statement from your 00028 version. 00029 00030 This license grants you the ability to use PLUGINS with Aethera only 00031 and may not be used outside of Aethera. 00032 See also http://www.thekompany.com/products/license.txt for details. 00033 */ 00034 /* 00035 Copyright (C) 1999, 2002 Aladdin Enterprises. All rights reserved. 00036 00037 This software is provided 'as-is', without any express or implied 00038 warranty. In no event will the authors be held liable for any damages 00039 arising from the use of this software. 00040 00041 Permission is granted to anyone to use this software for any purpose, 00042 including commercial applications, and to alter it and redistribute it 00043 freely, subject to the following restrictions: 00044 00045 1. The origin of this software must not be misrepresented; you must not 00046 claim that you wrote the original software. If you use this software 00047 in a product, an acknowledgment in the product documentation would be 00048 appreciated but is not required. 00049 2. Altered source versions must be plainly marked as such, and must not be 00050 misrepresented as being the original software. 00051 3. This notice may not be removed or altered from any source distribution. 00052 00053 L. Peter Deutsch 00054 ghost@aladdin.com 00055 00056 */ 00057 /* $Id: md5.h,v 1.4 2004/10/28 16:19:24 eug Exp $ */ 00058 /* 00059 Independent implementation of MD5 (RFC 1321). 00060 00061 This code implements the MD5 Algorithm defined in RFC 1321, whose 00062 text is available at 00063 http://www.ietf.org/rfc/rfc1321.txt 00064 The code is derived from the text of the RFC, including the test suite 00065 (section A.5) but excluding the rest of Appendix A. It does not include 00066 any code or documentation that is identified in the RFC as being 00067 copyrighted. 00068 00069 The original and principal author of md5.h is L. Peter Deutsch 00070 <ghost@aladdin.com>. Other authors are noted in the change history 00071 that follows (in reverse chronological order): 00072 00073 2002-04-13 lpd Removed support for non-ANSI compilers; removed 00074 references to Ghostscript; clarified derivation from RFC 1321; 00075 now handles byte order either statically or dynamically. 00076 1999-11-04 lpd Edited comments slightly for automatic TOC extraction. 00077 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5); 00078 added conditionalization for C++ compilation from Martin 00079 Purschke <purschke@bnl.gov>. 00080 1999-05-03 lpd Original version. 00081 */ 00082 00083 #ifndef md5_INCLUDED 00084 #define md5_INCLUDED 00085 00086 /* 00087 * This package supports both compile-time and run-time determination of CPU 00088 * byte order. If ARCH_IS_BIG_ENDIAN is defined as 0, the code will be 00089 * compiled to run only on little-endian CPUs; if ARCH_IS_BIG_ENDIAN is 00090 * defined as non-zero, the code will be compiled to run only on big-endian 00091 * CPUs; if ARCH_IS_BIG_ENDIAN is not defined, the code will be compiled to 00092 * run on either big- or little-endian CPUs, but will run slightly less 00093 * efficiently on either one than if ARCH_IS_BIG_ENDIAN is defined. 00094 */ 00095 00096 typedef unsigned char md5_byte_t; /* 8-bit byte */ 00097 typedef unsigned int md5_word_t; /* 32-bit word */ 00098 00099 /* Define the state of the MD5 Algorithm. */ 00100 typedef struct md5_state_s { 00101 md5_word_t count[2]; /* message length in bits, lsw first */ 00102 md5_word_t abcd[4]; /* digest buffer */ 00103 md5_byte_t buf[64]; /* accumulate block */ 00104 } 00105 md5_state_t; 00106 00107 #ifdef __cplusplus 00108 extern "C" 00109 { 00110 #endif 00111 00112 /* Initialize the algorithm. */ 00113 void md5_init(md5_state_t *pms); 00114 00115 /* Append a string to the message. */ 00116 void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes); 00117 00118 /* Finish the message and return the digest. */ 00119 void md5_finish(md5_state_t *pms, md5_byte_t digest[16]); 00120 00121 #ifdef __cplusplus 00122 } /* end extern "C" */ 00123 #endif 00124 00125 #endif /* md5_INCLUDED */