xref: /onnv-gate/usr/src/common/openssl/crypto/md5/md5_dgst.c (revision 2139:6243c3338933)
10Sstevel@tonic-gate /* crypto/md5/md5_dgst.c */
20Sstevel@tonic-gate /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
30Sstevel@tonic-gate  * All rights reserved.
40Sstevel@tonic-gate  *
50Sstevel@tonic-gate  * This package is an SSL implementation written
60Sstevel@tonic-gate  * by Eric Young (eay@cryptsoft.com).
70Sstevel@tonic-gate  * The implementation was written so as to conform with Netscapes SSL.
80Sstevel@tonic-gate  *
90Sstevel@tonic-gate  * This library is free for commercial and non-commercial use as long as
100Sstevel@tonic-gate  * the following conditions are aheared to.  The following conditions
110Sstevel@tonic-gate  * apply to all code found in this distribution, be it the RC4, RSA,
120Sstevel@tonic-gate  * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
130Sstevel@tonic-gate  * included with this distribution is covered by the same copyright terms
140Sstevel@tonic-gate  * except that the holder is Tim Hudson (tjh@cryptsoft.com).
150Sstevel@tonic-gate  *
160Sstevel@tonic-gate  * Copyright remains Eric Young's, and as such any Copyright notices in
170Sstevel@tonic-gate  * the code are not to be removed.
180Sstevel@tonic-gate  * If this package is used in a product, Eric Young should be given attribution
190Sstevel@tonic-gate  * as the author of the parts of the library used.
200Sstevel@tonic-gate  * This can be in the form of a textual message at program startup or
210Sstevel@tonic-gate  * in documentation (online or textual) provided with the package.
220Sstevel@tonic-gate  *
230Sstevel@tonic-gate  * Redistribution and use in source and binary forms, with or without
240Sstevel@tonic-gate  * modification, are permitted provided that the following conditions
250Sstevel@tonic-gate  * are met:
260Sstevel@tonic-gate  * 1. Redistributions of source code must retain the copyright
270Sstevel@tonic-gate  *    notice, this list of conditions and the following disclaimer.
280Sstevel@tonic-gate  * 2. Redistributions in binary form must reproduce the above copyright
290Sstevel@tonic-gate  *    notice, this list of conditions and the following disclaimer in the
300Sstevel@tonic-gate  *    documentation and/or other materials provided with the distribution.
310Sstevel@tonic-gate  * 3. All advertising materials mentioning features or use of this software
320Sstevel@tonic-gate  *    must display the following acknowledgement:
330Sstevel@tonic-gate  *    "This product includes cryptographic software written by
340Sstevel@tonic-gate  *     Eric Young (eay@cryptsoft.com)"
350Sstevel@tonic-gate  *    The word 'cryptographic' can be left out if the rouines from the library
360Sstevel@tonic-gate  *    being used are not cryptographic related :-).
370Sstevel@tonic-gate  * 4. If you include any Windows specific code (or a derivative thereof) from
380Sstevel@tonic-gate  *    the apps directory (application code) you must include an acknowledgement:
390Sstevel@tonic-gate  *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
400Sstevel@tonic-gate  *
410Sstevel@tonic-gate  * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
420Sstevel@tonic-gate  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
430Sstevel@tonic-gate  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
440Sstevel@tonic-gate  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
450Sstevel@tonic-gate  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
460Sstevel@tonic-gate  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
470Sstevel@tonic-gate  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
480Sstevel@tonic-gate  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
490Sstevel@tonic-gate  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
500Sstevel@tonic-gate  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
510Sstevel@tonic-gate  * SUCH DAMAGE.
520Sstevel@tonic-gate  *
530Sstevel@tonic-gate  * The licence and distribution terms for any publically available version or
540Sstevel@tonic-gate  * derivative of this code cannot be changed.  i.e. this code cannot simply be
550Sstevel@tonic-gate  * copied and put under another distribution licence
560Sstevel@tonic-gate  * [including the GNU Public Licence.]
570Sstevel@tonic-gate  */
580Sstevel@tonic-gate 
590Sstevel@tonic-gate #include <stdio.h>
600Sstevel@tonic-gate #include "md5_locl.h"
610Sstevel@tonic-gate #include <openssl/opensslv.h>
620Sstevel@tonic-gate 
630Sstevel@tonic-gate const char *MD5_version="MD5" OPENSSL_VERSION_PTEXT;
640Sstevel@tonic-gate 
650Sstevel@tonic-gate /* Implemented from RFC1321 The MD5 Message-Digest Algorithm
660Sstevel@tonic-gate  */
670Sstevel@tonic-gate 
680Sstevel@tonic-gate #define INIT_DATA_A (unsigned long)0x67452301L
690Sstevel@tonic-gate #define INIT_DATA_B (unsigned long)0xefcdab89L
700Sstevel@tonic-gate #define INIT_DATA_C (unsigned long)0x98badcfeL
710Sstevel@tonic-gate #define INIT_DATA_D (unsigned long)0x10325476L
720Sstevel@tonic-gate 
MD5_Init(MD5_CTX * c)730Sstevel@tonic-gate int MD5_Init(MD5_CTX *c)
740Sstevel@tonic-gate 	{
750Sstevel@tonic-gate 	c->A=INIT_DATA_A;
760Sstevel@tonic-gate 	c->B=INIT_DATA_B;
770Sstevel@tonic-gate 	c->C=INIT_DATA_C;
780Sstevel@tonic-gate 	c->D=INIT_DATA_D;
790Sstevel@tonic-gate 	c->Nl=0;
800Sstevel@tonic-gate 	c->Nh=0;
810Sstevel@tonic-gate 	c->num=0;
820Sstevel@tonic-gate 	return 1;
830Sstevel@tonic-gate 	}
840Sstevel@tonic-gate 
850Sstevel@tonic-gate #ifndef md5_block_host_order
md5_block_host_order(MD5_CTX * c,const void * data,size_t num)86*2139Sjp161948 void md5_block_host_order (MD5_CTX *c, const void *data, size_t num)
870Sstevel@tonic-gate 	{
880Sstevel@tonic-gate 	const MD5_LONG *X=data;
890Sstevel@tonic-gate 	register unsigned MD32_REG_T A,B,C,D;
900Sstevel@tonic-gate 
910Sstevel@tonic-gate 	A=c->A;
920Sstevel@tonic-gate 	B=c->B;
930Sstevel@tonic-gate 	C=c->C;
940Sstevel@tonic-gate 	D=c->D;
950Sstevel@tonic-gate 
960Sstevel@tonic-gate 	for (;num--;X+=HASH_LBLOCK)
970Sstevel@tonic-gate 		{
980Sstevel@tonic-gate 	/* Round 0 */
990Sstevel@tonic-gate 	R0(A,B,C,D,X[ 0], 7,0xd76aa478L);
1000Sstevel@tonic-gate 	R0(D,A,B,C,X[ 1],12,0xe8c7b756L);
1010Sstevel@tonic-gate 	R0(C,D,A,B,X[ 2],17,0x242070dbL);
1020Sstevel@tonic-gate 	R0(B,C,D,A,X[ 3],22,0xc1bdceeeL);
1030Sstevel@tonic-gate 	R0(A,B,C,D,X[ 4], 7,0xf57c0fafL);
1040Sstevel@tonic-gate 	R0(D,A,B,C,X[ 5],12,0x4787c62aL);
1050Sstevel@tonic-gate 	R0(C,D,A,B,X[ 6],17,0xa8304613L);
1060Sstevel@tonic-gate 	R0(B,C,D,A,X[ 7],22,0xfd469501L);
1070Sstevel@tonic-gate 	R0(A,B,C,D,X[ 8], 7,0x698098d8L);
1080Sstevel@tonic-gate 	R0(D,A,B,C,X[ 9],12,0x8b44f7afL);
1090Sstevel@tonic-gate 	R0(C,D,A,B,X[10],17,0xffff5bb1L);
1100Sstevel@tonic-gate 	R0(B,C,D,A,X[11],22,0x895cd7beL);
1110Sstevel@tonic-gate 	R0(A,B,C,D,X[12], 7,0x6b901122L);
1120Sstevel@tonic-gate 	R0(D,A,B,C,X[13],12,0xfd987193L);
1130Sstevel@tonic-gate 	R0(C,D,A,B,X[14],17,0xa679438eL);
1140Sstevel@tonic-gate 	R0(B,C,D,A,X[15],22,0x49b40821L);
1150Sstevel@tonic-gate 	/* Round 1 */
1160Sstevel@tonic-gate 	R1(A,B,C,D,X[ 1], 5,0xf61e2562L);
1170Sstevel@tonic-gate 	R1(D,A,B,C,X[ 6], 9,0xc040b340L);
1180Sstevel@tonic-gate 	R1(C,D,A,B,X[11],14,0x265e5a51L);
1190Sstevel@tonic-gate 	R1(B,C,D,A,X[ 0],20,0xe9b6c7aaL);
1200Sstevel@tonic-gate 	R1(A,B,C,D,X[ 5], 5,0xd62f105dL);
1210Sstevel@tonic-gate 	R1(D,A,B,C,X[10], 9,0x02441453L);
1220Sstevel@tonic-gate 	R1(C,D,A,B,X[15],14,0xd8a1e681L);
1230Sstevel@tonic-gate 	R1(B,C,D,A,X[ 4],20,0xe7d3fbc8L);
1240Sstevel@tonic-gate 	R1(A,B,C,D,X[ 9], 5,0x21e1cde6L);
1250Sstevel@tonic-gate 	R1(D,A,B,C,X[14], 9,0xc33707d6L);
1260Sstevel@tonic-gate 	R1(C,D,A,B,X[ 3],14,0xf4d50d87L);
1270Sstevel@tonic-gate 	R1(B,C,D,A,X[ 8],20,0x455a14edL);
1280Sstevel@tonic-gate 	R1(A,B,C,D,X[13], 5,0xa9e3e905L);
1290Sstevel@tonic-gate 	R1(D,A,B,C,X[ 2], 9,0xfcefa3f8L);
1300Sstevel@tonic-gate 	R1(C,D,A,B,X[ 7],14,0x676f02d9L);
1310Sstevel@tonic-gate 	R1(B,C,D,A,X[12],20,0x8d2a4c8aL);
1320Sstevel@tonic-gate 	/* Round 2 */
1330Sstevel@tonic-gate 	R2(A,B,C,D,X[ 5], 4,0xfffa3942L);
1340Sstevel@tonic-gate 	R2(D,A,B,C,X[ 8],11,0x8771f681L);
1350Sstevel@tonic-gate 	R2(C,D,A,B,X[11],16,0x6d9d6122L);
1360Sstevel@tonic-gate 	R2(B,C,D,A,X[14],23,0xfde5380cL);
1370Sstevel@tonic-gate 	R2(A,B,C,D,X[ 1], 4,0xa4beea44L);
1380Sstevel@tonic-gate 	R2(D,A,B,C,X[ 4],11,0x4bdecfa9L);
1390Sstevel@tonic-gate 	R2(C,D,A,B,X[ 7],16,0xf6bb4b60L);
1400Sstevel@tonic-gate 	R2(B,C,D,A,X[10],23,0xbebfbc70L);
1410Sstevel@tonic-gate 	R2(A,B,C,D,X[13], 4,0x289b7ec6L);
1420Sstevel@tonic-gate 	R2(D,A,B,C,X[ 0],11,0xeaa127faL);
1430Sstevel@tonic-gate 	R2(C,D,A,B,X[ 3],16,0xd4ef3085L);
1440Sstevel@tonic-gate 	R2(B,C,D,A,X[ 6],23,0x04881d05L);
1450Sstevel@tonic-gate 	R2(A,B,C,D,X[ 9], 4,0xd9d4d039L);
1460Sstevel@tonic-gate 	R2(D,A,B,C,X[12],11,0xe6db99e5L);
1470Sstevel@tonic-gate 	R2(C,D,A,B,X[15],16,0x1fa27cf8L);
1480Sstevel@tonic-gate 	R2(B,C,D,A,X[ 2],23,0xc4ac5665L);
1490Sstevel@tonic-gate 	/* Round 3 */
1500Sstevel@tonic-gate 	R3(A,B,C,D,X[ 0], 6,0xf4292244L);
1510Sstevel@tonic-gate 	R3(D,A,B,C,X[ 7],10,0x432aff97L);
1520Sstevel@tonic-gate 	R3(C,D,A,B,X[14],15,0xab9423a7L);
1530Sstevel@tonic-gate 	R3(B,C,D,A,X[ 5],21,0xfc93a039L);
1540Sstevel@tonic-gate 	R3(A,B,C,D,X[12], 6,0x655b59c3L);
1550Sstevel@tonic-gate 	R3(D,A,B,C,X[ 3],10,0x8f0ccc92L);
1560Sstevel@tonic-gate 	R3(C,D,A,B,X[10],15,0xffeff47dL);
1570Sstevel@tonic-gate 	R3(B,C,D,A,X[ 1],21,0x85845dd1L);
1580Sstevel@tonic-gate 	R3(A,B,C,D,X[ 8], 6,0x6fa87e4fL);
1590Sstevel@tonic-gate 	R3(D,A,B,C,X[15],10,0xfe2ce6e0L);
1600Sstevel@tonic-gate 	R3(C,D,A,B,X[ 6],15,0xa3014314L);
1610Sstevel@tonic-gate 	R3(B,C,D,A,X[13],21,0x4e0811a1L);
1620Sstevel@tonic-gate 	R3(A,B,C,D,X[ 4], 6,0xf7537e82L);
1630Sstevel@tonic-gate 	R3(D,A,B,C,X[11],10,0xbd3af235L);
1640Sstevel@tonic-gate 	R3(C,D,A,B,X[ 2],15,0x2ad7d2bbL);
1650Sstevel@tonic-gate 	R3(B,C,D,A,X[ 9],21,0xeb86d391L);
1660Sstevel@tonic-gate 
1670Sstevel@tonic-gate 	A = c->A += A;
1680Sstevel@tonic-gate 	B = c->B += B;
1690Sstevel@tonic-gate 	C = c->C += C;
1700Sstevel@tonic-gate 	D = c->D += D;
1710Sstevel@tonic-gate 		}
1720Sstevel@tonic-gate 	}
1730Sstevel@tonic-gate #endif
1740Sstevel@tonic-gate 
1750Sstevel@tonic-gate #ifndef md5_block_data_order
1760Sstevel@tonic-gate #ifdef X
1770Sstevel@tonic-gate #undef X
1780Sstevel@tonic-gate #endif
md5_block_data_order(MD5_CTX * c,const void * data_,size_t num)179*2139Sjp161948 void md5_block_data_order (MD5_CTX *c, const void *data_, size_t num)
1800Sstevel@tonic-gate 	{
1810Sstevel@tonic-gate 	const unsigned char *data=data_;
1820Sstevel@tonic-gate 	register unsigned MD32_REG_T A,B,C,D,l;
1830Sstevel@tonic-gate #ifndef MD32_XARRAY
1840Sstevel@tonic-gate 	/* See comment in crypto/sha/sha_locl.h for details. */
1850Sstevel@tonic-gate 	unsigned MD32_REG_T	XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7,
1860Sstevel@tonic-gate 				XX8, XX9,XX10,XX11,XX12,XX13,XX14,XX15;
1870Sstevel@tonic-gate # define X(i)	XX##i
1880Sstevel@tonic-gate #else
1890Sstevel@tonic-gate 	MD5_LONG XX[MD5_LBLOCK];
1900Sstevel@tonic-gate # define X(i)	XX[i]
1910Sstevel@tonic-gate #endif
1920Sstevel@tonic-gate 
1930Sstevel@tonic-gate 	A=c->A;
1940Sstevel@tonic-gate 	B=c->B;
1950Sstevel@tonic-gate 	C=c->C;
1960Sstevel@tonic-gate 	D=c->D;
1970Sstevel@tonic-gate 
1980Sstevel@tonic-gate 	for (;num--;)
1990Sstevel@tonic-gate 		{
2000Sstevel@tonic-gate 	HOST_c2l(data,l); X( 0)=l;		HOST_c2l(data,l); X( 1)=l;
2010Sstevel@tonic-gate 	/* Round 0 */
2020Sstevel@tonic-gate 	R0(A,B,C,D,X( 0), 7,0xd76aa478L);	HOST_c2l(data,l); X( 2)=l;
2030Sstevel@tonic-gate 	R0(D,A,B,C,X( 1),12,0xe8c7b756L);	HOST_c2l(data,l); X( 3)=l;
2040Sstevel@tonic-gate 	R0(C,D,A,B,X( 2),17,0x242070dbL);	HOST_c2l(data,l); X( 4)=l;
2050Sstevel@tonic-gate 	R0(B,C,D,A,X( 3),22,0xc1bdceeeL);	HOST_c2l(data,l); X( 5)=l;
2060Sstevel@tonic-gate 	R0(A,B,C,D,X( 4), 7,0xf57c0fafL);	HOST_c2l(data,l); X( 6)=l;
2070Sstevel@tonic-gate 	R0(D,A,B,C,X( 5),12,0x4787c62aL);	HOST_c2l(data,l); X( 7)=l;
2080Sstevel@tonic-gate 	R0(C,D,A,B,X( 6),17,0xa8304613L);	HOST_c2l(data,l); X( 8)=l;
2090Sstevel@tonic-gate 	R0(B,C,D,A,X( 7),22,0xfd469501L);	HOST_c2l(data,l); X( 9)=l;
2100Sstevel@tonic-gate 	R0(A,B,C,D,X( 8), 7,0x698098d8L);	HOST_c2l(data,l); X(10)=l;
2110Sstevel@tonic-gate 	R0(D,A,B,C,X( 9),12,0x8b44f7afL);	HOST_c2l(data,l); X(11)=l;
2120Sstevel@tonic-gate 	R0(C,D,A,B,X(10),17,0xffff5bb1L);	HOST_c2l(data,l); X(12)=l;
2130Sstevel@tonic-gate 	R0(B,C,D,A,X(11),22,0x895cd7beL);	HOST_c2l(data,l); X(13)=l;
2140Sstevel@tonic-gate 	R0(A,B,C,D,X(12), 7,0x6b901122L);	HOST_c2l(data,l); X(14)=l;
2150Sstevel@tonic-gate 	R0(D,A,B,C,X(13),12,0xfd987193L);	HOST_c2l(data,l); X(15)=l;
2160Sstevel@tonic-gate 	R0(C,D,A,B,X(14),17,0xa679438eL);
2170Sstevel@tonic-gate 	R0(B,C,D,A,X(15),22,0x49b40821L);
2180Sstevel@tonic-gate 	/* Round 1 */
2190Sstevel@tonic-gate 	R1(A,B,C,D,X( 1), 5,0xf61e2562L);
2200Sstevel@tonic-gate 	R1(D,A,B,C,X( 6), 9,0xc040b340L);
2210Sstevel@tonic-gate 	R1(C,D,A,B,X(11),14,0x265e5a51L);
2220Sstevel@tonic-gate 	R1(B,C,D,A,X( 0),20,0xe9b6c7aaL);
2230Sstevel@tonic-gate 	R1(A,B,C,D,X( 5), 5,0xd62f105dL);
2240Sstevel@tonic-gate 	R1(D,A,B,C,X(10), 9,0x02441453L);
2250Sstevel@tonic-gate 	R1(C,D,A,B,X(15),14,0xd8a1e681L);
2260Sstevel@tonic-gate 	R1(B,C,D,A,X( 4),20,0xe7d3fbc8L);
2270Sstevel@tonic-gate 	R1(A,B,C,D,X( 9), 5,0x21e1cde6L);
2280Sstevel@tonic-gate 	R1(D,A,B,C,X(14), 9,0xc33707d6L);
2290Sstevel@tonic-gate 	R1(C,D,A,B,X( 3),14,0xf4d50d87L);
2300Sstevel@tonic-gate 	R1(B,C,D,A,X( 8),20,0x455a14edL);
2310Sstevel@tonic-gate 	R1(A,B,C,D,X(13), 5,0xa9e3e905L);
2320Sstevel@tonic-gate 	R1(D,A,B,C,X( 2), 9,0xfcefa3f8L);
2330Sstevel@tonic-gate 	R1(C,D,A,B,X( 7),14,0x676f02d9L);
2340Sstevel@tonic-gate 	R1(B,C,D,A,X(12),20,0x8d2a4c8aL);
2350Sstevel@tonic-gate 	/* Round 2 */
2360Sstevel@tonic-gate 	R2(A,B,C,D,X( 5), 4,0xfffa3942L);
2370Sstevel@tonic-gate 	R2(D,A,B,C,X( 8),11,0x8771f681L);
2380Sstevel@tonic-gate 	R2(C,D,A,B,X(11),16,0x6d9d6122L);
2390Sstevel@tonic-gate 	R2(B,C,D,A,X(14),23,0xfde5380cL);
2400Sstevel@tonic-gate 	R2(A,B,C,D,X( 1), 4,0xa4beea44L);
2410Sstevel@tonic-gate 	R2(D,A,B,C,X( 4),11,0x4bdecfa9L);
2420Sstevel@tonic-gate 	R2(C,D,A,B,X( 7),16,0xf6bb4b60L);
2430Sstevel@tonic-gate 	R2(B,C,D,A,X(10),23,0xbebfbc70L);
2440Sstevel@tonic-gate 	R2(A,B,C,D,X(13), 4,0x289b7ec6L);
2450Sstevel@tonic-gate 	R2(D,A,B,C,X( 0),11,0xeaa127faL);
2460Sstevel@tonic-gate 	R2(C,D,A,B,X( 3),16,0xd4ef3085L);
2470Sstevel@tonic-gate 	R2(B,C,D,A,X( 6),23,0x04881d05L);
2480Sstevel@tonic-gate 	R2(A,B,C,D,X( 9), 4,0xd9d4d039L);
2490Sstevel@tonic-gate 	R2(D,A,B,C,X(12),11,0xe6db99e5L);
2500Sstevel@tonic-gate 	R2(C,D,A,B,X(15),16,0x1fa27cf8L);
2510Sstevel@tonic-gate 	R2(B,C,D,A,X( 2),23,0xc4ac5665L);
2520Sstevel@tonic-gate 	/* Round 3 */
2530Sstevel@tonic-gate 	R3(A,B,C,D,X( 0), 6,0xf4292244L);
2540Sstevel@tonic-gate 	R3(D,A,B,C,X( 7),10,0x432aff97L);
2550Sstevel@tonic-gate 	R3(C,D,A,B,X(14),15,0xab9423a7L);
2560Sstevel@tonic-gate 	R3(B,C,D,A,X( 5),21,0xfc93a039L);
2570Sstevel@tonic-gate 	R3(A,B,C,D,X(12), 6,0x655b59c3L);
2580Sstevel@tonic-gate 	R3(D,A,B,C,X( 3),10,0x8f0ccc92L);
2590Sstevel@tonic-gate 	R3(C,D,A,B,X(10),15,0xffeff47dL);
2600Sstevel@tonic-gate 	R3(B,C,D,A,X( 1),21,0x85845dd1L);
2610Sstevel@tonic-gate 	R3(A,B,C,D,X( 8), 6,0x6fa87e4fL);
2620Sstevel@tonic-gate 	R3(D,A,B,C,X(15),10,0xfe2ce6e0L);
2630Sstevel@tonic-gate 	R3(C,D,A,B,X( 6),15,0xa3014314L);
2640Sstevel@tonic-gate 	R3(B,C,D,A,X(13),21,0x4e0811a1L);
2650Sstevel@tonic-gate 	R3(A,B,C,D,X( 4), 6,0xf7537e82L);
2660Sstevel@tonic-gate 	R3(D,A,B,C,X(11),10,0xbd3af235L);
2670Sstevel@tonic-gate 	R3(C,D,A,B,X( 2),15,0x2ad7d2bbL);
2680Sstevel@tonic-gate 	R3(B,C,D,A,X( 9),21,0xeb86d391L);
2690Sstevel@tonic-gate 
2700Sstevel@tonic-gate 	A = c->A += A;
2710Sstevel@tonic-gate 	B = c->B += B;
2720Sstevel@tonic-gate 	C = c->C += C;
2730Sstevel@tonic-gate 	D = c->D += D;
2740Sstevel@tonic-gate 		}
2750Sstevel@tonic-gate 	}
2760Sstevel@tonic-gate #endif
2770Sstevel@tonic-gate 
2780Sstevel@tonic-gate #ifdef undef
printit(unsigned long * l)2790Sstevel@tonic-gate int printit(unsigned long *l)
2800Sstevel@tonic-gate 	{
2810Sstevel@tonic-gate 	int i,ii;
2820Sstevel@tonic-gate 
2830Sstevel@tonic-gate 	for (i=0; i<2; i++)
2840Sstevel@tonic-gate 		{
2850Sstevel@tonic-gate 		for (ii=0; ii<8; ii++)
2860Sstevel@tonic-gate 			{
2870Sstevel@tonic-gate 			fprintf(stderr,"%08lx ",l[i*8+ii]);
2880Sstevel@tonic-gate 			}
2890Sstevel@tonic-gate 		fprintf(stderr,"\n");
2900Sstevel@tonic-gate 		}
2910Sstevel@tonic-gate 	}
2920Sstevel@tonic-gate #endif
293