List Info

Thread: OpenSSL: openssl/crypto/sha/asm/ sha1-586.pl sha1-ia64.pl sha1-p...




OpenSSL: openssl/crypto/sha/asm/ sha1-586.pl sha1-ia64.pl sha1-p...
user name
2006-10-17 16:13:19
  OpenSSL CVS Repository
  http://cvs.openssl.org/
 
____________________________________________________________
________________

  Server: cvs.openssl.org                  Name:   Andy
Polyakov
  Root:   /v/openssl/cvs                   Email:  approopenssl.org
  Module: openssl                          Date:  
17-Oct-2006 18:13:18
  Branch: HEAD                             Handle:
2006101717131602

  Modified files:
    openssl/crypto/sha      sha256.c sha512.c sha_locl.h
    openssl/crypto/sha/asm  sha1-586.pl sha1-ia64.pl
sha1-ppc.pl
                            sha1-x86_64.pl sha512-ia64.pl
sha512-ppc.pl
                            sha512-x86_64.pl
  Removed files:
    openssl/crypto/sha      sha1s.cpp

  Log:
    Further synchronizations with md32_common.h update,
consistent naming
    for low-level SHA block routines.

  Summary:
    Revision    Changes     Path
    1.12        +2  -2     
openssl/crypto/sha/asm/sha1-586.pl
    1.5         +5  -5     
openssl/crypto/sha/asm/sha1-ia64.pl
    1.6         +2  -2     
openssl/crypto/sha/asm/sha1-ppc.pl
    1.3         +4  -2     
openssl/crypto/sha/asm/sha1-x86_64.pl
    1.5         +2  -2     
openssl/crypto/sha/asm/sha512-ia64.pl
    1.2         +2  -2     
openssl/crypto/sha/asm/sha512-ppc.pl
    1.3         +4  -25    
openssl/crypto/sha/asm/sha512-x86_64.pl
    1.4         +0  -82     openssl/crypto/sha/sha1s.cpp
    1.10        +6  -8      openssl/crypto/sha/sha256.c
    1.12        +9  -9      openssl/crypto/sha/sha512.c
    1.28        +9  -21     openssl/crypto/sha/sha_locl.h
 
____________________________________________________________
________________

  patch -p0 <<' .'
  Index: openssl/crypto/sha/asm/sha1-586.pl
 
============================================================
================
  $ cvs diff -u -r1.11 -r1.12 sha1-586.pl
  --- openssl/crypto/sha/asm/sha1-586.pl	17 Oct 2006
07:00:23 -0000	1.11
  +++ openssl/crypto/sha/asm/sha1-586.pl	17 Oct 2006
16:13:18 -0000	1.12
   -149,7 +149,7 
   	&add($f,$e);			# f+=ROTATE(a,5)
   	}
   
 
-&function_begin("sha1_block_asm_data_order",1
6);
 
+&function_begin("sha1_block_data_order",16);
   	&mov($tmp1,&wparam(0));	# SHA_CTX *c
   	&mov($T,&wparam(1));	# const void *input
   	&mov($A,&wparam(2));	# size_t num
   -214,7 +214,7 
   	&jb(&label("loop"));
   
   	&stack_pop(16);
  -&function_end("sha1_block_asm_data_order");
  +&function_end("sha1_block_data_order");
   &asciz("SHA1 block transform for x86, CRYPTOGAMS
by <approopenssl.org>");
   
   &asm_finish();
   .
  patch -p0 <<' .'
  Index: openssl/crypto/sha/asm/sha1-ia64.pl
 
============================================================
================
  $ cvs diff -u -r1.4 -r1.5 sha1-ia64.pl
  --- openssl/crypto/sha/asm/sha1-ia64.pl	17 Oct 2006
13:38:10 -0000	1.4
  +++ openssl/crypto/sha/asm/sha1-ia64.pl	17 Oct 2006
16:13:18 -0000	1.5
   -239,11 +239,11 
   ctx=r32;	// in0
   inp=r33;	// in1
   
  -// void sha1_block_asm_data_order(SHA_CTX *c,const void
*p,size_t num);
  -.global	sha1_block_asm_data_order#
  -.proc	sha1_block_asm_data_order#
  +// void sha1_block_data_order(SHA_CTX *c,const void
