List Info

Thread: OpenSSL: openssl/crypto/aes/asm/ aes-x86_64.pl openssl/crypto/pe...




OpenSSL: openssl/crypto/aes/asm/ aes-x86_64.pl openssl/crypto/pe...
country flaguser name
Germany
2007-08-23 07:02:01
  OpenSSL CVS Repository
  http://cvs.openssl.org/
 
____________________________________________________________
________________

  Server: cvs.openssl.org                  Name:   Andy
Polyakov
  Root:   /v/openssl/cvs                   Email:  approopenssl.org
  Module: openssl                          Date:  
23-Aug-2007 14:02:00
  Branch: HEAD                             Handle:
2007082313015008

  Modified files:
    openssl/crypto          x86_64cpuid.pl
    openssl/crypto/aes/asm  aes-x86_64.pl
    openssl/crypto/perlasm  x86_64-xlate.pl
    openssl/crypto/sha/asm  sha512-x86_64.pl

  Log:
    Make x86_64 modules work under Win64/x64.

  Summary:
    Revision    Changes     Path
    1.12        +16 -11    
openssl/crypto/aes/asm/aes-x86_64.pl
    1.13        +12 -3     
openssl/crypto/perlasm/x86_64-xlate.pl
    1.4         +7  -1     
openssl/crypto/sha/asm/sha512-x86_64.pl
    1.8         +2  -2      openssl/crypto/x86_64cpuid.pl
 
____________________________________________________________
________________

  patch -p0 <<' .'
  Index: openssl/crypto/aes/asm/aes-x86_64.pl
 
============================================================
================
  $ cvs diff -u -r1.11 -r1.12 aes-x86_64.pl
  --- openssl/crypto/aes/asm/aes-x86_64.pl	30 Jul 2007
16:42:57 -0000	1.11
  +++ openssl/crypto/aes/asm/aes-x86_64.pl	23 Aug 2007
12:01:54 -0000	1.12
   -626,14 +626,13 
   
   	call	_x86_64_AES_encrypt_compact
   
  -	lea	16(%rsp),%rsp
  -	pop	$out		# restore out
  +	mov	16(%rsp),$out	# restore out
  +	mov	24(%rsp),%rsp
   	mov	$s0,0($out)	# write output vector
   	mov	$s1,4($out)
   	mov	$s2,8($out)
   	mov	$s3,12($out)
   
  -	mov	(%rsp),%rsp
   	pop	%r15
   	pop	%r14
   	pop	%r13
   -1217,19 +1216,18 
   	sub	$sbox,%rbp
   	and	$0x300,%rbp
   	lea	($sbox,%rbp),$sbox
  -	shr	$3,%rbp		# recall "magic" constants!
  +	shr	$3,%rbp	# recall "magic" constants!
   	add	%rbp,$sbox
   
   	call	_x86_64_AES_decrypt_compact
   
  -	lea	16(%rsp),%rsp
  -	pop	$out	# restore out
  -	mov	$s0,0($out)
  +	mov	16(%rsp),$out	# restore out
  +	mov	24(%rsp),%rsp
  +	mov	$s0,0($out)	# write output vector
   	mov	$s1,4($out)
   	mov	$s2,8($out)
   	mov	$s3,12($out)
   
  -	mov	(%rsp),%rsp
   	pop	%r15
   	pop	%r14
   	pop	%r13
   -1275,6 +1273,13 
   .type	AES_set_encrypt_key,function,3
   .align	16
   AES_set_encrypt_key:
  +	call	_x86_64_AES_set_encrypt_key
  +	ret
  +.size	AES_set_encrypt_key,.-AES_set_encrypt_key
  +
  +.type	_x86_64_AES_set_encrypt_key,abi-omnipotent
  +.align	16
  +_x86_64_AES_set_encrypt_key:
   	push	%rbx
   	push	%rbp
   
   -1461,8 +1466,8 
   .Lexit:
   	pop	%rbp
   	pop	%rbx
  -	ret
  -.size	AES_set_encrypt_key,.-AES_set_encrypt_key
  +	.byte	0xf3,0xc3			# rep ret
 
+.size	_x86_64_AES_set_encrypt_key,.-_x86_64_AES_set_encrypt
_key
   ___
   
   sub deckey_ref()
   -1527,7 +1532,7 
   .align	16
   AES_set_decrypt_key:
   	push	%rdx			# save key schedule
  -	call	AES_set_encrypt_key
  +	call	_x86_64_AES_set_encrypt_key
   	cmp	$0,%eax
   	pop	%r8			# restore key schedule
   	jne	.Labort
   .
  patch -p0 <<' .'
  Index: openssl/crypto/perlasm/x86_64-xlate.pl
 
