summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/sha
diff options
context:
space:
mode:
authorjsing <>2025-06-09 14:28:34 +0000
committerjsing <>2025-06-09 14:28:34 +0000
commit951cd4503ff3c4cc93c1a36cf06138b1ddd739d7 (patch)
tree6c411eca3de0b4b777e48c9aba4d6dd13c8e899a /src/lib/libcrypto/sha
parentd8ae322f91ae730f31b750787e0180588dab36dc (diff)
downloadopenbsd-951cd4503ff3c4cc93c1a36cf06138b1ddd739d7.tar.gz
openbsd-951cd4503ff3c4cc93c1a36cf06138b1ddd739d7.tar.bz2
openbsd-951cd4503ff3c4cc93c1a36cf06138b1ddd739d7.zip
Make OPENSSL_IA32_SSE2 the default for i386 and remove the flag.
The OPENSSL_IA32_SSE2 flag controls whether a number of the perlasm scripts generate additional implementations that use SSE2 functionality. In all cases except ghash, the code checks OPENSSL_ia32cap_P for SSE2 support, before trying to run SSE2 code. For ghash it generates a CLMUL based implementation in addition to different MMX version (one MMX version hides behind OPENSSL_IA32_SSE2, the other does not), however this does not appear to actually use SSE2. We also disable AES-NI on i386 if OPENSSL_IA32_SSE2. On OpenBSD, we've always defined OPENSSL_IA32_SSE2 so this is effectively a no-op. The only change is that we now check MMX rather than SSE2 for the ghash MMX implementation. ok bcook@ beck@
Diffstat (limited to 'src/lib/libcrypto/sha')
-rw-r--r--src/lib/libcrypto/sha/asm/sha1-586.pl5
-rw-r--r--src/lib/libcrypto/sha/asm/sha512-586.pl3
2 files changed, 2 insertions, 6 deletions
diff --git a/src/lib/libcrypto/sha/asm/sha1-586.pl b/src/lib/libcrypto/sha/asm/sha1-586.pl
index 72dd3badb1..d2491766f3 100644
--- a/src/lib/libcrypto/sha/asm/sha1-586.pl
+++ b/src/lib/libcrypto/sha/asm/sha1-586.pl
@@ -104,10 +104,7 @@ require "x86asm.pl";
104 104
105&asm_init($ARGV[0],"sha1-586.pl",$ARGV[$#ARGV] eq "386"); 105&asm_init($ARGV[0],"sha1-586.pl",$ARGV[$#ARGV] eq "386");
106 106
107$xmm=$ymm=0; 107$xmm=$ymm=1;
108for (@ARGV) { $xmm=1 if (/-DOPENSSL_IA32_SSE2/); }
109
110$ymm=1 if $xmm;
111 108
112&external_label("OPENSSL_ia32cap_P") if ($xmm); 109&external_label("OPENSSL_ia32cap_P") if ($xmm);
113 110
diff --git a/src/lib/libcrypto/sha/asm/sha512-586.pl b/src/lib/libcrypto/sha/asm/sha512-586.pl
index c1d0684e92..fe1ff487bc 100644
--- a/src/lib/libcrypto/sha/asm/sha512-586.pl
+++ b/src/lib/libcrypto/sha/asm/sha512-586.pl
@@ -38,8 +38,7 @@ require "x86asm.pl";
38 38
39&asm_init($ARGV[0],"sha512-586.pl",$ARGV[$#ARGV] eq "386"); 39&asm_init($ARGV[0],"sha512-586.pl",$ARGV[$#ARGV] eq "386");
40 40
41$sse2=0; 41$sse2=1;
42for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
43 42
44&external_label("OPENSSL_ia32cap_P") if ($sse2); 43&external_label("OPENSSL_ia32cap_P") if ($sse2);
45 44