Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:24:14

0001 /*
0002  ***********************************************************************
0003  ** md5.h -- header file for implementation of MD5                    **
0004  ** RSA Data Security, Inc. MD5 Message-Digest Algorithm              **
0005  ** Created: 2/17/90 RLR                                              **
0006  ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version               **
0007  ** Revised (for MD5): RLR 4/27/91                                    **
0008  **   -- G modified to have y&~z instead of y&z                       **
0009  **   -- FF, GG, HH modified to add in last register done             **
0010  **   -- Access pattern: round 2 works mod 5, round 3 works mod 3     **
0011  **   -- distinct additive constant for each step                     **
0012  **   -- round 4 added, working mod 7                                 **
0013  ***********************************************************************
0014  */
0015 
0016 /*
0017  ***********************************************************************
0018  ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved.  **
0019  **                                                                   **
0020  ** License to copy and use this software is granted provided that    **
0021  ** it is identified as the "RSA Data Security, Inc. MD5 Message-     **
0022  ** Digest Algorithm" in all material mentioning or referencing this  **
0023  ** software or this function.                                        **
0024  **                                                                   **
0025  ** License is also granted to make and use derivative works          **
0026  ** provided that such works are identified as "derived from the RSA  **
0027  ** Data Security, Inc. MD5 Message-Digest Algorithm" in all          **
0028  ** material mentioning or referencing the derived work.              **
0029  **                                                                   **
0030  ** RSA Data Security, Inc. makes no representations concerning       **
0031  ** either the merchantability of this software or the suitability    **
0032  ** of this software for any particular purpose.  It is provided "as  **
0033  ** is" without express or implied warranty of any kind.              **
0034  **                                                                   **
0035  ** These notices must be retained in any copies of any part of this  **
0036  ** documentation and/or software.                                    **
0037  ***********************************************************************
0038  */
0039 
0040 #ifndef __MD5_INCLUDE__
0041 
0042 #include <stdint.h>
0043 
0044 #ifdef __cplusplus
0045 extern "C" {
0046 #endif /* __cplusplus */
0047 
0048 /* typedef a 32-bit type */
0049 typedef uint32_t UINT4;
0050 
0051 #define MD5_BLOCK_LENGTH        64
0052 #define MD5_DIGEST_LENGTH       16
0053 
0054 /* Data structure for MD5 (Message-Digest) computation */
0055 typedef struct {
0056   UINT4 i[2];                   /* number of _bits_ handled mod 2^64 */
0057   UINT4 buf[4];                                    /* scratch buffer */
0058   unsigned char in[64];                              /* input buffer */
0059   unsigned char digest[16];     /* actual digest after MD5Final call */
0060 } MD5_CTX;
0061 
0062 void MD5Init (MD5_CTX *);
0063 void MD5Update (MD5_CTX *, const void *, unsigned int);
0064 void MD5Final (unsigned char [16], MD5_CTX *);
0065 
0066 #ifdef __cplusplus
0067 }
0068 #endif /* __cplusplus */
0069 
0070 #define __MD5_INCLUDE__
0071 #endif /* __MD5_INCLUDE__ */