aes/asm/aesni-sha*-x86_64.pl: fix IV handling in SHAEXT paths.
authorAndy Polyakov <appro@openssl.org>
Mon, 20 Mar 2017 10:38:25 +0000 (11:38 +0100)
committerAndy Polyakov <appro@openssl.org>
Wed, 22 Mar 2017 10:02:56 +0000 (11:02 +0100)
Initial IV was disregarded on SHAEXT-capable processors. Amazingly
enough bulk AES128-SHA* talk-to-yourself tests were passing.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2992)

crypto/aes/asm/aesni-sha1-x86_64.pl
crypto/aes/asm/aesni-sha256-x86_64.pl

index dcdf454861991ba38d333015a1b02e23babd08cf..6644d704d90f84edda010aaa37c3bbfbfa52ad3f 100644 (file)
@@ -1779,6 +1779,7 @@ $code.=<<___;
        mov     240($key),$rounds
        sub     $in0,$out
        movups  ($key),$rndkey0                 # $key[0]
+       movups  ($ivp),$iv                      # load IV
        movups  16($key),$rndkey[0]             # forward reference
        lea     112($key),$key                  # size optimization
 
index ceec9a6e1eb51a66166439dd9b161fc8580ae534..74ec8449528bc5b51427d37b28c85b0341614e27 100644 (file)
@@ -1361,6 +1361,7 @@ $code.=<<___;
        mov             240($key),$rounds
        sub             $in0,$out
        movups          ($key),$rndkey0         # $key[0]
+       movups          ($ivp),$iv              # load IV
        movups          16($key),$rndkey[0]     # forward reference
        lea             112($key),$key          # size optimization