Netservices modded to read fragmented HTTP respsonse/payload from special purpose server - 180 bytes only

Committer:
RodColeman
Date:
Thu Sep 08 10:48:09 2011 +0000
Revision:
0:850eacf3e945
revised fixed length to 178 bytes

Who changed what in which revision?

UserRevisionLine numberNew contents of line
RodColeman 0:850eacf3e945 1 /*
RodColeman 0:850eacf3e945 2 ***********************************************************************
RodColeman 0:850eacf3e945 3 ** md5.c -- the source code for MD5 routines **
RodColeman 0:850eacf3e945 4 ** RSA Data Security, Inc. MD5 Message-Digest Algorithm **
RodColeman 0:850eacf3e945 5 ** Created: 2/17/90 RLR **
RodColeman 0:850eacf3e945 6 ** Revised: 1/91 SRD,AJ,BSK,JT Reference C ver., 7/10 constant corr. **
RodColeman 0:850eacf3e945 7 ***********************************************************************
RodColeman 0:850eacf3e945 8 */
RodColeman 0:850eacf3e945 9
RodColeman 0:850eacf3e945 10 /*
RodColeman 0:850eacf3e945 11 ***********************************************************************
RodColeman 0:850eacf3e945 12 ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. **
RodColeman 0:850eacf3e945 13 ** **
RodColeman 0:850eacf3e945 14 ** License to copy and use this software is granted provided that **
RodColeman 0:850eacf3e945 15 ** it is identified as the "RSA Data Security, Inc. MD5 Message- **
RodColeman 0:850eacf3e945 16 ** Digest Algorithm" in all material mentioning or referencing this **
RodColeman 0:850eacf3e945 17 ** software or this function. **
RodColeman 0:850eacf3e945 18 ** **
RodColeman 0:850eacf3e945 19 ** License is also granted to make and use derivative works **
RodColeman 0:850eacf3e945 20 ** provided that such works are identified as "derived from the RSA **
RodColeman 0:850eacf3e945 21 ** Data Security, Inc. MD5 Message-Digest Algorithm" in all **
RodColeman 0:850eacf3e945 22 ** material mentioning or referencing the derived work. **
RodColeman 0:850eacf3e945 23 ** **
RodColeman 0:850eacf3e945 24 ** RSA Data Security, Inc. makes no representations concerning **
RodColeman 0:850eacf3e945 25 ** either the merchantability of this software or the suitability **
RodColeman 0:850eacf3e945 26 ** of this software for any particular purpose. It is provided "as **
RodColeman 0:850eacf3e945 27 ** is" without express or implied warranty of any kind. **
RodColeman 0:850eacf3e945 28 ** **
RodColeman 0:850eacf3e945 29 ** These notices must be retained in any copies of any part of this **
RodColeman 0:850eacf3e945 30 ** documentation and/or software. **
RodColeman 0:850eacf3e945 31 ***********************************************************************
RodColeman 0:850eacf3e945 32 */
RodColeman 0:850eacf3e945 33
RodColeman 0:850eacf3e945 34 #include "lwip/opt.h"
RodColeman 0:850eacf3e945 35
RodColeman 0:850eacf3e945 36 #if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */
RodColeman 0:850eacf3e945 37
RodColeman 0:850eacf3e945 38 #if CHAP_SUPPORT || MD5_SUPPORT
RodColeman 0:850eacf3e945 39
RodColeman 0:850eacf3e945 40 #include "ppp.h"
RodColeman 0:850eacf3e945 41 #include "pppdebug.h"
RodColeman 0:850eacf3e945 42
RodColeman 0:850eacf3e945 43 #include "md5.h"
RodColeman 0:850eacf3e945 44
RodColeman 0:850eacf3e945 45 #include <string.h>
RodColeman 0:850eacf3e945 46
RodColeman 0:850eacf3e945 47 /*
RodColeman 0:850eacf3e945 48 ***********************************************************************
RodColeman 0:850eacf3e945 49 ** Message-digest routines: **
RodColeman 0:850eacf3e945 50 ** To form the message digest for a message M **
RodColeman 0:850eacf3e945 51 ** (1) Initialize a context buffer mdContext using MD5Init **
RodColeman 0:850eacf3e945 52 ** (2) Call MD5Update on mdContext and M **
RodColeman 0:850eacf3e945 53 ** (3) Call MD5Final on mdContext **
RodColeman 0:850eacf3e945 54 ** The message digest is now in mdContext->digest[0...15] **
RodColeman 0:850eacf3e945 55 ***********************************************************************
RodColeman 0:850eacf3e945 56 */
RodColeman 0:850eacf3e945 57
RodColeman 0:850eacf3e945 58 /* forward declaration */
RodColeman 0:850eacf3e945 59 static void Transform (u32_t *buf, u32_t *in);
RodColeman 0:850eacf3e945 60
RodColeman 0:850eacf3e945 61 static unsigned char PADDING[64] = {
RodColeman 0:850eacf3e945 62 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
RodColeman 0:850eacf3e945 63 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
RodColeman 0:850eacf3e945 64 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
RodColeman 0:850eacf3e945 65 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
RodColeman 0:850eacf3e945 66 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
RodColeman 0:850eacf3e945 67 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
RodColeman 0:850eacf3e945 68 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
RodColeman 0:850eacf3e945 69 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
RodColeman 0:850eacf3e945 70 };
RodColeman 0:850eacf3e945 71
RodColeman 0:850eacf3e945 72 /* F, G, H and I are basic MD5 functions */
RodColeman 0:850eacf3e945 73 #define F(x, y, z) (((x) & (y)) | ((~x) & (z)))
RodColeman 0:850eacf3e945 74 #define G(x, y, z) (((x) & (z)) | ((y) & (~z)))
RodColeman 0:850eacf3e945 75 #define H(x, y, z) ((x) ^ (y) ^ (z))
RodColeman 0:850eacf3e945 76 #define I(x, y, z) ((y) ^ ((x) | (~z)))
RodColeman 0:850eacf3e945 77
RodColeman 0:850eacf3e945 78 /* ROTATE_LEFT rotates x left n bits */
RodColeman 0:850eacf3e945 79 #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
RodColeman 0:850eacf3e945 80
RodColeman 0:850eacf3e945 81 /* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4 */
RodColeman 0:850eacf3e945 82 /* Rotation is separate from addition to prevent recomputation */
RodColeman 0:850eacf3e945 83 #define FF(a, b, c, d, x, s, ac) \
RodColeman 0:850eacf3e945 84 {(a) += F ((b), (c), (d)) + (x) + (u32_t)(ac); \
RodColeman 0:850eacf3e945 85 (a) = ROTATE_LEFT ((a), (s)); \
RodColeman 0:850eacf3e945 86 (a) += (b); \
RodColeman 0:850eacf3e945 87 }
RodColeman 0:850eacf3e945 88 #define GG(a, b, c, d, x, s, ac) \
RodColeman 0:850eacf3e945 89 {(a) += G ((b), (c), (d)) + (x) + (u32_t)(ac); \
RodColeman 0:850eacf3e945 90 (a) = ROTATE_LEFT ((a), (s)); \
RodColeman 0:850eacf3e945 91 (a) += (b); \
RodColeman 0:850eacf3e945 92 }
RodColeman 0:850eacf3e945 93 #define HH(a, b, c, d, x, s, ac) \
RodColeman 0:850eacf3e945 94 {(a) += H ((b), (c), (d)) + (x) + (u32_t)(ac); \
RodColeman 0:850eacf3e945 95 (a) = ROTATE_LEFT ((a), (s)); \
RodColeman 0:850eacf3e945 96 (a) += (b); \
RodColeman 0:850eacf3e945 97 }
RodColeman 0:850eacf3e945 98 #define II(a, b, c, d, x, s, ac) \
RodColeman 0:850eacf3e945 99 {(a) += I ((b), (c), (d)) + (x) + (u32_t)(ac); \
RodColeman 0:850eacf3e945 100 (a) = ROTATE_LEFT ((a), (s)); \
RodColeman 0:850eacf3e945 101 (a) += (b); \
RodColeman 0:850eacf3e945 102 }
RodColeman 0:850eacf3e945 103
RodColeman 0:850eacf3e945 104 #ifdef __STDC__
RodColeman 0:850eacf3e945 105 #define UL(x) x##UL
RodColeman 0:850eacf3e945 106 #else
RodColeman 0:850eacf3e945 107 #ifdef WIN32
RodColeman 0:850eacf3e945 108 #define UL(x) x##UL
RodColeman 0:850eacf3e945 109 #else
RodColeman 0:850eacf3e945 110 #define UL(x) x
RodColeman 0:850eacf3e945 111 #endif
RodColeman 0:850eacf3e945 112 #endif
RodColeman 0:850eacf3e945 113
RodColeman 0:850eacf3e945 114 /* The routine MD5Init initializes the message-digest context
RodColeman 0:850eacf3e945 115 mdContext. All fields are set to zero.
RodColeman 0:850eacf3e945 116 */
RodColeman 0:850eacf3e945 117 void
RodColeman 0:850eacf3e945 118 MD5Init (MD5_CTX *mdContext)
RodColeman 0:850eacf3e945 119 {
RodColeman 0:850eacf3e945 120 mdContext->i[0] = mdContext->i[1] = (u32_t)0;
RodColeman 0:850eacf3e945 121
RodColeman 0:850eacf3e945 122 /* Load magic initialization constants. */
RodColeman 0:850eacf3e945 123 mdContext->buf[0] = (u32_t)0x67452301UL;
RodColeman 0:850eacf3e945 124 mdContext->buf[1] = (u32_t)0xefcdab89UL;
RodColeman 0:850eacf3e945 125 mdContext->buf[2] = (u32_t)0x98badcfeUL;
RodColeman 0:850eacf3e945 126 mdContext->buf[3] = (u32_t)0x10325476UL;
RodColeman 0:850eacf3e945 127 }
RodColeman 0:850eacf3e945 128
RodColeman 0:850eacf3e945 129 /* The routine MD5Update updates the message-digest context to
RodColeman 0:850eacf3e945 130 account for the presence of each of the characters inBuf[0..inLen-1]
RodColeman 0:850eacf3e945 131 in the message whose digest is being computed.
RodColeman 0:850eacf3e945 132 */
RodColeman 0:850eacf3e945 133 void
RodColeman 0:850eacf3e945 134 MD5Update(MD5_CTX *mdContext, unsigned char *inBuf, unsigned int inLen)
RodColeman 0:850eacf3e945 135 {
RodColeman 0:850eacf3e945 136 u32_t in[16];
RodColeman 0:850eacf3e945 137 int mdi;
RodColeman 0:850eacf3e945 138 unsigned int i, ii;
RodColeman 0:850eacf3e945 139
RodColeman 0:850eacf3e945 140 #if 0
RodColeman 0:850eacf3e945 141 PPPDEBUG(LOG_INFO, ("MD5Update: %u:%.*H\n", inLen, LWIP_MIN(inLen, 20) * 2, inBuf));
RodColeman 0:850eacf3e945 142 PPPDEBUG(LOG_INFO, ("MD5Update: %u:%s\n", inLen, inBuf));
RodColeman 0:850eacf3e945 143 #endif
RodColeman 0:850eacf3e945 144
RodColeman 0:850eacf3e945 145 /* compute number of bytes mod 64 */
RodColeman 0:850eacf3e945 146 mdi = (int)((mdContext->i[0] >> 3) & 0x3F);
RodColeman 0:850eacf3e945 147
RodColeman 0:850eacf3e945 148 /* update number of bits */
RodColeman 0:850eacf3e945 149 if ((mdContext->i[0] + ((u32_t)inLen << 3)) < mdContext->i[0]) {
RodColeman 0:850eacf3e945 150 mdContext->i[1]++;
RodColeman 0:850eacf3e945 151 }
RodColeman 0:850eacf3e945 152 mdContext->i[0] += ((u32_t)inLen << 3);
RodColeman 0:850eacf3e945 153 mdContext->i[1] += ((u32_t)inLen >> 29);
RodColeman 0:850eacf3e945 154
RodColeman 0:850eacf3e945 155 while (inLen--) {
RodColeman 0:850eacf3e945 156 /* add new character to buffer, increment mdi */
RodColeman 0:850eacf3e945 157 mdContext->in[mdi++] = *inBuf++;
RodColeman 0:850eacf3e945 158
RodColeman 0:850eacf3e945 159 /* transform if necessary */
RodColeman 0:850eacf3e945 160 if (mdi == 0x40) {
RodColeman 0:850eacf3e945 161 for (i = 0, ii = 0; i < 16; i++, ii += 4) {
RodColeman 0:850eacf3e945 162 in[i] = (((u32_t)mdContext->in[ii+3]) << 24) |
RodColeman 0:850eacf3e945 163 (((u32_t)mdContext->in[ii+2]) << 16) |
RodColeman 0:850eacf3e945 164 (((u32_t)mdContext->in[ii+1]) << 8) |
RodColeman 0:850eacf3e945 165 ((u32_t)mdContext->in[ii]);
RodColeman 0:850eacf3e945 166 }
RodColeman 0:850eacf3e945 167 Transform (mdContext->buf, in);
RodColeman 0:850eacf3e945 168 mdi = 0;
RodColeman 0:850eacf3e945 169 }
RodColeman 0:850eacf3e945 170 }
RodColeman 0:850eacf3e945 171 }
RodColeman 0:850eacf3e945 172
RodColeman 0:850eacf3e945 173 /* The routine MD5Final terminates the message-digest computation and
RodColeman 0:850eacf3e945 174 ends with the desired message digest in mdContext->digest[0...15].
RodColeman 0:850eacf3e945 175 */
RodColeman 0:850eacf3e945 176 void
RodColeman 0:850eacf3e945 177 MD5Final (unsigned char hash[], MD5_CTX *mdContext)
RodColeman 0:850eacf3e945 178 {
RodColeman 0:850eacf3e945 179 u32_t in[16];
RodColeman 0:850eacf3e945 180 int mdi;
RodColeman 0:850eacf3e945 181 unsigned int i, ii;
RodColeman 0:850eacf3e945 182 unsigned int padLen;
RodColeman 0:850eacf3e945 183
RodColeman 0:850eacf3e945 184 /* save number of bits */
RodColeman 0:850eacf3e945 185 in[14] = mdContext->i[0];
RodColeman 0:850eacf3e945 186 in[15] = mdContext->i[1];
RodColeman 0:850eacf3e945 187
RodColeman 0:850eacf3e945 188 /* compute number of bytes mod 64 */
RodColeman 0:850eacf3e945 189 mdi = (int)((mdContext->i[0] >> 3) & 0x3F);
RodColeman 0:850eacf3e945 190
RodColeman 0:850eacf3e945 191 /* pad out to 56 mod 64 */
RodColeman 0:850eacf3e945 192 padLen = (mdi < 56) ? (56 - mdi) : (120 - mdi);
RodColeman 0:850eacf3e945 193 MD5Update (mdContext, PADDING, padLen);
RodColeman 0:850eacf3e945 194
RodColeman 0:850eacf3e945 195 /* append length in bits and transform */
RodColeman 0:850eacf3e945 196 for (i = 0, ii = 0; i < 14; i++, ii += 4) {
RodColeman 0:850eacf3e945 197 in[i] = (((u32_t)mdContext->in[ii+3]) << 24) |
RodColeman 0:850eacf3e945 198 (((u32_t)mdContext->in[ii+2]) << 16) |
RodColeman 0:850eacf3e945 199 (((u32_t)mdContext->in[ii+1]) << 8) |
RodColeman 0:850eacf3e945 200 ((u32_t)mdContext->in[ii]);
RodColeman 0:850eacf3e945 201 }
RodColeman 0:850eacf3e945 202 Transform (mdContext->buf, in);
RodColeman 0:850eacf3e945 203
RodColeman 0:850eacf3e945 204 /* store buffer in digest */
RodColeman 0:850eacf3e945 205 for (i = 0, ii = 0; i < 4; i++, ii += 4) {
RodColeman 0:850eacf3e945 206 mdContext->digest[ii] = (unsigned char)(mdContext->buf[i] & 0xFF);
RodColeman 0:850eacf3e945 207 mdContext->digest[ii+1] =
RodColeman 0:850eacf3e945 208 (unsigned char)((mdContext->buf[i] >> 8) & 0xFF);
RodColeman 0:850eacf3e945 209 mdContext->digest[ii+2] =
RodColeman 0:850eacf3e945 210 (unsigned char)((mdContext->buf[i] >> 16) & 0xFF);
RodColeman 0:850eacf3e945 211 mdContext->digest[ii+3] =
RodColeman 0:850eacf3e945 212 (unsigned char)((mdContext->buf[i] >> 24) & 0xFF);
RodColeman 0:850eacf3e945 213 }
RodColeman 0:850eacf3e945 214 SMEMCPY(hash, mdContext->digest, 16);
RodColeman 0:850eacf3e945 215 }
RodColeman 0:850eacf3e945 216
RodColeman 0:850eacf3e945 217 /* Basic MD5 step. Transforms buf based on in.
RodColeman 0:850eacf3e945 218 */
RodColeman 0:850eacf3e945 219 static void
RodColeman 0:850eacf3e945 220 Transform (u32_t *buf, u32_t *in)
RodColeman 0:850eacf3e945 221 {
RodColeman 0:850eacf3e945 222 u32_t a = buf[0], b = buf[1], c = buf[2], d = buf[3];
RodColeman 0:850eacf3e945 223
RodColeman 0:850eacf3e945 224 /* Round 1 */
RodColeman 0:850eacf3e945 225 #define S11 7
RodColeman 0:850eacf3e945 226 #define S12 12
RodColeman 0:850eacf3e945 227 #define S13 17
RodColeman 0:850eacf3e945 228 #define S14 22
RodColeman 0:850eacf3e945 229 FF ( a, b, c, d, in[ 0], S11, UL(3614090360)); /* 1 */
RodColeman 0:850eacf3e945 230 FF ( d, a, b, c, in[ 1], S12, UL(3905402710)); /* 2 */
RodColeman 0:850eacf3e945 231 FF ( c, d, a, b, in[ 2], S13, UL( 606105819)); /* 3 */
RodColeman 0:850eacf3e945 232 FF ( b, c, d, a, in[ 3], S14, UL(3250441966)); /* 4 */
RodColeman 0:850eacf3e945 233 FF ( a, b, c, d, in[ 4], S11, UL(4118548399)); /* 5 */
RodColeman 0:850eacf3e945 234 FF ( d, a, b, c, in[ 5], S12, UL(1200080426)); /* 6 */
RodColeman 0:850eacf3e945 235 FF ( c, d, a, b, in[ 6], S13, UL(2821735955)); /* 7 */
RodColeman 0:850eacf3e945 236 FF ( b, c, d, a, in[ 7], S14, UL(4249261313)); /* 8 */
RodColeman 0:850eacf3e945 237 FF ( a, b, c, d, in[ 8], S11, UL(1770035416)); /* 9 */
RodColeman 0:850eacf3e945 238 FF ( d, a, b, c, in[ 9], S12, UL(2336552879)); /* 10 */
RodColeman 0:850eacf3e945 239 FF ( c, d, a, b, in[10], S13, UL(4294925233)); /* 11 */
RodColeman 0:850eacf3e945 240 FF ( b, c, d, a, in[11], S14, UL(2304563134)); /* 12 */
RodColeman 0:850eacf3e945 241 FF ( a, b, c, d, in[12], S11, UL(1804603682)); /* 13 */
RodColeman 0:850eacf3e945 242 FF ( d, a, b, c, in[13], S12, UL(4254626195)); /* 14 */
RodColeman 0:850eacf3e945 243 FF ( c, d, a, b, in[14], S13, UL(2792965006)); /* 15 */
RodColeman 0:850eacf3e945 244 FF ( b, c, d, a, in[15], S14, UL(1236535329)); /* 16 */
RodColeman 0:850eacf3e945 245
RodColeman 0:850eacf3e945 246 /* Round 2 */
RodColeman 0:850eacf3e945 247 #define S21 5
RodColeman 0:850eacf3e945 248 #define S22 9
RodColeman 0:850eacf3e945 249 #define S23 14
RodColeman 0:850eacf3e945 250 #define S24 20
RodColeman 0:850eacf3e945 251 GG ( a, b, c, d, in[ 1], S21, UL(4129170786)); /* 17 */
RodColeman 0:850eacf3e945 252 GG ( d, a, b, c, in[ 6], S22, UL(3225465664)); /* 18 */
RodColeman 0:850eacf3e945 253 GG ( c, d, a, b, in[11], S23, UL( 643717713)); /* 19 */
RodColeman 0:850eacf3e945 254 GG ( b, c, d, a, in[ 0], S24, UL(3921069994)); /* 20 */
RodColeman 0:850eacf3e945 255 GG ( a, b, c, d, in[ 5], S21, UL(3593408605)); /* 21 */
RodColeman 0:850eacf3e945 256 GG ( d, a, b, c, in[10], S22, UL( 38016083)); /* 22 */
RodColeman 0:850eacf3e945 257 GG ( c, d, a, b, in[15], S23, UL(3634488961)); /* 23 */
RodColeman 0:850eacf3e945 258 GG ( b, c, d, a, in[ 4], S24, UL(3889429448)); /* 24 */
RodColeman 0:850eacf3e945 259 GG ( a, b, c, d, in[ 9], S21, UL( 568446438)); /* 25 */
RodColeman 0:850eacf3e945 260 GG ( d, a, b, c, in[14], S22, UL(3275163606)); /* 26 */
RodColeman 0:850eacf3e945 261 GG ( c, d, a, b, in[ 3], S23, UL(4107603335)); /* 27 */
RodColeman 0:850eacf3e945 262 GG ( b, c, d, a, in[ 8], S24, UL(1163531501)); /* 28 */
RodColeman 0:850eacf3e945 263 GG ( a, b, c, d, in[13], S21, UL(2850285829)); /* 29 */
RodColeman 0:850eacf3e945 264 GG ( d, a, b, c, in[ 2], S22, UL(4243563512)); /* 30 */
RodColeman 0:850eacf3e945 265 GG ( c, d, a, b, in[ 7], S23, UL(1735328473)); /* 31 */
RodColeman 0:850eacf3e945 266 GG ( b, c, d, a, in[12], S24, UL(2368359562)); /* 32 */
RodColeman 0:850eacf3e945 267
RodColeman 0:850eacf3e945 268 /* Round 3 */
RodColeman 0:850eacf3e945 269 #define S31 4
RodColeman 0:850eacf3e945 270 #define S32 11
RodColeman 0:850eacf3e945 271 #define S33 16
RodColeman 0:850eacf3e945 272 #define S34 23
RodColeman 0:850eacf3e945 273 HH ( a, b, c, d, in[ 5], S31, UL(4294588738)); /* 33 */
RodColeman 0:850eacf3e945 274 HH ( d, a, b, c, in[ 8], S32, UL(2272392833)); /* 34 */
RodColeman 0:850eacf3e945 275 HH ( c, d, a, b, in[11], S33, UL(1839030562)); /* 35 */
RodColeman 0:850eacf3e945 276 HH ( b, c, d, a, in[14], S34, UL(4259657740)); /* 36 */
RodColeman 0:850eacf3e945 277 HH ( a, b, c, d, in[ 1], S31, UL(2763975236)); /* 37 */
RodColeman 0:850eacf3e945 278 HH ( d, a, b, c, in[ 4], S32, UL(1272893353)); /* 38 */
RodColeman 0:850eacf3e945 279 HH ( c, d, a, b, in[ 7], S33, UL(4139469664)); /* 39 */
RodColeman 0:850eacf3e945 280 HH ( b, c, d, a, in[10], S34, UL(3200236656)); /* 40 */
RodColeman 0:850eacf3e945 281 HH ( a, b, c, d, in[13], S31, UL( 681279174)); /* 41 */
RodColeman 0:850eacf3e945 282 HH ( d, a, b, c, in[ 0], S32, UL(3936430074)); /* 42 */
RodColeman 0:850eacf3e945 283 HH ( c, d, a, b, in[ 3], S33, UL(3572445317)); /* 43 */
RodColeman 0:850eacf3e945 284 HH ( b, c, d, a, in[ 6], S34, UL( 76029189)); /* 44 */
RodColeman 0:850eacf3e945 285 HH ( a, b, c, d, in[ 9], S31, UL(3654602809)); /* 45 */
RodColeman 0:850eacf3e945 286 HH ( d, a, b, c, in[12], S32, UL(3873151461)); /* 46 */
RodColeman 0:850eacf3e945 287 HH ( c, d, a, b, in[15], S33, UL( 530742520)); /* 47 */
RodColeman 0:850eacf3e945 288 HH ( b, c, d, a, in[ 2], S34, UL(3299628645)); /* 48 */
RodColeman 0:850eacf3e945 289
RodColeman 0:850eacf3e945 290 /* Round 4 */
RodColeman 0:850eacf3e945 291 #define S41 6
RodColeman 0:850eacf3e945 292 #define S42 10
RodColeman 0:850eacf3e945 293 #define S43 15
RodColeman 0:850eacf3e945 294 #define S44 21
RodColeman 0:850eacf3e945 295 II ( a, b, c, d, in[ 0], S41, UL(4096336452)); /* 49 */
RodColeman 0:850eacf3e945 296 II ( d, a, b, c, in[ 7], S42, UL(1126891415)); /* 50 */
RodColeman 0:850eacf3e945 297 II ( c, d, a, b, in[14], S43, UL(2878612391)); /* 51 */
RodColeman 0:850eacf3e945 298 II ( b, c, d, a, in[ 5], S44, UL(4237533241)); /* 52 */
RodColeman 0:850eacf3e945 299 II ( a, b, c, d, in[12], S41, UL(1700485571)); /* 53 */
RodColeman 0:850eacf3e945 300 II ( d, a, b, c, in[ 3], S42, UL(2399980690)); /* 54 */
RodColeman 0:850eacf3e945 301 II ( c, d, a, b, in[10], S43, UL(4293915773)); /* 55 */
RodColeman 0:850eacf3e945 302 II ( b, c, d, a, in[ 1], S44, UL(2240044497)); /* 56 */
RodColeman 0:850eacf3e945 303 II ( a, b, c, d, in[ 8], S41, UL(1873313359)); /* 57 */
RodColeman 0:850eacf3e945 304 II ( d, a, b, c, in[15], S42, UL(4264355552)); /* 58 */
RodColeman 0:850eacf3e945 305 II ( c, d, a, b, in[ 6], S43, UL(2734768916)); /* 59 */
RodColeman 0:850eacf3e945 306 II ( b, c, d, a, in[13], S44, UL(1309151649)); /* 60 */
RodColeman 0:850eacf3e945 307 II ( a, b, c, d, in[ 4], S41, UL(4149444226)); /* 61 */
RodColeman 0:850eacf3e945 308 II ( d, a, b, c, in[11], S42, UL(3174756917)); /* 62 */
RodColeman 0:850eacf3e945 309 II ( c, d, a, b, in[ 2], S43, UL( 718787259)); /* 63 */
RodColeman 0:850eacf3e945 310 II ( b, c, d, a, in[ 9], S44, UL(3951481745)); /* 64 */
RodColeman 0:850eacf3e945 311
RodColeman 0:850eacf3e945 312 buf[0] += a;
RodColeman 0:850eacf3e945 313 buf[1] += b;
RodColeman 0:850eacf3e945 314 buf[2] += c;
RodColeman 0:850eacf3e945 315 buf[3] += d;
RodColeman 0:850eacf3e945 316 }
RodColeman 0:850eacf3e945 317
RodColeman 0:850eacf3e945 318 #endif /* CHAP_SUPPORT || MD5_SUPPORT */
RodColeman 0:850eacf3e945 319
RodColeman 0:850eacf3e945 320 #endif /* PPP_SUPPORT */