|
| 1 | +commit 241d4826f8ee39c92d9b3233146c3e12314871ec |
| 2 | +Author: rainerjung < [email protected]> |
| 3 | +Date: Tue Sep 9 00:10:40 2025 +0200 |
| 4 | + |
| 5 | + Update sha512-x86_64.pl |
| 6 | + |
| 7 | + Do not use new assembler code for CPUs with SHA512 support in case the assembler only supports avx but not avx2. |
| 8 | + |
| 9 | + Reviewed-by: Shane Lontis < [email protected]> |
| 10 | + Reviewed-by: Paul Dale < [email protected]> |
| 11 | + (Merged from https://github.com/openssl/openssl/pull/28488) |
| 12 | + |
| 13 | +diff --git a/crypto/sha/asm/sha512-x86_64.pl b/crypto/sha/asm/sha512-x86_64.pl |
| 14 | +index cdc585c..029468d 100755 |
| 15 | +--- a/crypto/sha/asm/sha512-x86_64.pl |
| 16 | ++++ b/crypto/sha/asm/sha512-x86_64.pl |
| 17 | +@@ -574,7 +574,9 @@ $TABLE: |
| 18 | + .quad 0x0001020304050607,0x08090a0b0c0d0e0f |
| 19 | + .quad 0x0001020304050607,0x08090a0b0c0d0e0f |
| 20 | + .asciz "SHA512 block transform for x86_64, CRYPTOGAMS by <https://github.com/dot-asm>" |
| 21 | ++___ |
| 22 | + |
| 23 | ++$code.=<<___ if ($avx>1); |
| 24 | + # $K512 duplicates data every 16 bytes. |
| 25 | + # The Intel(R) SHA512 implementation requires reads of 32 consecutive bytes. |
| 26 | + .align 64 |
| 27 | +@@ -620,6 +622,8 @@ ${TABLE}_single: |
| 28 | + .quad 0x3c9ebe0a15c9bebc, 0x431d67c49c100d4c |
| 29 | + .quad 0x4cc5d4becb3e42b6, 0x597f299cfc657e2a |
| 30 | + .quad 0x5fcb6fab3ad6faec, 0x6c44198c4a475817 |
| 31 | ++___ |
| 32 | ++$code.=<<___; |
| 33 | + .previous |
| 34 | + ___ |
| 35 | + } |
| 36 | +@@ -2379,7 +2383,7 @@ ___ |
| 37 | + }} |
| 38 | + }}}}} |
| 39 | + |
| 40 | +-if ($SZ==8) { |
| 41 | ++if ($SZ==8 && $avx>1) { |
| 42 | + $code.=<<___; |
| 43 | + .type ${func}_sha512ext,\@function,3 |
| 44 | + .align 64 |
0 commit comments