diff options
author | miod <> | 2014-04-13 15:16:40 +0000 |
---|---|---|
committer | miod <> | 2014-04-13 15:16:40 +0000 |
commit | 52628ee3f51f011b463aaedb1a28aa0524b43cb3 (patch) | |
tree | 4bd2adeac981051908ec5756401424bbb4e57d6a /src/lib/libcrypto/modes/asm | |
parent | 40c22d3625a3818690c889ed6216fedf2be522c9 (diff) | |
download | openbsd-52628ee3f51f011b463aaedb1a28aa0524b43cb3.tar.gz openbsd-52628ee3f51f011b463aaedb1a28aa0524b43cb3.tar.bz2 openbsd-52628ee3f51f011b463aaedb1a28aa0524b43cb3.zip |
Import OpenSSL 1.0.1g
Diffstat (limited to 'src/lib/libcrypto/modes/asm')
-rw-r--r-- | src/lib/libcrypto/modes/asm/ghash-alpha.pl | 25 | ||||
-rw-r--r-- | src/lib/libcrypto/modes/asm/ghash-parisc.pl | 1 | ||||
-rw-r--r-- | src/lib/libcrypto/modes/asm/ghash-x86.pl | 6 | ||||
-rw-r--r-- | src/lib/libcrypto/modes/asm/ghash-x86_64.pl | 3 |
4 files changed, 23 insertions, 12 deletions
diff --git a/src/lib/libcrypto/modes/asm/ghash-alpha.pl b/src/lib/libcrypto/modes/asm/ghash-alpha.pl index 6358b2750f..aa36029386 100644 --- a/src/lib/libcrypto/modes/asm/ghash-alpha.pl +++ b/src/lib/libcrypto/modes/asm/ghash-alpha.pl | |||
@@ -266,8 +266,8 @@ gcm_gmult_4bit: | |||
266 | ldq $Xlo,8($Xi) | 266 | ldq $Xlo,8($Xi) |
267 | ldq $Xhi,0($Xi) | 267 | ldq $Xhi,0($Xi) |
268 | 268 | ||
269 | br $rem_4bit,.Lpic1 | 269 | bsr $t0,picmeup |
270 | .Lpic1: lda $rem_4bit,rem_4bit-.Lpic1($rem_4bit) | 270 | nop |
271 | ___ | 271 | ___ |
272 | 272 | ||
273 | &loop(); | 273 | &loop(); |
@@ -341,8 +341,8 @@ gcm_ghash_4bit: | |||
341 | ldq $Xhi,0($Xi) | 341 | ldq $Xhi,0($Xi) |
342 | ldq $Xlo,8($Xi) | 342 | ldq $Xlo,8($Xi) |
343 | 343 | ||
344 | br $rem_4bit,.Lpic2 | 344 | bsr $t0,picmeup |
345 | .Lpic2: lda $rem_4bit,rem_4bit-.Lpic2($rem_4bit) | 345 | nop |
346 | 346 | ||
347 | .Louter: | 347 | .Louter: |
348 | extql $inhi,$inp,$inhi | 348 | extql $inhi,$inp,$inhi |
@@ -436,11 +436,20 @@ $code.=<<___; | |||
436 | .end gcm_ghash_4bit | 436 | .end gcm_ghash_4bit |
437 | 437 | ||
438 | .align 4 | 438 | .align 4 |
439 | .ent picmeup | ||
440 | picmeup: | ||
441 | .frame sp,0,$t0 | ||
442 | .prologue 0 | ||
443 | br $rem_4bit,.Lpic | ||
444 | .Lpic: lda $rem_4bit,12($rem_4bit) | ||
445 | ret ($t0) | ||
446 | .end picmeup | ||
447 | nop | ||
439 | rem_4bit: | 448 | rem_4bit: |
440 | .quad 0x0000<<48, 0x1C20<<48, 0x3840<<48, 0x2460<<48 | 449 | .long 0,0x0000<<16, 0,0x1C20<<16, 0,0x3840<<16, 0,0x2460<<16 |
441 | .quad 0x7080<<48, 0x6CA0<<48, 0x48C0<<48, 0x54E0<<48 | 450 | .long 0,0x7080<<16, 0,0x6CA0<<16, 0,0x48C0<<16, 0,0x54E0<<16 |
442 | .quad 0xE100<<48, 0xFD20<<48, 0xD940<<48, 0xC560<<48 | 451 | .long 0,0xE100<<16, 0,0xFD20<<16, 0,0xD940<<16, 0,0xC560<<16 |
443 | .quad 0x9180<<48, 0x8DA0<<48, 0xA9C0<<48, 0xB5E0<<48 | 452 | .long 0,0x9180<<16, 0,0x8DA0<<16, 0,0xA9C0<<16, 0,0xB5E0<<16 |
444 | .ascii "GHASH for Alpha, CRYPTOGAMS by <appro\@openssl.org>" | 453 | .ascii "GHASH for Alpha, CRYPTOGAMS by <appro\@openssl.org>" |
445 | .align 4 | 454 | .align 4 |
446 | 455 | ||
diff --git a/src/lib/libcrypto/modes/asm/ghash-parisc.pl b/src/lib/libcrypto/modes/asm/ghash-parisc.pl index 8c7454ee93..d5ad96b403 100644 --- a/src/lib/libcrypto/modes/asm/ghash-parisc.pl +++ b/src/lib/libcrypto/modes/asm/ghash-parisc.pl | |||
@@ -724,6 +724,7 @@ foreach (split("\n",$code)) { | |||
724 | s/cmpb,\*/comb,/; | 724 | s/cmpb,\*/comb,/; |
725 | s/,\*/,/; | 725 | s/,\*/,/; |
726 | } | 726 | } |
727 | s/\bbv\b/bve/ if ($SIZE_T==8); | ||
727 | print $_,"\n"; | 728 | print $_,"\n"; |
728 | } | 729 | } |
729 | 730 | ||
diff --git a/src/lib/libcrypto/modes/asm/ghash-x86.pl b/src/lib/libcrypto/modes/asm/ghash-x86.pl index 6b09669d47..83c727e07f 100644 --- a/src/lib/libcrypto/modes/asm/ghash-x86.pl +++ b/src/lib/libcrypto/modes/asm/ghash-x86.pl | |||
@@ -635,7 +635,7 @@ sub mmx_loop() { | |||
635 | { my @lo = ("mm0","mm1","mm2"); | 635 | { my @lo = ("mm0","mm1","mm2"); |
636 | my @hi = ("mm3","mm4","mm5"); | 636 | my @hi = ("mm3","mm4","mm5"); |
637 | my @tmp = ("mm6","mm7"); | 637 | my @tmp = ("mm6","mm7"); |
638 | my $off1=0,$off2=0,$i; | 638 | my ($off1,$off2,$i) = (0,0,); |
639 | 639 | ||
640 | &add ($Htbl,128); # optimize for size | 640 | &add ($Htbl,128); # optimize for size |
641 | &lea ("edi",&DWP(16+128,"esp")); | 641 | &lea ("edi",&DWP(16+128,"esp")); |
@@ -883,7 +883,7 @@ sub reduction_alg9 { # 17/13 times faster than Intel version | |||
883 | my ($Xhi,$Xi) = @_; | 883 | my ($Xhi,$Xi) = @_; |
884 | 884 | ||
885 | # 1st phase | 885 | # 1st phase |
886 | &movdqa ($T1,$Xi) # | 886 | &movdqa ($T1,$Xi); # |
887 | &psllq ($Xi,1); | 887 | &psllq ($Xi,1); |
888 | &pxor ($Xi,$T1); # | 888 | &pxor ($Xi,$T1); # |
889 | &psllq ($Xi,5); # | 889 | &psllq ($Xi,5); # |
@@ -1019,7 +1019,7 @@ my ($Xhi,$Xi) = @_; | |||
1019 | &movdqa ($Xhn,$Xn); | 1019 | &movdqa ($Xhn,$Xn); |
1020 | &pxor ($Xhi,$T1); # "Ii+Xi", consume early | 1020 | &pxor ($Xhi,$T1); # "Ii+Xi", consume early |
1021 | 1021 | ||
1022 | &movdqa ($T1,$Xi) #&reduction_alg9($Xhi,$Xi); 1st phase | 1022 | &movdqa ($T1,$Xi); #&reduction_alg9($Xhi,$Xi); 1st phase |
1023 | &psllq ($Xi,1); | 1023 | &psllq ($Xi,1); |
1024 | &pxor ($Xi,$T1); # | 1024 | &pxor ($Xi,$T1); # |
1025 | &psllq ($Xi,5); # | 1025 | &psllq ($Xi,5); # |
diff --git a/src/lib/libcrypto/modes/asm/ghash-x86_64.pl b/src/lib/libcrypto/modes/asm/ghash-x86_64.pl index a5ae180882..38d779edbc 100644 --- a/src/lib/libcrypto/modes/asm/ghash-x86_64.pl +++ b/src/lib/libcrypto/modes/asm/ghash-x86_64.pl | |||
@@ -50,7 +50,8 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; | |||
50 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or | 50 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or |
51 | die "can't locate x86_64-xlate.pl"; | 51 | die "can't locate x86_64-xlate.pl"; |
52 | 52 | ||
53 | open STDOUT,"| $^X $xlate $flavour $output"; | 53 | open OUT,"| \"$^X\" $xlate $flavour $output"; |
54 | *STDOUT=*OUT; | ||
54 | 55 | ||
55 | # common register layout | 56 | # common register layout |
56 | $nlo="%rax"; | 57 | $nlo="%rax"; |