libnettle: x-only fixes for m4-generated asm on aarch64 and amd64.

Fixes libnettle regress and is needed for fixing gnutls regress.
This commit is contained in:
tb 2023-01-19 10:32:12 +00:00
parent 2762f781ad
commit 89981e64fb
7 changed files with 75 additions and 0 deletions

View File

@ -2,6 +2,7 @@ COMMENT= cryptographic library
DISTNAME= nettle-3.8.1
PKGNAME= lib${DISTNAME}
REVISION= 0
SHARED_LIBS += hogweed 3.0 # 6.3
SHARED_LIBS += nettle 7.1 # 8.3

View File

@ -0,0 +1,10 @@
Index: arm64/chacha-2core.asm
--- arm64/chacha-2core.asm.orig
+++ arm64/chacha-2core.asm
@@ -227,5 +227,6 @@ PROLOGUE(_nettle_chacha_2core32)
b .Lshared_entry
EPILOGUE(_nettle_chacha_2core32)
+.rodata
.align 4
.Lrot24: .long 0x02010003,0x06050407,0x0a09080b,0x0e0d0c0f

View File

@ -0,0 +1,11 @@
Index: arm64/chacha-4core.asm
--- arm64/chacha-4core.asm.orig
+++ arm64/chacha-4core.asm
@@ -230,6 +230,7 @@ PROLOGUE(_nettle_chacha_4core32)
b .Lshared_entry
EPILOGUE(_nettle_chacha_4core32)
+.rodata
.align 4
.Lcnts: .long 0,1,2,3 C increments
.Lrot24: .long 0x02010003,0x06050407,0x0a09080b,0x0e0d0c0f

View File

@ -0,0 +1,10 @@
Index: arm64/chacha-core-internal.asm
--- arm64/chacha-core-internal.asm.orig
+++ arm64/chacha-core-internal.asm
@@ -122,5 +122,6 @@ PROLOGUE(_nettle_chacha_core)
ret
EPILOGUE(_nettle_chacha_core)
+.rodata
.align 4
.Lrot24: .long 0x02010003,0x06050407,0x0a09080b,0x0e0d0c0f

View File

@ -0,0 +1,11 @@
Index: x86_64/sha3-permute.asm
--- x86_64/sha3-permute.asm.orig
+++ x86_64/sha3-permute.asm
@@ -496,6 +496,7 @@ PROLOGUE(nettle_sha3_permute)
EPILOGUE(nettle_sha3_permute)
+.rodata
ALIGN(16)
.rc: C In reverse order
.quad 0x8000000080008008

View File

@ -0,0 +1,16 @@
Index: x86_64/sha_ni/sha1-compress.asm
--- x86_64/sha_ni/sha1-compress.asm.orig
+++ x86_64/sha_ni/sha1-compress.asm
@@ -61,10 +61,11 @@ define(`QROUND', `
C nettle_sha1_compress(uint32_t *state, uint8_t *input)
- .text
+ .rodata
ALIGN(16)
.Lswap_mask:
.byte 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
+ .text
PROLOGUE(nettle_sha1_compress)
C save all registers that need to be saved
W64_ENTRY(2, 10)

View File

@ -0,0 +1,16 @@
Index: x86_64/sha_ni/sha256-compress.asm
--- x86_64/sha_ni/sha256-compress.asm.orig
+++ x86_64/sha_ni/sha256-compress.asm
@@ -72,10 +72,11 @@ define(`TRANSPOSE', `
C void
C _nettle_sha256_compress(uint32_t *state, const uint8_t *input, const uint32_t *k)
- .text
+ .rodata
ALIGN(16)
.Lswap_mask:
.byte 3,2,1,0,7,6,5,4,11,10,9,8,15,14,13,12
+ .text
PROLOGUE(_nettle_sha256_compress)
W64_ENTRY(3, 10)
movups (STATE), TMP