*p,size_t num);
  +.global	sha1_block_data_order#
  +.proc	sha1_block_data_order#
   .align	32
  -sha1_block_asm_data_order:
  +sha1_block_data_order:
   	.prologue
   { .mmi;	alloc	tmp1=ar.pfs,3,15,0,0
   	$ADDP	tmp0=4,ctx
   -306,7 +306,7 
   { .mib;	st4	[ctx]=$h4,-16
   	mov	pr=r2,0x1ffff
   	br.ret.sptk.many	b0	};;
  -.endp	sha1_block_asm_data_order#
  +.endp	sha1_block_data_order#
   ___
   
   print $code;
   .
  patch -p0 <<' .'
  Index: openssl/crypto/sha/asm/sha1-ppc.pl
 
============================================================
================
  $ cvs diff -u -r1.5 -r1.6 sha1-ppc.pl
  --- openssl/crypto/sha/asm/sha1-ppc.pl	17 Oct 2006
07:00:23 -0000	1.5
  +++ openssl/crypto/sha/asm/sha1-ppc.pl	17 Oct 2006
16:13:18 -0000	1.6
   -158,9 +158,9 
   $code=<<___;
   .text
   
  -.globl	.sha1_block_asm_data_order
  +.globl	.sha1_block_data_order
   .align	4
  -.sha1_block_asm_data_order:
  +.sha1_block_data_order:
   	mflr	r0
   	$STU	$sp,`-($FRAME+64)`($sp)
   	$PUSH	r0,`$FRAME-$SIZE_T*18`($sp)
   .
  patch -p0 <<' .'
  Index: openssl/crypto/sha/asm/sha1-x86_64.pl
 
============================================================
================
  $ cvs diff -u -r1.2 -r1.3 sha1-x86_64.pl
  --- openssl/crypto/sha/asm/sha1-x86_64.pl	17 Oct 2006
07:00:23 -0000	1.2
  +++ openssl/crypto/sha/asm/sha1-x86_64.pl	17 Oct 2006
16:13:18 -0000	1.3
   -158,6 +158,8 
   	rol	$30,$b
   	add	$t0,$f
   	rol	$1,$xi
  +___
  +$code.=<<___ if ($i<76);
   	mov	$xi,`4*($j%16)`(%rsp)
   ___
   $code.=<<___ if ($i==79);
   -200,7 +202,7 
   
   $code=".textn";
   
  -&PROLOGUE("sha1_block_asm_data_order");
  +&PROLOGUE("sha1_block_data_order");
   $code.=".align	4n.Lloop:n";
   for($i=0;$i<20;$i++)	{ &BODY_00_19($i,V);
unshift(V,pop(V)); }
   for(;$i<40;$i++)	{ &BODY_20_39($i,V);
unshift(V,pop(V)); }
   -227,7 +229,7 
   	sub	$1,$num
   	jnz	.Lloop
   ___
  -&EPILOGUE("sha1_block_asm_data_order");
  +&EPILOGUE("sha1_block_data_order");
   $code.=<<___;
   .asciz	"SHA1 block transform for x86_64, CRYPTOGAMS
by <approopenssl.org>"
   ___
   .
  patch -p0 <<' .'
  Index: openssl/crypto/sha/asm/sha512-ia64.pl
 
============================================================
================
  $ cvs diff -u -r1.4 -r1.5 sha512-ia64.pl
  --- openssl/crypto/sha/asm/sha512-ia64.pl	20 Jul 2005
15:15:22 -0000	1.4
  +++ openssl/crypto/sha/asm/sha512-ia64.pl	17 Oct 2006
16:13:18 -0000	1.5
   -71,7 +71,7 
   	$ADD="add";
   	$SHRU="shr.u";
   	$TABLE="K512";
  -	$func="sha512_block";
  +	$func="sha512_block_data_order";
   	Sigma0=(28,34,39);
   	Sigma1=(14,18,41);
   	sigma0=(1,  8, 7);
   -85,7 +85,7 
   	$ADD="padd4";
   	$SHRU="pshr4.u";
   	$TABLE="K256";
  -	$func="sha256_block";
  +	$func="sha256_block_data_order";
   	Sigma0=( 2,13,22);
   	Sigma1=( 6,11,25);
   	sigma0=( 7,18, 3);
   .
  patch -p0 <<' .'
  Index: openssl/crypto/sha/asm/sha512-ppc.pl
 
============================================================
================
  $ cvs diff -u -r1.1 -r1.2 sha512-ppc.pl
  --- openssl/crypto/sha/asm/sha512-ppc.pl	5 Jun 2006
09:37:55 -0000	1.1
  +++ openssl/crypto/sha/asm/sha512-ppc.pl	17 Oct 2006
16:13:18 -0000	1.2
   -41,7 +41,7 
   	die "can't call ../perlasm/ppc-xlate.pl: $!";
   
   if ($output =~ /512/) {
  -	$func="sha512_block";
  +	$func="sha512_block_data_order";
   	$SZ=8;
   	Sigma0=(28,34,39);
   	Sigma1=(14,18,41);
   -53,7 +53,7 
   	$ROR="rotrdi";
   	$SHR="srdi";
   } else {
  -	$func="sha256_block";
  +	$func="sha256_block_data_order";
   	$SZ=4;
   	Sigma0=( 2,13,22);
   	Sigma1=( 6,11,25);
   .
  patch -p0 <<' .'
  Index: openssl/crypto/sha/asm/sha512-x86_64.pl
 
============================================================
================
  $ cvs diff -u -r1.2 -r1.3 sha512-x86_64.pl
  --- openssl/crypto/sha/asm/sha512-x86_64.pl	25 Jul 2005
13:29:42 -0000	1.2
  +++ openssl/crypto/sha/asm/sha512-x86_64.pl	17 Oct 2006
16:13:18 -0000	1.3
   -44,7 +44,7 
   open STDOUT,"| $^X ../perlasm/x86_64-xlate.pl
$output";
   
   if ($output =~ /512/) {
  -	$func="sha512_block";
  +	$func="sha512_block_data_order";
   	$TABLE="K512";
   	$SZ=8;
   	ROT=($A,$B,$C,$D,$E,$F,$G,$H)=("%rax","
;%rbx","%rcx","%rdx",
   -56,7 +56,7 
   	sigma1=(19,61, 6);
   	$rounds=80;
   } else {
  -	$func="sha256_block";
  +	$func="sha256_block_data_order";
   	$TABLE="K256";
   	$SZ=4;
   	ROT=($A,$B,$C,$D,$E,$F,$G,$H)=("%eax","
;%ebx","%ecx","%edx",
   -77,9 +77,8 
   $_ctx="16*$SZ+0*8(%rsp)";
   $_inp="16*$SZ+1*8(%rsp)";
   $_end="16*$SZ+2*8(%rsp)";
  -$_ord="16*$SZ+3*8(%rsp)";
  -$_rsp="16*$SZ+4*8(%rsp)";
  -$framesz="16*$SZ+5*8";
  +$_rsp="16*$SZ+3*8(%rsp)";
  +$framesz="16*$SZ+4*8";
   
   
   sub ROUND_00_15()
   -189,7 +188,6 
   	mov	$ctx,$_ctx		# save ctx, 1st arg
   	mov	$inp,$_inp		# save inp, 2nd arh
   	mov	%rdx,$_end		# save end pointer, "3rd" arg
  -	mov	%ecx,$_ord		# save host, 4th arg
   	mov	%rbp,$_rsp		# save copy of %rsp
   
   	.picmeup $Tbl
   -209,25 +207,6 
   .Lloop:
   	xor	$round,$round
   ___
  -if ($SZ==4) {
  -$code.=<<___;
  -	cmpl	$0,$_ord
  -	je	.Ldata_order
  -.align	16
  -.Lhost_order:
  -___
  -
  -	for($i=0;$i<16;$i++) {
  -		$code.="	mov	$SZ*$i($inp),$T1n";
  -		&ROUND_00_15($i,ROT);
  -		unshift(ROT,pop(ROT));
  -	}
  -$code.=<<___;
  -	jmp	.Lrounds_16_xx
  -.align	16
  -.Ldata_order:
  -___
  -} # 256
   	for($i=0;$i<16;$i++) {
   		$code.="	mov	$SZ*$i($inp),$T1n";
   		$code.="	bswap	$T1n";
   .
  rm -f openssl/crypto/sha/sha1s.cpp <<' .'
  Index: openssl/crypto/sha/sha1s.cpp
 
============================================================
================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST
REMOVED]
   .
  patch -p0 <<' .'
  Index: openssl/crypto/sha/sha256.c
 
============================================================
================
  $ cvs diff -u -r1.9 -r1.10 sha256.c
  --- openssl/crypto/sha/sha256.c	11 Oct 2006 11:55:11
-0000	1.9
  +++ openssl/crypto/sha/sha256.c	17 Oct 2006 16:13:16
-0000	1.10
   -107,13 +107,14 
   #define	HASH_TRANSFORM		SHA256_Transform
   #define	HASH_FINAL		SHA256_Final
   #define	HASH_BLOCK_DATA_ORDER	sha256_block_data_order
  +#ifndef SHA256_ASM
  +static
  +#endif
   void sha256_block_data_order (SHA256_CTX *ctx, const void
*in, size_t num);
   
   #include "md32_common.h"
   
  -#ifdef SHA256_ASM
  -void sha256_block (SHA256_CTX *ctx, const void *in,
size_t num, int host);
  -#else
  +#ifndef SHA256_ASM
   static const SHA_LONG K256[64] = {
   	0x428a2f98UL,0x71374491UL,0xb5c0fbcfUL,0xe9b5dba5UL,
   	0x3956c25bUL,0x59f111f1UL,0x923f82a4UL,0xab1c5ed5UL,
   -147,7 +148,7 
   
   #ifdef OPENSSL_SMALL_FOOTPRINT
   
  -static void sha256_block (SHA256_CTX *ctx, const void
*in, size_t num, int host)
  +static void sha256_block_data_order (SHA256_CTX *ctx,
const void *in, size_t num)
   	{
   	unsigned MD32_REG_T a,b,c,d,e,f,g,h,s0,s1,T1,T2;
   	SHA_LONG	X[16],l;
   -199,7 +200,7 
   	T1 = X[(i)&0x0f] += s0 + s1 + X[(i+9)&0x0f];	
   	ROUND_00_15(i,a,b,c,d,e,f,g,h);		} while (0)
   
  -static void sha256_block (SHA256_CTX *ctx, const void
*in, size_t num, int host)
  +static void sha256_block_data_order (SHA256_CTX *ctx,
const void *in, size_t num)
   	{
   	unsigned MD32_REG_T a,b,c,d,e,f,g,h,s0,s1,T1;
   	SHA_LONG	X[16];
   -278,7 +279,4 
   #endif
   #endif /* SHA256_ASM */
   
  -void HASH_BLOCK_DATA_ORDER (SHA256_CTX *ctx, const void
*in, size_t num)
  -{   sha256_block (ctx,in,num,0);   }
  -
   #endif /* OPENSSL_NO_SHA256 */
   .
  patch -p0 <<' .'
  Index: openssl/crypto/sha/sha512.c
 
============================================================
================
  $ cvs diff -u -r1.11 -r1.12 sha512.c
  --- openssl/crypto/sha/sha512.c	1 May 2006 13:35:03
-0000	1.11
  +++ openssl/crypto/sha/sha512.c	17 Oct 2006 16:13:16
-0000	1.12
   -89,7 +89,7 
   #ifndef SHA512_ASM
   static
   #endif
  -void sha512_block (SHA512_CTX *ctx, const void *in,
size_t num);
  +void sha512_block_data_order (SHA512_CTX *ctx, const void
*in, size_t num);
   
   int SHA512_Final (unsigned char *md, SHA512_CTX *c)
   	{
   -100,7 +100,7 
   	n++;
   	if (n > (sizeof(c->u)-16))
   		memset (p+n,0,sizeof(c->u)-n), n=0,
  -		sha512_block (c,p,1);
  +		sha512_block_data_order (c,p,1);
   
   	memset (p+n,0,sizeof(c->u)-16-n);
   #ifdef	B_ENDIAN
   -125,7 +125,7 
   	p[sizeof(c->u)-16] = (unsigned
char)(c->Nh>>56);
   #endif
   
  -	sha512_block (c,p,1);
  +	sha512_block_data_order (c,p,1);
   
   	if (md==0) return 0;
   
   -197,7 +197,7 
   		else	{
   			memcpy (p+c->num,data,n), c->num = 0;
   			len-=n, data+=n;
  -			sha512_block (c,p,1);
  +			sha512_block_data_order (c,p,1);
   			}
   		}
   
   -207,12 +207,12 
   		if ((size_t)data%sizeof(c->u.d[0]) != 0)
   			while (len >= sizeof(c->u))
   				memcpy (p,data,sizeof(c->u)),
  -				sha512_block (c,p,1),
  +				sha512_block_data_order (c,p,1),
   				len  -= sizeof(c->u),
   				data += sizeof(c->u);
   		else
   #endif
  -			sha512_block (c,data,len/sizeof(c->u)),
  +			sha512_block_data_order (c,data,len/sizeof(c->u)),
   			data += len,
   			len  %= sizeof(c->u),
   			data -= len;
   -227,7 +227,7 
   {   return SHA512_Update (c,data,len);   }
   
   void SHA512_Transform (SHA512_CTX *c, const unsigned char
*data)
  -{   sha512_block (c,data,1);  }
  +{   sha512_block_data_order (c,data,1);  }
   
   unsigned char *SHA384(const unsigned char *d, size_t n,
unsigned char *md)
   	{
   -392,7 +392,7 
   
   #ifdef OPENSSL_SMALL_FOOTPRINT
   
  -static void sha512_block (SHA512_CTX *ctx, const void
*in, size_t num)
  +static void sha512_block_data_order (SHA512_CTX *ctx,
const void *in, size_t num)
   	{
   	const SHA_LONG64 *W=in;
   	SHA_LONG64	a,b,c,d,e,f,g,h,s0,s1,T1,T2;
   -453,7 +453,7 
   	T1 = X[(i)&0x0f] += s0 + s1 + X[(i+9)&0x0f];	
   	ROUND_00_15(i,a,b,c,d,e,f,g,h);		} while (0)
   
  -static void sha512_block (SHA512_CTX *ctx, const void
*in, size_t num)
  +static void sha512_block_data_order (SHA512_CTX *ctx,
const void *in, size_t num)
   	{
   	const SHA_LONG64 *W=in;
   	SHA_LONG64	a,b,c,d,e,f,g,h,s0,s1,T1;
   .
  patch -p0 <<' .'
  Index: openssl/crypto/sha/sha_locl.h
 
============================================================
================
  $ cvs diff -u -r1.27 -r1.28 sha_locl.h
  --- openssl/crypto/sha/sha_locl.h	11 Oct 2006 11:55:11
-0000	1.27
  +++ openssl/crypto/sha/sha_locl.h	17 Oct 2006 16:13:17
-0000	1.28
   -85,7 +85,7 
   # define HASH_BLOCK_DATA_ORDER   	sha_block_data_order
   # define Xupdate(a,ix,ia,ib,ic,id)	(ix=(a)=(ia^ib^ic^id))
   
  -  void sha_block_data_order (SHA_CTX *c, const void
*p,size_t num);
  +static void sha_block_data_order (SHA_CTX *c, const void
*p,size_t num);
   
   #elif defined(SHA_1)
   
   -105,22 +105,10 
   					)
   # endif
   
  -# ifdef SHA1_ASM
  -#  if defined(__i386) || defined(__i386__) ||
defined(_M_IX86) || defined(__INTEL__) 
  -   || defined(__x86_64) || defined(__x86_64__) ||
defined(_M_AMD64) || defined(_M_X64)
  -#   define
sha1_block_data_order		sha1_block_asm_data_order
  -#   define DONT_IMPLEMENT_BLOCK_DATA_ORDER
  -#  elif defined(__ia64) || defined(__ia64__) ||
defined(_M_IA64)
  -#   define
sha1_block_data_order		sha1_block_asm_data_order
  -#   define DONT_IMPLEMENT_BLOCK_DATA_ORDER
  -#  elif defined(_ARCH_PPC) || defined(_ARCH_PPC64) || 
  -	defined(__ppc) || defined(__ppc__) || defined(__powerpc)
|| 
  -	defined(__ppc64) || defined(__ppc64__) ||
defined(__powerpc64)
  -#   define
sha1_block_data_order		sha1_block_asm_data_order
  -#   define DONT_IMPLEMENT_BLOCK_DATA_ORDER
  -#  endif
  -# endif
  -  void sha1_block_data_order (SHA_CTX *c, const void
*p,size_t num);
  +#ifndef SHA1_ASM
  +static
  +#endif
  +void sha1_block_data_order (SHA_CTX *c, const void
*p,size_t num);
   
   #else
   # error "Either SHA_0 or SHA_1 must be
defined."
   -216,8 +204,8 
   # define X(i)	XX[i]
   #endif
   
  -#ifndef DONT_IMPLEMENT_BLOCK_DATA_ORDER
  -void HASH_BLOCK_DATA_ORDER (SHA_CTX *c, const void *p,
size_t num)
  +#if !defined(SHA_1) || !defined(SHA1_ASM)
  +static void HASH_BLOCK_DATA_ORDER (SHA_CTX *c, const void
*p, size_t num)
   	{
   	const unsigned char *data=p;
   	register unsigned MD32_REG_T A,B,C,D,E,T,l;
   -416,8 +404,8 
   	E=D, D=C, C=ROTATE(B,30), B=A;	
   	A=ROTATE(A,5)+T+xa;	    } while(0)
   
  -#ifndef DONT_IMPLEMENT_BLOCK_DATA_ORDER
  -void HASH_BLOCK_DATA_ORDER (SHA_CTX *c, const void *p,
size_t num)
  +#if !defined(SHA_1) || !defined(SHA1_ASM)
  +static void HASH_BLOCK_DATA_ORDER (SHA_CTX *c, const void
*p, size_t num)
   	{
   	const unsigned char *data=p;
   	register unsigned MD32_REG_T A,B,C,D,E,T,l;
   .
____________________________________________________________
__________
OpenSSL Project                                 http://www.openssl.org
CVS Repository Commit List                    
openssl-cvsopenssl.org
Automated List Manager                          
majordomoopenssl.org
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )