<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://gunkies.org/index.php?action=history&amp;feed=atom&amp;title=Md5.c</id>
		<title>Md5.c - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://gunkies.org/index.php?action=history&amp;feed=atom&amp;title=Md5.c"/>
		<link rel="alternate" type="text/html" href="https://gunkies.org/w/index.php?title=Md5.c&amp;action=history"/>
		<updated>2026-04-06T01:06:38Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.30.1</generator>

	<entry>
		<id>https://gunkies.org/w/index.php?title=Md5.c&amp;diff=20013&amp;oldid=prev</id>
		<title>Jnc: +cat</title>
		<link rel="alternate" type="text/html" href="https://gunkies.org/w/index.php?title=Md5.c&amp;diff=20013&amp;oldid=prev"/>
				<updated>2018-12-17T02:05:28Z</updated>
		
		<summary type="html">&lt;p&gt;+cat&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 02:05, 17 December 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l540&quot; &gt;Line 540:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 540:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; */&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; */&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category: Application Software]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key mediawiki-wiki_:diff:version:1.11a:oldid:11419:newid:20013 --&gt;
&lt;/table&gt;</summary>
		<author><name>Jnc</name></author>	</entry>

	<entry>
		<id>https://gunkies.org/w/index.php?title=Md5.c&amp;diff=11419&amp;oldid=prev</id>
		<title>Neozeed: lame initial version</title>
		<link rel="alternate" type="text/html" href="https://gunkies.org/w/index.php?title=Md5.c&amp;diff=11419&amp;oldid=prev"/>
				<updated>2016-01-31T04:20:43Z</updated>
		
		<summary type="html">&lt;p&gt;lame initial version&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;this is a simple md5 checksum program I found online.  I've been able to compile it on AmigaDOS, MS-DOS and Win32 environments.&lt;br /&gt;
&lt;br /&gt;
== source ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 **********************************************************************&lt;br /&gt;
 ** md5.h -- Header file for implementation of MD5                   **&lt;br /&gt;
 ** RSA Data Security, Inc. MD5 Message Digest Algorithm             **&lt;br /&gt;
 ** Created: 2/17/90 RLR                                             **&lt;br /&gt;
 ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version              **&lt;br /&gt;
 ** Revised (for MD5): RLR 4/27/91                                   **&lt;br /&gt;
 **   -- G modified to have y&amp;amp;~z instead of y&amp;amp;z                      **&lt;br /&gt;
 **   -- FF, GG, HH modified to add in last register done            **&lt;br /&gt;
 **   -- Access pattern: round 2 works mod 5, round 3 works mod 3    **&lt;br /&gt;
 **   -- distinct additive constant for each step                    **&lt;br /&gt;
 **   -- round 4 added, working mod 7                                **&lt;br /&gt;
 **********************************************************************&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 **********************************************************************&lt;br /&gt;
 ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. **&lt;br /&gt;
 **                                                                  **&lt;br /&gt;
 ** License to copy and use this software is granted provided that   **&lt;br /&gt;
 ** it is identified as the &amp;quot;RSA Data Security, Inc. MD5 Message     **&lt;br /&gt;
 ** Digest Algorithm&amp;quot; in all material mentioning or referencing this **&lt;br /&gt;
 ** software or this function.                                       **&lt;br /&gt;
 **                                                                  **&lt;br /&gt;
 ** License is also granted to make and use derivative works         **&lt;br /&gt;
 ** provided that such works are identified as &amp;quot;derived from the RSA **&lt;br /&gt;
 ** Data Security, Inc. MD5 Message Digest Algorithm&amp;quot; in all         **&lt;br /&gt;
 ** material mentioning or referencing the derived work.             **&lt;br /&gt;
 **                                                                  **&lt;br /&gt;
 ** RSA Data Security, Inc. makes no representations concerning      **&lt;br /&gt;
 ** either the merchantability of this software or the suitability   **&lt;br /&gt;
 ** of this software for any particular purpose.  It is provided &amp;quot;as **&lt;br /&gt;
 ** is&amp;quot; without express or implied warranty of any kind.             **&lt;br /&gt;
 **                                                                  **&lt;br /&gt;
 ** These notices must be retained in any copies of any part of this **&lt;br /&gt;
 ** documentation and/or software.                                   **&lt;br /&gt;
 **********************************************************************&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* typedef a 32 bit type */&lt;br /&gt;
