summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/sha
diff options
context:
space:
mode:
authorderaadt <>2023-01-14 16:58:56 +0000
committerderaadt <>2023-01-14 16:58:56 +0000
commitb5834617204e7520b0209bcff7f1c4a559e05422 (patch)
tree091fefd47bf297796c9ff374bd3f19f6e0cd6da8 /src/lib/libcrypto/sha
parenta545377353a479e357ae5fb9be8294f7137820d5 (diff)
downloadopenbsd-b5834617204e7520b0209bcff7f1c4a559e05422.tar.gz
openbsd-b5834617204e7520b0209bcff7f1c4a559e05422.tar.bz2
openbsd-b5834617204e7520b0209bcff7f1c4a559e05422.zip
Move constants out of text segment into rodata to prepare for xonly support
on amd64. no pic handling is neccessary since amd64 has full reach. ok kettenis
Diffstat (limited to 'src/lib/libcrypto/sha')
-rwxr-xr-xsrc/lib/libcrypto/sha/asm/sha1-x86_64.pl3
-rwxr-xr-xsrc/lib/libcrypto/sha/asm/sha512-x86_64.pl4
2 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/libcrypto/sha/asm/sha1-x86_64.pl b/src/lib/libcrypto/sha/asm/sha1-x86_64.pl
index cc8ef5337d..0abbbab6ba 100755
--- a/src/lib/libcrypto/sha/asm/sha1-x86_64.pl
+++ b/src/lib/libcrypto/sha/asm/sha1-x86_64.pl
@@ -1071,6 +1071,7 @@ $code.=<<___;
1071___ 1071___
1072} 1072}
1073$code.=<<___; 1073$code.=<<___;
1074.rodata
1074.align 64 1075.align 64
1075K_XX_XX: 1076K_XX_XX:
1076.long 0x5a827999,0x5a827999,0x5a827999,0x5a827999 # K_00_19 1077.long 0x5a827999,0x5a827999,0x5a827999,0x5a827999 # K_00_19
@@ -1078,10 +1079,10 @@ K_XX_XX:
1078.long 0x8f1bbcdc,0x8f1bbcdc,0x8f1bbcdc,0x8f1bbcdc # K_40_59 1079.long 0x8f1bbcdc,0x8f1bbcdc,0x8f1bbcdc,0x8f1bbcdc # K_40_59
1079.long 0xca62c1d6,0xca62c1d6,0xca62c1d6,0xca62c1d6 # K_60_79 1080.long 0xca62c1d6,0xca62c1d6,0xca62c1d6,0xca62c1d6 # K_60_79
1080.long 0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f # pbswap mask 1081.long 0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f # pbswap mask
1082.previous
1081___ 1083___
1082}}} 1084}}}
1083$code.=<<___; 1085$code.=<<___;
1084.asciz "SHA1 block transform for x86_64, CRYPTOGAMS by <appro\@openssl.org>"
1085.align 64 1086.align 64
1086___ 1087___
1087 1088
diff --git a/src/lib/libcrypto/sha/asm/sha512-x86_64.pl b/src/lib/libcrypto/sha/asm/sha512-x86_64.pl
index bc4b2e7487..6698b1d406 100755
--- a/src/lib/libcrypto/sha/asm/sha512-x86_64.pl
+++ b/src/lib/libcrypto/sha/asm/sha512-x86_64.pl
@@ -269,6 +269,7 @@ ___
269 269
270if ($SZ==4) { 270if ($SZ==4) {
271$code.=<<___; 271$code.=<<___;
272.rodata
272.align 64 273.align 64
273.type $TABLE,\@object 274.type $TABLE,\@object
274$TABLE: 275$TABLE:
@@ -288,9 +289,11 @@ $TABLE:
288 .long 0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3 289 .long 0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3
289 .long 0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208 290 .long 0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208
290 .long 0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2 291 .long 0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2
292.previous
291___ 293___
292} else { 294} else {
293$code.=<<___; 295$code.=<<___;
296.rodata
294.align 64 297.align 64
295.type $TABLE,\@object 298.type $TABLE,\@object
296$TABLE: 299$TABLE:
@@ -334,6 +337,7 @@ $TABLE:
334 .quad 0x3c9ebe0a15c9bebc,0x431d67c49c100d4c 337 .quad 0x3c9ebe0a15c9bebc,0x431d67c49c100d4c
335 .quad 0x4cc5d4becb3e42b6,0x597f299cfc657e2a 338 .quad 0x4cc5d4becb3e42b6,0x597f299cfc657e2a
336 .quad 0x5fcb6fab3ad6faec,0x6c44198c4a475817 339 .quad 0x5fcb6fab3ad6faec,0x6c44198c4a475817
340.previous
337___ 341___
338} 342}
339 343