Backport aes-x86_64.pl update from HEAD and revisit same code in aes-586.pl.
authorAndy Polyakov <appro@openssl.org>
Wed, 17 Dec 2008 14:14:51 +0000 (14:14 +0000)
committerAndy Polyakov <appro@openssl.org>
Wed, 17 Dec 2008 14:14:51 +0000 (14:14 +0000)
PR: 1801

crypto/aes/asm/aes-586.pl
crypto/aes/asm/aes-x86_64.pl

index 89fa2617944b5658a967f2557667929c508eafef..3bc46a968e37c768fe5465c2dd32f56c03c771b0 100755 (executable)
@@ -955,8 +955,9 @@ my $mark=&DWP(60+240,"esp");        #copy of aes_key->rounds
 
     &align     (4);
     &set_label("enc_tail");
-       &push   ($key eq "edi" ? $key : "");    # push ivp
+       &mov    ($s0,$key eq "edi" ? $key : "");
        &mov    ($key,$_out);                   # load out
+       &push   ($s0);                          # push ivp
        &mov    ($s1,16);
        &sub    ($s1,$s2);
        &cmp    ($key,$acc);                    # compare with inp
index 44e0bf8cae3aec92919878879fee112fafc9e8d8..6711b63f7f57aefc5e210dd60465c7324d40b5fd 100755 (executable)
@@ -1198,13 +1198,10 @@ AES_cbc_encrypt:
        ret
 .align 4
 .Lcbc_enc_tail:
-       cmp     $inp,$out
-       je      .Lcbc_enc_in_place
        mov     %r10,%rcx
        mov     $inp,%rsi
        mov     $out,%rdi
        .long   0xF689A4F3              # rep movsb
-.Lcbc_enc_in_place:
        mov     \$16,%rcx               # zero tail
        sub     %r10,%rcx
        xor     %rax,%rax