typedef unsigned long int UINT4;&lt;br /&gt;
&lt;br /&gt;
/* Data structure for MD5 (Message Digest) computation */&lt;br /&gt;
typedef struct {&lt;br /&gt;
  UINT4 i[2];                   /* number of _bits_ handled mod 2^64 */&lt;br /&gt;
  UINT4 buf[4];                                    /* scratch buffer */&lt;br /&gt;
  unsigned char in[64];                              /* input buffer */&lt;br /&gt;
  unsigned char digest[16];     /* actual digest after MD5Final call */&lt;br /&gt;
} MD5_CTX;&lt;br /&gt;
&lt;br /&gt;
void MD5Init ();&lt;br /&gt;
void MD5Update ();&lt;br /&gt;
void MD5Final ();&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 **********************************************************************&lt;br /&gt;
 ** End of md5.h                                                     **&lt;br /&gt;
 ******************************* (cut) ********************************&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 **********************************************************************&lt;br /&gt;
 ** md5.c                                                            **&lt;br /&gt;
 ** RSA Data Security, Inc. MD5 Message Digest Algorithm             **&lt;br /&gt;
 ** Created: 2/17/90 RLR                                             **&lt;br /&gt;
 ** Revised: 1/91 SRD,AJ,BSK,JT Reference C Version                  **&lt;br /&gt;
 **********************************************************************&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 **********************************************************************&lt;br /&gt;
 ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. **&lt;br /&gt;
 **                                                                  **&lt;br /&gt;
 ** License to copy and use this software is granted provided that   **&lt;br /&gt;
 ** it is identified as the &amp;quot;RSA Data Security, Inc. MD5 Message     **&lt;br /&gt;
 ** Digest Algorithm&amp;quot; in all material mentioning or referencing this **&lt;br /&gt;
 ** software or this function.                                       **&lt;br /&gt;
 **                                                                  **&lt;br /&gt;
 ** License is also granted to make and use derivative works         **&lt;br /&gt;
 ** provided that such works are identified as &amp;quot;derived from the RSA **&lt;br /&gt;
 ** Data Security, Inc. MD5 Message Digest Algorithm&amp;quot; in all         **&lt;br /&gt;
 ** material mentioning or referencing the derived work.             **&lt;br /&gt;
 **                                                                  **&lt;br /&gt;
 ** RSA Data Security, Inc. makes no representations concerning      **&lt;br /&gt;
 ** either the merchantability of this software or the suitability   **&lt;br /&gt;
 ** of this software for any particular purpose.  It is provided &amp;quot;as **&lt;br /&gt;
 ** is&amp;quot; without express or implied warranty of any kind.             **&lt;br /&gt;
 **                                                                  **&lt;br /&gt;
 ** These notices must be retained in any copies of any part of this **&lt;br /&gt;
 ** documentation and/or software.                                   **&lt;br /&gt;
 **********************************************************************&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* -- include the following line if the md5.h header file is separate -- */&lt;br /&gt;
