![]() |
|
|||
File indexing completed on 2025-08-03 08:20:46
0001 /* 0002 Copyright (C) 1999 Aladdin Enterprises. All rights reserved. 0003 0004 This software is provided 'as-is', without any express or implied 0005 warranty. In no event will the authors be held liable for any damages 0006 arising from the use of this software. 0007 0008 Permission is granted to anyone to use this software for any purpose, 0009 including commercial applications, and to alter it and redistribute it 0010 freely, subject to the following restrictions: 0011 0012 1. The origin of this software must not be misrepresented; you must not 0013 claim that you wrote the original software. If you use this software 0014 in a product, an acknowledgment in the product documentation would be 0015 appreciated but is not required. 0016 2. Altered source versions must be plainly marked as such, and must not be 0017 misrepresented as being the original software. 0018 3. This notice may not be removed or altered from any source distribution. 0019 0020 L. Peter Deutsch 0021 ghost@aladdin.com 0022 0023 */ 0024 /* 0025 This code implements the MD5 Algorithm defined in RFC 1321. 0026 It is derived directly from the text of the RFC and not from the 0027 reference implementation. 0028 0029 The original and principal author of ansi2knr is L. Peter Deutsch 0030 <ghost@aladdin.com>. Other authors are noted in the change history 0031 that follows (in reverse chronological order): 0032 0033 1999-05-03 lpd Original version. 0034 */ 0035 /*$Id: md5.h,v 1.1.1.1 2000/07/21 01:51:14 purschke Exp $ */ 0036 0037 #ifndef md5_INCLUDED 0038 # define md5_INCLUDED 0039 0040 /* 0041 * This code has some adaptations for the Ghostscript environment, but it 0042 * will compile and run correctly in any environment with 8-bit chars and 0043 * 32-bit ints. Specifically, it assumes that if the following are 0044 * defined, they have the same meaning as in Ghostscript: P1, P2, P3, 0045 * ARCH_IS_BIG_ENDIAN. 0046 */ 0047 0048 typedef unsigned char md5_byte_t; /* 8-bit byte */ 0049 typedef unsigned int md5_word_t; /* 32-bit word */ 0050 0051 /* Define the state of the MD5 Algorithm. */ 0052 typedef struct md5_state_s { 0053 md5_word_t count[2]; /* message length in bits, lsw first */ 0054 md5_word_t abcd[4]; /* digest buffer */ 0055 md5_byte_t buf[64]; /* accumulate block */ 0056 } md5_state_t; 0057 0058 #ifdef __cplusplus 0059 extern "C" 0060 { 0061 #endif 0062 0063 0064 /* Initialize the algorithm. */ 0065 #ifdef P1 0066 void md5_init(P1(md5_state_t *pms)); 0067 #else 0068 void md5_init(md5_state_t *pms); 0069 #endif 0070 0071 /* Append a string to the message. */ 0072 #ifdef P3 0073 void md5_append(P3(md5_state_t *pms, const md5_byte_t *data, int nbytes)); 0074 #else 0075 void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes); 0076 #endif 0077 0078 /* Finish the message and return the digest. */ 0079 #ifdef P2 0080 void md5_finish(P2(md5_state_t *pms, md5_byte_t digest[16])); 0081 #else 0082 void md5_finish(md5_state_t *pms, md5_byte_t digest[16]); 0083 #endif 0084 0085 0086 #ifdef __cplusplus 0087 } /* end extern "C" */ 0088 #endif 0089 0090 #endif /* md5_INCLUDED */ 0091
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |