summaryrefslogtreecommitdiffstats
path: root/crypto/poly1305
diff options
context:
space:
mode:
authorTheo Buehler <tb@openbsd.org>2024-03-01 08:07:42 +0100
committerTomas Mraz <tomas@openssl.org>2024-04-17 09:38:06 +0200
commit25391acc140e215774242bf3b0a51d59754a23f4 (patch)
tree451ad805e44b44e5ee27e439632f955f9ab9746b /crypto/poly1305
parentextend x86_64-xlate.pl perlasm so it can handle .rodata sections properly (diff)
downloadopenssl-25391acc140e215774242bf3b0a51d59754a23f4.tar.xz
openssl-25391acc140e215774242bf3b0a51d59754a23f4.zip
Unable to run asm code on OpenBSD (amd64)
In order to get asm code running on OpenBSD we must place all constants into .rodata sections. davidben@ also pointed out we need to adjust `x86_64-xlate.pl` perlasm script to adjust read-olny sections for various flavors (OSes). Those changes were cherry-picked from boringssl. closes #23312 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/23997)
Diffstat (limited to 'crypto/poly1305')
-rwxr-xr-xcrypto/poly1305/asm/poly1305-x86_64.pl8
1 files changed, 8 insertions, 0 deletions
diff --git a/crypto/poly1305/asm/poly1305-x86_64.pl b/crypto/poly1305/asm/poly1305-x86_64.pl
index 4cddca1c51..5223207b83 100755
--- a/crypto/poly1305/asm/poly1305-x86_64.pl
+++ b/crypto/poly1305/asm/poly1305-x86_64.pl
@@ -229,6 +229,7 @@ $code.=<<___;
.align 32
poly1305_blocks:
.cfi_startproc
+ endbranch
.Lblocks:
shr \$4,$len
jz .Lno_data # too short
@@ -303,6 +304,7 @@ $code.=<<___;
.align 32
poly1305_emit:
.cfi_startproc
+ endbranch
.Lemit:
mov 0($ctx),%r8 # load hash value
mov 8($ctx),%r9
@@ -524,6 +526,7 @@ __poly1305_init_avx:
.align 32
poly1305_blocks_avx:
.cfi_startproc
+ endbranch
mov 20($ctx),%r8d # is_base2_26
cmp \$128,$len
jae .Lblocks_avx
@@ -1384,6 +1387,7 @@ $code.=<<___;
.align 32
poly1305_emit_avx:
.cfi_startproc
+ endbranch
cmpl \$0,20($ctx) # is_base2_26?
je .Lemit
@@ -1448,6 +1452,7 @@ $code.=<<___;
.align 32
poly1305_blocks_avx2:
.cfi_startproc
+ endbranch
mov 20($ctx),%r8d # is_base2_26
cmp \$128,$len
jae .Lblocks_avx2
@@ -2144,6 +2149,7 @@ $code.=<<___;
.align 32
poly1305_blocks_avx512:
.cfi_startproc
+ endbranch
.Lblocks_avx512:
mov \$15,%eax
kmovw %eax,%k2
@@ -3778,6 +3784,7 @@ poly1305_emit_base2_44:
___
} } }
$code.=<<___;
+.section .rodata align=64
.align 64
.Lconst:
.Lmask24:
@@ -3809,6 +3816,7 @@ $code.=<<___;
.Lx_mask42:
.quad 0x3ffffffffff,0x3ffffffffff,0x3ffffffffff,0x3ffffffffff
.quad 0x3ffffffffff,0x3ffffffffff,0x3ffffffffff,0x3ffffffffff
+.previous
___
}
$code.=<<___;