Ticket #50771: change-binary-literals-to-hex.patch
File change-binary-literals-to-hex.patch, 10.0 KB (added by jmroot (Joshua Root), 9 years ago) |
---|
-
crypto/sha/asm/sha1-x86_64.pl
old new 357 357 movdqa K_XX_XX+0xa0(%rip),$BSWAP # byte-n-word swap 358 358 359 359 movdqu ($inp),@MSG[0] 360 pshufd \$0 b00011011,$ABCD,$ABCD # flip word order360 pshufd \$0x1b,$ABCD,$ABCD # flip word order 361 361 movdqu 0x10($inp),@MSG[1] 362 pshufd \$0 b00011011,$E,$E # flip word order362 pshufd \$0x1b,$E,$E # flip word order 363 363 movdqu 0x20($inp),@MSG[2] 364 364 pshufb $BSWAP,@MSG[0] 365 365 movdqu 0x30($inp),@MSG[3] … … 425 425 426 426 jnz .Loop_shaext 427 427 428 pshufd \$0 b00011011,$ABCD,$ABCD429 pshufd \$0 b00011011,$E,$E428 pshufd \$0x1b,$ABCD,$ABCD 429 pshufd \$0x1b,$E,$E 430 430 movdqu $ABCD,($ctx) 431 431 movd $E,16($ctx) 432 432 ___ -
crypto/sha/asm/sha1-mb-x86_64.pl
old new 569 569 punpcklqdq @MSG0[1],$ABCD0 # d0.c0.b0.a0 570 570 punpckhqdq @MSG0[1],$ABCD1 # d1.c1.b1.a1 571 571 572 pshufd \$0 b00111111,@MSG0[3],$E0573 pshufd \$0 b01111111,@MSG0[3],$E1574 pshufd \$0 b00011011,$ABCD0,$ABCD0575 pshufd \$0 b00011011,$ABCD1,$ABCD1572 pshufd \$0x3f,@MSG0[3],$E0 573 pshufd \$0x7f,@MSG0[3],$E1 574 pshufd \$0x1b,$ABCD0,$ABCD0 575 pshufd \$0x1b,$ABCD1,$ABCD1 576 576 jmp .Loop_shaext 577 577 578 578 .align 32 … … 710 710 711 711 mov `$REG_SZ*17+8`(%rsp),$num 712 712 713 pshufd \$0 b00011011,$ABCD0,$ABCD0714 pshufd \$0 b00011011,$ABCD1,$ABCD1713 pshufd \$0x1b,$ABCD0,$ABCD0 714 pshufd \$0x1b,$ABCD1,$ABCD1 715 715 716 716 movdqa $ABCD0,@MSG0[0] 717 717 punpckldq $ABCD1,$ABCD0 # b1.b0.a1.a0 -
crypto/sha/asm/sha256-mb-x86_64.pl
old new 482 482 punpckhqdq @MSG1[0],$ABEF1 # F1.E1.B1.A1 483 483 punpckhqdq @MSG1[2],$CDGH1 # H1.G1.D1.C1 484 484 485 pshufd \$0 b00011011,$ABEF0,$ABEF0486 pshufd \$0 b00011011,$CDGH0,$CDGH0487 pshufd \$0 b00011011,$ABEF1,$ABEF1488 pshufd \$0 b00011011,$CDGH1,$CDGH1485 pshufd \$0x1b,$ABEF0,$ABEF0 486 pshufd \$0x1b,$CDGH0,$CDGH0 487 pshufd \$0x1b,$ABEF1,$ABEF1 488 pshufd \$0x1b,$CDGH1,$CDGH1 489 489 jmp .Loop_shaext 490 490 491 491 .align 32 … … 702 702 703 703 mov `$REG_SZ*17+8`(%rsp),$num 704 704 705 pshufd \$0 b00011011,$ABEF0,$ABEF0706 pshufd \$0 b00011011,$CDGH0,$CDGH0707 pshufd \$0 b00011011,$ABEF1,$ABEF1708 pshufd \$0 b00011011,$CDGH1,$CDGH1705 pshufd \$0x1b,$ABEF0,$ABEF0 706 pshufd \$0x1b,$CDGH0,$CDGH0 707 pshufd \$0x1b,$ABEF1,$ABEF1 708 pshufd \$0x1b,$CDGH1,$CDGH1 709 709 710 710 movdqa $ABEF0,@MSG0[0] 711 711 movdqa $CDGH0,@MSG0[1] -
crypto/aes/asm/aesni-x86_64.pl
old new 3633 3633 $movkey %xmm0,(%rax) 3634 3634 lea 16(%rax),%rax 3635 3635 .Lkey_expansion_128_cold: 3636 shufps \$0 b00010000,%xmm0,%xmm43636 shufps \$0x10,%xmm0,%xmm4 3637 3637 xorps %xmm4, %xmm0 3638 shufps \$0 b10001100,%xmm0,%xmm43638 shufps \$0x8c,%xmm0,%xmm4 3639 3639 xorps %xmm4, %xmm0 3640 shufps \$0 b11111111,%xmm1,%xmm1 # critical path3640 shufps \$0xff,%xmm1,%xmm1 # critical path 3641 3641 xorps %xmm1,%xmm0 3642 3642 ret 3643 3643 … … 3648 3648 .Lkey_expansion_192a_cold: 3649 3649 movaps %xmm2, %xmm5 3650 3650 .Lkey_expansion_192b_warm: 3651 shufps \$0 b00010000,%xmm0,%xmm43651 shufps \$0x10,%xmm0,%xmm4 3652 3652 movdqa %xmm2,%xmm3 3653 3653 xorps %xmm4,%xmm0 3654 shufps \$0 b10001100,%xmm0,%xmm43654 shufps \$0x8c,%xmm0,%xmm4 3655 3655 pslldq \$4,%xmm3 3656 3656 xorps %xmm4,%xmm0 3657 pshufd \$0 b01010101,%xmm1,%xmm1 # critical path3657 pshufd \$0x55,%xmm1,%xmm1 # critical path 3658 3658 pxor %xmm3,%xmm2 3659 3659 pxor %xmm1,%xmm0 3660 pshufd \$0 b11111111,%xmm0,%xmm33660 pshufd \$0xff,%xmm0,%xmm3 3661 3661 pxor %xmm3,%xmm2 3662 3662 ret 3663 3663 3664 3664 .align 16 3665 3665 .Lkey_expansion_192b: 3666 3666 movaps %xmm0,%xmm3 3667 shufps \$0 b01000100,%xmm0,%xmm53667 shufps \$0x44,%xmm0,%xmm5 3668 3668 $movkey %xmm5,(%rax) 3669 shufps \$0 b01001110,%xmm2,%xmm33669 shufps \$0x4e,%xmm2,%xmm3 3670 3670 $movkey %xmm3,16(%rax) 3671 3671 lea 32(%rax),%rax 3672 3672 jmp .Lkey_expansion_192b_warm … … 3676 3676 $movkey %xmm2,(%rax) 3677 3677 lea 16(%rax),%rax 3678 3678 .Lkey_expansion_256a_cold: 3679 shufps \$0 b00010000,%xmm0,%xmm43679 shufps \$0x10,%xmm0,%xmm4 3680 3680 xorps %xmm4,%xmm0 3681 shufps \$0 b10001100,%xmm0,%xmm43681 shufps \$0x8c,%xmm0,%xmm4 3682 3682 xorps %xmm4,%xmm0 3683 shufps \$0 b11111111,%xmm1,%xmm1 # critical path3683 shufps \$0xff,%xmm1,%xmm1 # critical path 3684 3684 xorps %xmm1,%xmm0 3685 3685 ret 3686 3686 … … 3689 3689 $movkey %xmm0,(%rax) 3690 3690 lea 16(%rax),%rax 3691 3691 3692 shufps \$0 b00010000,%xmm2,%xmm43692 shufps \$0x10,%xmm2,%xmm4 3693 3693 xorps %xmm4,%xmm2 3694 shufps \$0 b10001100,%xmm2,%xmm43694 shufps \$0x8c,%xmm2,%xmm4 3695 3695 xorps %xmm4,%xmm2 3696 shufps \$0 b10101010,%xmm1,%xmm1 # critical path3696 shufps \$0xaa,%xmm1,%xmm1 # critical path 3697 3697 xorps %xmm1,%xmm2 3698 3698 ret 3699 3699 .size ${PREFIX}_set_encrypt_key,.-${PREFIX}_set_encrypt_key -
crypto/aes/asm/aesni-sha1-x86_64.pl
old new 1705 1705 movups 16($key),$rndkey[0] # forward reference 1706 1706 lea 112($key),$key # size optimization 1707 1707 1708 pshufd \$0 b00011011,$ABCD,$ABCD # flip word order1709 pshufd \$0 b00011011,$E,$E # flip word order1708 pshufd \$0x1b,$ABCD,$ABCD # flip word order 1709 pshufd \$0x1b,$E,$E # flip word order 1710 1710 jmp .Loop_shaext 1711 1711 1712 1712 .align 16 … … 1806 1806 lea 64($in0),$in0 1807 1807 jnz .Loop_shaext 1808 1808 1809 pshufd \$0 b00011011,$ABCD,$ABCD1810 pshufd \$0 b00011011,$E,$E1809 pshufd \$0x1b,$ABCD,$ABCD 1810 pshufd \$0x1b,$E,$E 1811 1811 movups $iv,($ivp) # write IV 1812 1812 movdqu $ABCD,($ctx) 1813 1813 movd $E,16($ctx) -
crypto/modes/asm/ghash-x86_64.pl
old new 419 419 if (!defined($HK)) { $HK = $T2; 420 420 $code.=<<___; 421 421 movdqa $Xi,$Xhi # 422 pshufd \$0 b01001110,$Xi,$T1423 pshufd \$0 b01001110,$Hkey,$T2422 pshufd \$0x4e,$Xi,$T1 423 pshufd \$0x4e,$Hkey,$T2 424 424 pxor $Xi,$T1 # 425 425 pxor $Hkey,$T2 426 426 ___ 427 427 } else { 428 428 $code.=<<___; 429 429 movdqa $Xi,$Xhi # 430 pshufd \$0 b01001110,$Xi,$T1430 pshufd \$0x4e,$Xi,$T1 431 431 pxor $Xi,$T1 # 432 432 ___ 433 433 } … … 494 494 ___ 495 495 $code.=<<___; 496 496 movdqu ($Xip),$Hkey 497 pshufd \$0 b01001110,$Hkey,$Hkey # dword swap497 pshufd \$0x4e,$Hkey,$Hkey # dword swap 498 498 499 499 # <<1 twist 500 pshufd \$0 b11111111,$Hkey,$T2 # broadcast uppermost dword500 pshufd \$0xff,$Hkey,$T2 # broadcast uppermost dword 501 501 movdqa $Hkey,$T1 502 502 psllq \$1,$Hkey 503 503 pxor $T3,$T3 # … … 511 511 pxor $T3,$Hkey # if(carry) H^=0x1c2_polynomial 512 512 513 513 # calculate H^2 514 pshufd \$0 b01001110,$Hkey,$HK514 pshufd \$0x4e,$Hkey,$HK 515 515 movdqa $Hkey,$Xi 516 516 pxor $Hkey,$HK 517 517 ___ 518 518 &clmul64x64_T2 ($Xhi,$Xi,$Hkey,$HK); 519 519 &reduction_alg9 ($Xhi,$Xi); 520 520 $code.=<<___; 521 pshufd \$0 b01001110,$Hkey,$T1522 pshufd \$0 b01001110,$Xi,$T2521 pshufd \$0x4e,$Hkey,$T1 522 pshufd \$0x4e,$Xi,$T2 523 523 pxor $Hkey,$T1 # Karatsuba pre-processing 524 524 movdqu $Hkey,0x00($Htbl) # save H 525 525 pxor $Xi,$T2 # Karatsuba pre-processing … … 536 536 &clmul64x64_T2 ($Xhi,$Xi,$Hkey,$HK); # H^4 537 537 &reduction_alg9 ($Xhi,$Xi); 538 538 $code.=<<___; 539 pshufd \$0 b01001110,$T3,$T1540 pshufd \$0 b01001110,$Xi,$T2539 pshufd \$0x4e,$T3,$T1 540 pshufd \$0x4e,$Xi,$T2 541 541 pxor $T3,$T1 # Karatsuba pre-processing 542 542 movdqu $T3,0x30($Htbl) # save H^3 543 543 pxor $Xi,$T2 # Karatsuba pre-processing … … 669 669 pshufb $T3,$Xln 670 670 pshufb $T3,$Xl 671 671 movdqa $Xln,$Xhn 672 pshufd \$0 b01001110,$Xln,$Xmn672 pshufd \$0x4e,$Xln,$Xmn 673 673 pxor $Xln,$Xmn 674 674 pclmulqdq \$0x00,$Hkey,$Xln 675 675 pclmulqdq \$0x11,$Hkey,$Xhn 676 676 pclmulqdq \$0x00,$HK,$Xmn 677 677 678 678 movdqa $Xl,$Xh 679 pshufd \$0 b01001110,$Xl,$Xm679 pshufd \$0x4e,$Xl,$Xm 680 680 pxor $Xl,$Xm 681 681 pclmulqdq \$0x00,$Hkey2,$Xl 682 682 pclmulqdq \$0x11,$Hkey2,$Xh … … 691 691 pshufb $T3,$Xl 692 692 pshufb $T3,$T1 693 693 movdqa $Xl,$Xh 694 pshufd \$0 b01001110,$Xl,$Xm694 pshufd \$0x4e,$Xl,$Xm 695 695 pxor $T1,$Xi 696 696 pxor $Xl,$Xm 697 697 pclmulqdq \$0x00,$Hkey3,$Xl 698 698 movdqa $Xi,$Xhi 699 pshufd \$0 b01001110,$Xi,$T1699 pshufd \$0x4e,$Xi,$T1 700 700 pxor $Xi,$T1 701 701 pclmulqdq \$0x11,$Hkey3,$Xh 702 702 pclmulqdq \$0x00,$HK,$Xm … … 719 719 movdqu 0x20($inp),$Xln 720 720 movdqa $Xl,$Xh 721 721 pclmulqdq \$0x10,$HK,$T1 722 pshufd \$0 b01001110,$Xl,$Xm722 pshufd \$0x4e,$Xl,$Xm 723 723 xorps $Xhn,$Xhi 724 724 pxor $Xl,$Xm 725 725 pshufb $T3,$Xln 726 726 movups 0x20($Htbl),$HK 727 727 xorps $Xmn,$T1 728 728 pclmulqdq \$0x00,$Hkey,$Xl 729 pshufd \$0 b01001110,$Xln,$Xmn729 pshufd \$0x4e,$Xln,$Xmn 730 730 731 731 pxor $Xi,$T1 # aggregated Karatsuba post-processing 732 732 movdqa $Xln,$Xhn … … 770 770 771 771 movdqa $Xl,$Xh 772 772 pxor $Xm,$Xmn 773 pshufd \$0 b01001110,$Xl,$Xm773 pshufd \$0x4e,$Xl,$Xm 774 774 pxor $T2,$Xi # 775 775 pxor $T1,$Xhi 776 776 pxor $Xl,$Xm … … 780 780 movdqa $Xi,$Xhi 781 781 pclmulqdq \$0x11,$Hkey3,$Xh 782 782 xorps $Xl,$Xln 783 pshufd \$0 b01001110,$Xi,$T1783 pshufd \$0x4e,$Xi,$T1 784 784 pxor $Xi,$T1 785 785 786 786 pclmulqdq \$0x00,$HK,$Xm … … 832 832 pxor $T1,$Xi # Ii+Xi 833 833 834 834 movdqa $Xln,$Xhn 835 pshufd \$0 b01001110,$Xln,$Xmn835 pshufd \$0x4e,$Xln,$Xmn 836 836 pxor $Xln,$Xmn 837 837 pclmulqdq \$0x00,$Hkey,$Xln 838 838 pclmulqdq \$0x11,$Hkey,$Xhn … … 849 849 .Lmod_loop: 850 850 movdqa $Xi,$Xhi 851 851 movdqa $Xmn,$T1 852 pshufd \$0 b01001110,$Xi,$Xmn #852 pshufd \$0x4e,$Xi,$Xmn # 853 853 pxor $Xi,$Xmn # 854 854 855 855 pclmulqdq \$0x00,$Hkey2,$Xi … … 887 887 pslldq \$8,$Xi 888 888 psrldq \$8,$T1 # 889 889 pxor $T2,$Xi 890 pshufd \$0 b01001110,$Xhn,$Xmn890 pshufd \$0x4e,$Xhn,$Xmn 891 891 pxor $T1,$Xhi # 892 892 pxor $Xhn,$Xmn # 893 893 … … 909 909 .Leven_tail: 910 910 movdqa $Xi,$Xhi 911 911 movdqa $Xmn,$T1 912 pshufd \$0 b01001110,$Xi,$Xmn #912 pshufd \$0x4e,$Xi,$Xmn # 913 913 pxor $Xi,$Xmn # 914 914 915 915 pclmulqdq \$0x00,$Hkey2,$Xi … … 984 984 vzeroupper 985 985 986 986 vmovdqu ($Xip),$Hkey 987 vpshufd \$0 b01001110,$Hkey,$Hkey # dword swap987 vpshufd \$0x4e,$Hkey,$Hkey # dword swap 988 988 989 989 # <<1 twist 990 vpshufd \$0 b11111111,$Hkey,$T2 # broadcast uppermost dword990 vpshufd \$0xff,$Hkey,$T2 # broadcast uppermost dword 991 991 vpsrlq \$63,$Hkey,$T1 992 992 vpsllq \$1,$Hkey,$Hkey 993 993 vpxor $T3,$T3,$T3 # … … 1075 1075 &clmul64x64_avx ($Xhi,$Xi,$Hkey,$HK); # calculate H^2,4,6,8 1076 1076 &reduction_avx ($Xhi,$Xi); 1077 1077 $code.=<<___; 1078 vpshufd \$0 b01001110,$T3,$T11079 vpshufd \$0 b01001110,$Xi,$T21078 vpshufd \$0x4e,$T3,$T1 1079 vpshufd \$0x4e,$Xi,$T2 1080 1080 vpxor $T3,$T1,$T1 # Karatsuba pre-processing 1081 1081 vmovdqu $T3,0x00($Htbl) # save H^1,3,5,7 1082 1082 vpxor $Xi,$T2,$T2 # Karatsuba pre-processing