============================================================
================
  $ cvs diff -u -r1.12 -r1.13 x86_64-xlate.pl
  --- openssl/crypto/perlasm/x86_64-xlate.pl	14 May 2007
15:57:19 -0000	1.12
  +++ openssl/crypto/perlasm/x86_64-xlate.pl	23 Aug 2007
12:01:57 -0000	1.13
   -85,6 +85,8 
   	    if ($self-> =~ /(movz)b.*/) {	# movz is
pain...
   		$self-> = $1;
   		$self-> = "b";
  +	    } elsif ($self-> =~ /call/) {
  +		$self-> = ""
   	    } elsif ($self-> =~ /([a-z]{3,})([qlwb])/) {
   		$self-> = $1;
   		$self-> = $2;
   -358,7 +360,7 
   				    $self-> = $v;
   				    last;
   				  };
  -		/.extern/  && do { $self-> =
"EXTRNt".$line; last;  };
  +		/.extern/  && do { $self-> =
"EXTRNt".$line.":BYTE"; last;  };
   		/.globl/   && do { $self-> =
"PUBLICt".$line; last; };
   		/.type/    && do { ($sym,$type,$narg) =
split(',',$line);
   				    if ($type eq "function") {
   -394,8 +396,15 
   				    last;
   				  };
   		/.asciz/   && do { if ($line =~
/^"(.*)"$/) {
  -					$self-> = "DBt"
  -						.join(",",unpack("C*",$1),0);
  +					my str=unpack("C*",$1);
  +					push str,0;
  +					while ($#str>15) {
  +					    $self->.="DBt"
  +						.join(",",str[0..15])."n";
  +					    foreach (0..15) { shift str; }
  +					}
  +					$self->.="DBt"
  +						.join(",",str) if (str);
   				    }
   				    last;
   				  };
   .
  patch -p0 <<' .'
  Index: openssl/crypto/sha/asm/sha512-x86_64.pl
 
============================================================
================
  $ cvs diff -u -r1.3 -r1.4 sha512-x86_64.pl
  --- openssl/crypto/sha/asm/sha512-x86_64.pl	17 Oct 2006
16:13:18 -0000	1.3
  +++ openssl/crypto/sha/asm/sha512-x86_64.pl	23 Aug 2007
12:01:58 -0000	1.4
   -41,7 +41,13 
   # apparently are not atomic instructions, but implemented
in microcode.
   
   $output=shift;
  -open STDOUT,"| $^X ../perlasm/x86_64-xlate.pl
$output";
  +
  +$0 =~ m/(.*[/\])[^/\]+$/; $dir=$1;
  +( $xlate="$x86_64-xlate.pl" and -f $xlate
) or
  +( $xlate="$../../perlasm/x86_64-xlate.pl"
and -f $xlate) or
  +die "can't locate x86_64-xlate.pl";
  +
  +open STDOUT,"| $^X $xlate $output";
   
   if ($output =~ /512/) {
   	$func="sha512_block_data_order";
   .
  patch -p0 <<' .'
  Index: openssl/crypto/x86_64cpuid.pl
 
============================================================
================
  $ cvs diff -u -r1.7 -r1.8 x86_64cpuid.pl
  --- openssl/crypto/x86_64cpuid.pl	21 Jul 2007 14:46:26
-0000	1.7
  +++ openssl/crypto/x86_64cpuid.pl	23 Aug 2007 12:01:50
-0000	1.8
   -136,11 +136,11 
   	cpuid
   	cmp	$0,%r9d
   	jne	.Lnotintel
  -	or	$1<<20,%edx		# use reserved bit to engage
RC4_CHAR
  +	or	$0x00100000,%edx	# use reserved 20th bit to engage
RC4_CHAR
   	and	$15,%ah
   	cmp	$15,%ah		# examine Family ID
   	je	.Lnotintel
  -	or	$1<<30,%edx		# use reserved bit to skip
unrolled loop
  +	or	$0x40000000,%edx	# use reserved bit to skip unrolled
loop
   .Lnotintel:
   	bt	$28,%edx		# test hyper-threading bit
   	jnc	.Ldone
   .
____________________________________________________________
__________
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 )