/* #include &amp;quot;md5.h&amp;quot; */&lt;br /&gt;
&lt;br /&gt;
/* forward declaration */&lt;br /&gt;
static void Transform ();&lt;br /&gt;
&lt;br /&gt;
static unsigned char PADDING[64] = {&lt;br /&gt;
  0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,&lt;br /&gt;
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,&lt;br /&gt;
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,&lt;br /&gt;
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,&lt;br /&gt;
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,&lt;br /&gt;
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,&lt;br /&gt;
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,&lt;br /&gt;
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
/* F, G and H are basic MD5 functions: selection, majority, parity */&lt;br /&gt;
#define F(x, y, z) (((x) &amp;amp; (y)) | ((~x) &amp;amp; (z)))&lt;br /&gt;
#define G(x, y, z) (((x) &amp;amp; (z)) | ((y) &amp;amp; (~z)))&lt;br /&gt;
#define H(x, y, z) ((x) ^ (y) ^ (z))&lt;br /&gt;
#define I(x, y, z) ((y) ^ ((x) | (~z))) &lt;br /&gt;
&lt;br /&gt;
/* ROTATE_LEFT rotates x left n bits */&lt;br /&gt;
#define ROTATE_LEFT(x, n) (((x) &amp;lt;&amp;lt; (n)) | ((x) &amp;gt;&amp;gt; (32-(n))))&lt;br /&gt;
&lt;br /&gt;
/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4 */&lt;br /&gt;
/* Rotation is separate from addition to prevent recomputation */&lt;br /&gt;
#define FF(a, b, c, d, x, s, ac) \&lt;br /&gt;
  {(a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \&lt;br /&gt;
   (a) = ROTATE_LEFT ((a), (s)); \&lt;br /&gt;
   (a) += (b); \&lt;br /&gt;
  }&lt;br /&gt;
#define GG(a, b, c, d, x, s, ac) \&lt;br /&gt;
  {(a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \&lt;br /&gt;
   (a) = ROTATE_LEFT ((a), (s)); \&lt;br /&gt;
   (a) += (b); \&lt;br /&gt;
  }&lt;br /&gt;
#define HH(a, b, c, d, x, s, ac) \&lt;br /&gt;
  {(a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \&lt;br /&gt;
   (a) = ROTATE_LEFT ((a), (s)); \&lt;br /&gt;
   (a) += (b); \&lt;br /&gt;
  }&lt;br /&gt;
#define II(a, b, c, d, x, s, ac) \&lt;br /&gt;
  {(a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \&lt;br /&gt;
   (a) = ROTATE_LEFT ((a), (s)); \&lt;br /&gt;
   (a) += (b); \&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
void MD5Init (mdContext)&lt;br /&gt;
MD5_CTX *mdContext;&lt;br /&gt;
{&lt;br /&gt;
  mdContext-&amp;gt;i[0] = mdContext-&amp;gt;i[1] = (UINT4)0;&lt;br /&gt;
&lt;br /&gt;
  /* Load magic initialization constants.&lt;br /&gt;
   */&lt;br /&gt;
  mdContext-&amp;gt;buf[0] = (UINT4)0x67452301;&lt;br /&gt;
  mdContext-&amp;gt;buf[1] = (UINT4)0xefcdab89;&lt;br /&gt;
  mdContext-&amp;gt;buf[2] = (UINT4)0x98badcfe;&lt;br /&gt;
  mdContext-&amp;gt;buf[3] = (UINT4)0x10325476;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void MD5Update (mdContext, inBuf, inLen)&lt;br /&gt;
MD5_CTX *mdContext;&lt;br /&gt;
unsigned char *inBuf;&lt;br /&gt;
unsigned int inLen;&lt;br /&gt;
{&lt;br /&gt;
  UINT4 in[16];&lt;br /&gt;
  int mdi;&lt;br /&gt;
  unsigned int i, ii;&lt;br /&gt;
&lt;br /&gt;
  /* compute number of bytes mod 64 */&lt;br /&gt;
  mdi = (int)((mdContext-&amp;gt;i[0] &amp;gt;&amp;gt; 3) &amp;amp; 0x3F);&lt;br /&gt;
&lt;br /&gt;
  /* update number of bits */&lt;br /&gt;
  if ((mdContext-&amp;gt;i[0] + ((UINT4)inLen &amp;lt;&amp;lt; 3)) &amp;lt; mdContext-&amp;gt;i[0])&lt;br /&gt;
    mdContext-&amp;gt;i[1]++;&lt;br /&gt;
  mdContext-&amp;gt;i[0] += ((UINT4)inLen &amp;lt;&amp;lt; 3);&lt;br /&gt;
  mdContext-&amp;gt;i[1] += ((UINT4)inLen &amp;gt;&amp;gt; 29);&lt;br /&gt;
&lt;br /&gt;
  while (inLen--) {&lt;br /&gt;
    /* add new character to buffer, increment mdi */&lt;br /&gt;
    mdContext-&amp;gt;in[mdi++] = *inBuf++;&lt;br /&gt;
&lt;br /&gt;
    /* transform if necessary */&lt;br /&gt;
    if (mdi == 0x40) {&lt;br /&gt;
      for (i = 0, ii = 0; i &amp;lt; 16; i++, ii += 4)&lt;br /&gt;
        in[i] = (((UINT4)mdContext-&amp;gt;in[ii+3]) &amp;lt;&amp;lt; 24) |&lt;br /&gt;
                (((UINT4)mdContext-&amp;gt;in[ii+2]) &amp;lt;&amp;lt; 16) |&lt;br /&gt;
                (((UINT4)mdContext-&amp;gt;in[ii+1]) &amp;lt;&amp;lt; 8) |&lt;br /&gt;
                ((UINT4)mdContext-&amp;gt;in[ii]);&lt;br /&gt;
      Transform (mdContext-&amp;gt;buf, in);&lt;br /&gt;
      mdi = 0;&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void MD5Final (mdContext)&lt;br /&gt;
MD5_CTX *mdContext;&lt;br /&gt;
{&lt;br /&gt;
  UINT4 in[16];&lt;br /&gt;
  int mdi;&lt;br /&gt;
  unsigned int i, ii;&lt;br /&gt;
  unsigned int padLen;&lt;br /&gt;
&lt;br /&gt;
  /* save number of bits */&lt;br /&gt;
  in[14] = mdContext-&amp;gt;i[0];&lt;br /&gt;
  in[15] = mdContext-&amp;gt;i[1];&lt;br /&gt;
&lt;br /&gt;
  /* compute number of bytes mod 64 */&lt;br /&gt;
  mdi = (int)((mdContext-&amp;gt;i[0] &amp;gt;&amp;gt; 3) &amp;amp; 0x3F);&lt;br /&gt;
&lt;br /&gt;
  /* pad out to 56 mod 64 */&lt;br /&gt;
  padLen = (mdi &amp;lt; 56) ? (56 - mdi) : (120 - mdi);&lt;br /&gt;
  MD5Update (mdContext, PADDING, padLen);&lt;br /&gt;
&lt;br /&gt;
  /* append length in bits and transform */&lt;br /&gt;
  for (i = 0, ii = 0; i &amp;lt; 14; i++, ii += 4)&lt;br /&gt;
    in[i] = (((UINT4)mdContext-&amp;gt;in[ii+3]) &amp;lt;&amp;lt; 24) |&lt;br /&gt;
            (((UINT4)mdContext-&amp;gt;in[ii+2]) &amp;lt;&amp;lt; 16) |&lt;br /&gt;
            (((UINT4)mdContext-&amp;gt;in[ii+1]) &amp;lt;&amp;lt; 8) |&lt;br /&gt;
            ((UINT4)mdContext-&amp;gt;in[ii]);&lt;br /&gt;
  Transform (mdContext-&amp;gt;buf, in);&lt;br /&gt;
&lt;br /&gt;
  /* store buffer in digest */&lt;br /&gt;
  for (i = 0, ii = 0; i &amp;lt; 4; i++, ii += 4) {&lt;br /&gt;
    mdContext-&amp;gt;digest[ii] = (unsigned char)(mdContext-&amp;gt;buf[i] &amp;amp; 0xFF);&lt;br /&gt;
    mdContext-&amp;gt;digest[ii+1] =&lt;br /&gt;
      (unsigned char)((mdContext-&amp;gt;buf[i] &amp;gt;&amp;gt; 8) &amp;amp; 0xFF);&lt;br /&gt;
    mdContext-&amp;gt;digest[ii+2] =&lt;br /&gt;
      (unsigned char)((mdContext-&amp;gt;buf[i] &amp;gt;&amp;gt; 16) &amp;amp; 0xFF);&lt;br /&gt;
    mdContext-&amp;gt;digest[ii+3] =&lt;br /&gt;
      (unsigned char)((mdContext-&amp;gt;buf[i] &amp;gt;&amp;gt; 24) &amp;amp; 0xFF);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Basic MD5 step. Transform buf based on in.&lt;br /&gt;
 */&lt;br /&gt;
static void Transform (buf, in)&lt;br /&gt;
UINT4 *buf;&lt;br /&gt;
UINT4 *in;&lt;br /&gt;
{&lt;br /&gt;
  UINT4 a = buf[0], b = buf[1], c = buf[2], d = buf[3];&lt;br /&gt;
&lt;br /&gt;
  /* Round 1 */&lt;br /&gt;
#define S11 7&lt;br /&gt;
#define S12 12&lt;br /&gt;
#define S13 17&lt;br /&gt;
#define S14 22&lt;br /&gt;
  FF ( a, b, c, d, in[ 0], S11, 3614090360); /* 1 */&lt;br /&gt;
  FF ( d, a, b, c, in[ 1], S12, 3905402710); /* 2 */&lt;br /&gt;
  FF ( c, d, a, b, in[ 2], S13,  606105819); /* 3 */&lt;br /&gt;
  FF ( b, c, d, a, in[ 3], S14, 3250441966); /* 4 */&lt;br /&gt;
  FF ( a, b, c, d, in[ 4], S11, 4118548399); /* 5 */&lt;br /&gt;
  FF ( d, a, b, c, in[ 5], S12, 1200080426); /* 6 */&lt;br /&gt;
  FF ( c, d, a, b, in[ 6], S13, 2821735955); /* 7 */&lt;br /&gt;
  FF ( b, c, d, a, in[ 7], S14, 4249261313); /* 8 */&lt;br /&gt;
  FF ( a, b, c, d, in[ 8], S11, 1770035416); /* 9 */&lt;br /&gt;
  FF ( d, a, b, c, in[ 9], S12, 2336552879); /* 10 */&lt;br /&gt;
  FF ( c, d, a, b, in[10], S13, 4294925233); /* 11 */&lt;br /&gt;
  FF ( b, c, d, a, in[11], S14, 2304563134); /* 12 */&lt;br /&gt;
  FF ( a, b, c, d, in[12], S11, 1804603682); /* 13 */&lt;br /&gt;
  FF ( d, a, b, c, in[13], S12, 4254626195); /* 14 */&lt;br /&gt;
  FF ( c, d, a, b, in[14], S13, 2792965006); /* 15 */&lt;br /&gt;
  FF ( b, c, d, a, in[15], S14, 1236535329); /* 16 */&lt;br /&gt;
&lt;br /&gt;
  /* Round 2 */&lt;br /&gt;
#define S21 5&lt;br /&gt;
#define S22 9&lt;br /&gt;
#define S23 14&lt;br /&gt;
#define S24 20&lt;br /&gt;
  GG ( a, b, c, d, in[ 1], S21, 4129170786); /* 17 */&lt;br /&gt;
  GG ( d, a, b, c, in[ 6], S22, 3225465664); /* 18 */&lt;br /&gt;
  GG ( c, d, a, b, in[11], S23,  643717713); /* 19 */&lt;br /&gt;
  GG ( b, c, d, a, in[ 0], S24, 3921069994); /* 20 */&lt;br /&gt;
  GG ( a, b, c, d, in[ 5], S21, 3593408605); /* 21 */&lt;br /&gt;
  GG ( d, a, b, c, in[10], S22,   38016083); /* 22 */&lt;br /&gt;
  GG ( c, d, a, b, in[15], S23, 3634488961); /* 23 */&lt;br /&gt;
  GG ( b, c, d, a, in[ 4], S24, 3889429448); /* 24 */&lt;br /&gt;
  GG ( a, b, c, d, in[ 9], S21,  568446438); /* 25 */&lt;br /&gt;
  GG ( d, a, b, c, in[14], S22, 3275163606); /* 26 */&lt;br /&gt;
  GG ( c, d, a, b, in[ 3], S23, 4107603335); /* 27 */&lt;br /&gt;
  GG ( b, c, d, a, in[ 8], S24, 1163531501); /* 28 */&lt;br /&gt;
  GG ( a, b, c, d, in[13], S21, 2850285829); /* 29 */&lt;br /&gt;
  GG ( d, a, b, c, in[ 2], S22, 4243563512); /* 30 */&lt;br /&gt;
  GG ( c, d, a, b, in[ 7], S23, 1735328473); /* 31 */&lt;br /&gt;
  GG ( b, c, d, a, in[12], S24, 2368359562); /* 32 */&lt;br /&gt;
&lt;br /&gt;
  /* Round 3 */&lt;br /&gt;
#define S31 4&lt;br /&gt;
#define S32 11&lt;br /&gt;
#define S33 16&lt;br /&gt;
#define S34 23&lt;br /&gt;
  HH ( a, b, c, d, in[ 5], S31, 4294588738); /* 33 */&lt;br /&gt;
  HH ( d, a, b, c, in[ 8], S32, 2272392833); /* 34 */&lt;br /&gt;
  HH ( c, d, a, b, in[11], S33, 1839030562); /* 35 */&lt;br /&gt;
  HH ( b, c, d, a, in[14], S34, 4259657740); /* 36 */&lt;br /&gt;
  HH ( a, b, c, d, in[ 1], S31, 2763975236); /* 37 */&lt;br /&gt;
  HH ( d, a, b, c, in[ 4], S32, 1272893353); /* 38 */&lt;br /&gt;
  HH ( c, d, a, b, in[ 7], S33, 4139469664); /* 39 */&lt;br /&gt;
  HH ( b, c, d, a, in[10], S34, 3200236656); /* 40 */&lt;br /&gt;
  HH ( a, b, c, d, in[13], S31,  681279174); /* 41 */&lt;br /&gt;
  HH ( d, a, b, c, in[ 0], S32, 3936430074); /* 42 */&lt;br /&gt;
  HH ( c, d, a, b, in[ 3], S33, 3572445317); /* 43 */&lt;br /&gt;
  HH ( b, c, d, a, in[ 6], S34,   76029189); /* 44 */&lt;br /&gt;
  HH ( a, b, c, d, in[ 9], S31, 3654602809); /* 45 */&lt;br /&gt;
  HH ( d, a, b, c, in[12], S32, 3873151461); /* 46 */&lt;br /&gt;
  HH ( c, d, a, b, in[15], S33,  530742520); /* 47 */&lt;br /&gt;
  HH ( b, c, d, a, in[ 2], S34, 3299628645); /* 48 */&lt;br /&gt;
&lt;br /&gt;
  /* Round 4 */&lt;br /&gt;
#define S41 6&lt;br /&gt;
#define S42 10&lt;br /&gt;
#define S43 15&lt;br /&gt;
#define S44 21&lt;br /&gt;
  II ( a, b, c, d, in[ 0], S41, 4096336452); /* 49 */&lt;br /&gt;
  II ( d, a, b, c, in[ 7], S42, 1126891415); /* 50 */&lt;br /&gt;
  II ( c, d, a, b, in[14], S43, 2878612391); /* 51 */&lt;br /&gt;
  II ( b, c, d, a, in[ 5], S44, 4237533241); /* 52 */&lt;br /&gt;
  II ( a, b, c, d, in[12], S41, 1700485571); /* 53 */&lt;br /&gt;
  II ( d, a, b, c, in[ 3], S42, 2399980690); /* 54 */&lt;br /&gt;
  II ( c, d, a, b, in[10], S43, 4293915773); /* 55 */&lt;br /&gt;
  II ( b, c, d, a, in[ 1], S44, 2240044497); /* 56 */&lt;br /&gt;
  II ( a, b, c, d, in[ 8], S41, 1873313359); /* 57 */&lt;br /&gt;
  II ( d, a, b, c, in[15], S42, 4264355552); /* 58 */&lt;br /&gt;
  II ( c, d, a, b, in[ 6], S43, 2734768916); /* 59 */&lt;br /&gt;
  II ( b, c, d, a, in[13], S44, 1309151649); /* 60 */&lt;br /&gt;
  II ( a, b, c, d, in[ 4], S41, 4149444226); /* 61 */&lt;br /&gt;
  II ( d, a, b, c, in[11], S42, 3174756917); /* 62 */&lt;br /&gt;
  II ( c, d, a, b, in[ 2], S43,  718787259); /* 63 */&lt;br /&gt;
  II ( b, c, d, a, in[ 9], S44, 3951481745); /* 64 */&lt;br /&gt;
&lt;br /&gt;
  buf[0] += a;&lt;br /&gt;
  buf[1] += b;&lt;br /&gt;
  buf[2] += c;&lt;br /&gt;
  buf[3] += d;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 **********************************************************************&lt;br /&gt;
 ** End of md5.c                                                     **&lt;br /&gt;
 ******************************* (cut) ********************************&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 **********************************************************************&lt;br /&gt;
 ** md5driver.c -- sample routines to test                           **&lt;br /&gt;
 ** RSA Data Security, Inc. MD5 message digest algorithm.            **&lt;br /&gt;
 ** Created: 2/16/90 RLR                                             **&lt;br /&gt;
 ** Updated: 1/91 SRD                                                **&lt;br /&gt;
 **********************************************************************&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 **********************************************************************&lt;br /&gt;
 ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. **&lt;br /&gt;
 **                                                                  **&lt;br /&gt;
 ** RSA Data Security, Inc. makes no representations concerning      **&lt;br /&gt;
 ** either the merchantability of this software or the suitability   **&lt;br /&gt;
 ** of this software for any particular purpose.  It is provided &amp;quot;as **&lt;br /&gt;
 ** is&amp;quot; without express or implied warranty of any kind.             **&lt;br /&gt;
 **                                                                  **&lt;br /&gt;
 ** These notices must be retained in any copies of any part of this **&lt;br /&gt;
 ** documentation and/or software.                                   **&lt;br /&gt;
 **********************************************************************&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
#include &amp;lt;time.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
/* -- include the following file if the file md5.h is separate -- */&lt;br /&gt;
/* #include &amp;quot;md5.h&amp;quot; */&lt;br /&gt;
&lt;br /&gt;
/* Prints message digest buffer in mdContext as 32 hexadecimal digits.&lt;br /&gt;
   Order is from low-order byte to high-order byte of digest.&lt;br /&gt;
   Each byte is printed with high-order hexadecimal digit first.&lt;br /&gt;
 */&lt;br /&gt;
static void MDPrint (mdContext)&lt;br /&gt;
MD5_CTX *mdContext;&lt;br /&gt;
{&lt;br /&gt;
  int i;&lt;br /&gt;
&lt;br /&gt;
  for (i = 0; i &amp;lt; 16; i++)&lt;br /&gt;
    printf (&amp;quot;%02x&amp;quot;, mdContext-&amp;gt;digest[i]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* size of test block */&lt;br /&gt;
#define TEST_BLOCK_SIZE 1000&lt;br /&gt;
&lt;br /&gt;
/* number of blocks to process */&lt;br /&gt;
#define TEST_BLOCKS 10000&lt;br /&gt;
&lt;br /&gt;
/* number of test bytes = TEST_BLOCK_SIZE * TEST_BLOCKS */&lt;br /&gt;
static long TEST_BYTES = (long)TEST_BLOCK_SIZE * (long)TEST_BLOCKS;&lt;br /&gt;
&lt;br /&gt;
/* A time trial routine, to measure the speed of MD5.&lt;br /&gt;
   Measures wall time required to digest TEST_BLOCKS * TEST_BLOCK_SIZE&lt;br /&gt;
   characters.&lt;br /&gt;
 */&lt;br /&gt;
static void MDTimeTrial ()&lt;br /&gt;
{&lt;br /&gt;
  MD5_CTX mdContext;&lt;br /&gt;
  time_t endTime, startTime;&lt;br /&gt;
  unsigned char data[TEST_BLOCK_SIZE];&lt;br /&gt;
  unsigned int i;&lt;br /&gt;
&lt;br /&gt;
  /* initialize test data */&lt;br /&gt;
  for (i = 0; i &amp;lt; TEST_BLOCK_SIZE; i++)&lt;br /&gt;
    data[i] = (unsigned char)(i &amp;amp; 0xFF);&lt;br /&gt;
&lt;br /&gt;
  /* start timer */&lt;br /&gt;
  printf (&amp;quot;MD5 time trial. Processing %ld characters...\n&amp;quot;, TEST_BYTES);&lt;br /&gt;
  time (&amp;amp;startTime);&lt;br /&gt;
&lt;br /&gt;
  /* digest data in TEST_BLOCK_SIZE byte blocks */&lt;br /&gt;
  MD5Init (&amp;amp;mdContext);&lt;br /&gt;
  for (i = TEST_BLOCKS; i &amp;gt; 0; i--)&lt;br /&gt;
    MD5Update (&amp;amp;mdContext, data, TEST_BLOCK_SIZE);&lt;br /&gt;
  MD5Final (&amp;amp;mdContext);&lt;br /&gt;
&lt;br /&gt;
  /* stop timer, get time difference */&lt;br /&gt;
  time (&amp;amp;endTime);&lt;br /&gt;
  MDPrint (&amp;amp;mdContext);&lt;br /&gt;
  printf (&amp;quot; is digest of test input.\n&amp;quot;);&lt;br /&gt;
  printf&lt;br /&gt;
    (&amp;quot;Seconds to process test input: %ld\n&amp;quot;, (long)(endTime-startTime));&lt;br /&gt;
  printf&lt;br /&gt;
    (&amp;quot;Characters processed per second: %ld\n&amp;quot;,&lt;br /&gt;
     TEST_BYTES/(endTime-startTime));&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Computes the message digest for string inString.&lt;br /&gt;
   Prints out message digest, a space, the string (in quotes) and a&lt;br /&gt;
   carriage return.&lt;br /&gt;
 */&lt;br /&gt;
static void MDString (inString)&lt;br /&gt;
char *inString;&lt;br /&gt;
{&lt;br /&gt;
  MD5_CTX mdContext;&lt;br /&gt;
  unsigned int len = strlen (inString);&lt;br /&gt;
&lt;br /&gt;
  MD5Init (&amp;amp;mdContext);&lt;br /&gt;
  MD5Update (&amp;amp;mdContext, inString, len);&lt;br /&gt;
  MD5Final (&amp;amp;mdContext);&lt;br /&gt;
  MDPrint (&amp;amp;mdContext);&lt;br /&gt;
  printf (&amp;quot; \&amp;quot;%s\&amp;quot;\n\n&amp;quot;, inString);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Computes the message digest for a specified file.&lt;br /&gt;
   Prints out message digest, a space, the file name, and a carriage&lt;br /&gt;
   return.&lt;br /&gt;
 */&lt;br /&gt;
static void MDFile (filename)&lt;br /&gt;
char *filename;&lt;br /&gt;
{&lt;br /&gt;
  FILE *inFile = fopen (filename, &amp;quot;rb&amp;quot;);&lt;br /&gt;
  MD5_CTX mdContext;&lt;br /&gt;
  int bytes;&lt;br /&gt;
  unsigned char data[1024];&lt;br /&gt;
&lt;br /&gt;
  if (inFile == NULL) {&lt;br /&gt;
    printf (&amp;quot;%s can't be opened.\n&amp;quot;, filename);&lt;br /&gt;
    return;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  MD5Init (&amp;amp;mdContext);&lt;br /&gt;
  while ((bytes = fread (data, 1, 1024, inFile)) != 0)&lt;br /&gt;
    MD5Update (&amp;amp;mdContext, data, bytes);&lt;br /&gt;
  MD5Final (&amp;amp;mdContext);&lt;br /&gt;
  MDPrint (&amp;amp;mdContext);&lt;br /&gt;
  printf (&amp;quot; %s\n&amp;quot;, filename);&lt;br /&gt;
  fclose (inFile);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Writes the message digest of the data from stdin onto stdout,&lt;br /&gt;
   followed by a carriage return.&lt;br /&gt;
 */&lt;br /&gt;
static void MDFilter ()&lt;br /&gt;
{&lt;br /&gt;
  MD5_CTX mdContext;&lt;br /&gt;
  int bytes;&lt;br /&gt;
  unsigned char data[16];&lt;br /&gt;
&lt;br /&gt;
  MD5Init (&amp;amp;mdContext);&lt;br /&gt;
  while ((bytes = fread (data, 1, 16, stdin)) != 0)&lt;br /&gt;
    MD5Update (&amp;amp;mdContext, data, bytes);&lt;br /&gt;
  MD5Final (&amp;amp;mdContext);&lt;br /&gt;
  MDPrint (&amp;amp;mdContext);&lt;br /&gt;
  printf (&amp;quot;\n&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Runs a standard suite of test data.&lt;br /&gt;
 */&lt;br /&gt;
static void MDTestSuite ()&lt;br /&gt;
{&lt;br /&gt;
  printf (&amp;quot;MD5 test suite results:\n\n&amp;quot;);&lt;br /&gt;
  MDString (&amp;quot;&amp;quot;);&lt;br /&gt;
  MDString (&amp;quot;a&amp;quot;);&lt;br /&gt;
  MDString (&amp;quot;abc&amp;quot;);&lt;br /&gt;
  MDString (&amp;quot;message digest&amp;quot;);&lt;br /&gt;
  MDString (&amp;quot;abcdefghijklmnopqrstuvwxyz&amp;quot;);&lt;br /&gt;
  MDString&lt;br /&gt;
    (&amp;quot;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789&amp;quot;);&lt;br /&gt;
  MDString&lt;br /&gt;
    (&amp;quot;1234567890123456789012345678901234567890\&lt;br /&gt;
1234567890123456789012345678901234567890&amp;quot;);&lt;br /&gt;
  /* Contents of file foo are &amp;quot;abc&amp;quot; */&lt;br /&gt;
  MDFile (&amp;quot;foo&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void main (argc, argv)&lt;br /&gt;
int argc;&lt;br /&gt;
char *argv[];&lt;br /&gt;
{&lt;br /&gt;
  int i;&lt;br /&gt;
&lt;br /&gt;
  /* For each command line argument in turn:&lt;br /&gt;
  ** filename          -- prints message digest and name of file&lt;br /&gt;
  ** -sstring          -- prints message digest and contents of string&lt;br /&gt;
  ** -t                -- prints time trial statistics for 1M characters&lt;br /&gt;
  ** -x                -- execute a standard suite of test data&lt;br /&gt;
  ** (no args)         -- writes messages digest of stdin onto stdout&lt;br /&gt;
  */&lt;br /&gt;
  if (argc == 1)&lt;br /&gt;
    MDFilter ();&lt;br /&gt;
  else&lt;br /&gt;
    for (i = 1; i &amp;lt; argc; i++)&lt;br /&gt;
      if (argv[i][0] == '-' &amp;amp;&amp;amp; argv[i][1] == 's')&lt;br /&gt;
        MDString (argv[i] + 2);&lt;br /&gt;
      else if (strcmp (argv[i], &amp;quot;-t&amp;quot;) == 0)&lt;br /&gt;
        MDTimeTrial ();&lt;br /&gt;
      else if (strcmp (argv[i], &amp;quot;-x&amp;quot;) == 0)&lt;br /&gt;
        MDTestSuite ();&lt;br /&gt;
      else MDFile (argv[i]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 **********************************************************************&lt;br /&gt;
 ** End of md5driver.c                                               **&lt;br /&gt;
 ******************************* (cut) ********************************&lt;br /&gt;
 */&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Neozeed</name></author>	</entry>

	</feed>