]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
[sm3][aarch64] Move constant to .rodata section
authorAlexey Moksyakov <yavtuk@yandex.ru>
Wed, 22 Jan 2025 07:28:33 +0000 (10:28 +0300)
committerTomas Mraz <tomas@openssl.org>
Thu, 13 Feb 2025 08:51:37 +0000 (09:51 +0100)
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26509)

crypto/sm3/asm/sm3-armv8.pl

index bdbb1af1d6f8f2a747b9c01b85f5bc579b91577a..f3db3bd56371bfa52fe93e2a5b8387d0716a3e4b 100644 (file)
@@ -22,6 +22,7 @@ open OUT,"| \"$^X\" $xlate $flavour \"$output\""
     or die "can't call $xlate: $!";
 *STDOUT=*OUT;
 
+$prefix="sm3";
 # Message expanding:
 #      Wj <- P1(W[j-16]^W[j-9]^(W[j-3]<<<15))^(W[j-13]<<<7)^W[j-6]
 # Input: s0, s1, s2, s3
@@ -135,8 +136,19 @@ ossl_hwsm3_block_data_order:
        rev64   $state2.4s, $state2.4s
        ext     $state1.16b, $state1.16b, $state1.16b, #8
        ext     $state2.16b, $state2.16b, $state2.16b, #8
-
+___
+if ($flavour =~ /linux64/)
+{
+$code.=<<___;
+       adrp    $constaddr, .Tj
+       add     $constaddr, $constaddr, #:lo12:.Tj
+___
+} else {
+$code.=<<___;
        adr     $constaddr, .Tj
+___
+}
+$code.=<<___;
        ldp     $sconst1, $sconst2, [$constaddr]
 
 .Loop:
@@ -209,11 +221,22 @@ $code.=<<___;
        st1     {$state1.4s-$state2.4s}, [$pstate]
        ret
 .size  ossl_hwsm3_block_data_order,.-ossl_hwsm3_block_data_order
+___
 
+$code.=".rodata\n"  if ($flavour =~ /linux64/);
+
+$code.=<<___;
+
+.type  _${prefix}_consts,%object
 .align 3
+_${prefix}_consts:
 .Tj:
 .word  0x79cc4519, 0x9d8a7a87
+.size _${prefix}_consts,.-_${prefix}_consts
 ___
+
+$code.=".previous\n"  if ($flavour =~ /linux64/);
+
 }}}
 
 #########################################