diff options
| author | miod <> | 2023-02-01 20:45:04 +0000 |
|---|---|---|
| committer | miod <> | 2023-02-01 20:45:04 +0000 |
| commit | dc4b2cf3e0979364f14ff89a07ffafc47435e2e7 (patch) | |
| tree | 58219f5c6538172b9d00f33bf48c9a61419ec7a0 /src/lib/libcrypto/bn | |
| parent | 86f42338b2994b620482c37e3d0d9fc3ba1f523b (diff) | |
| download | openbsd-dc4b2cf3e0979364f14ff89a07ffafc47435e2e7.tar.gz openbsd-dc4b2cf3e0979364f14ff89a07ffafc47435e2e7.tar.bz2 openbsd-dc4b2cf3e0979364f14ff89a07ffafc47435e2e7.zip | |
Move all data blocks from .text to .rodata and cleanup up and homogeneize code
responsible from getting the proper address of those blocks.
ok tb@ jsing@
Diffstat (limited to 'src/lib/libcrypto/bn')
| -rw-r--r-- | src/lib/libcrypto/bn/asm/bn-586.pl | 9 | ||||
| -rw-r--r-- | src/lib/libcrypto/bn/asm/x86-gf2m.pl | 5 | ||||
| -rwxr-xr-x | src/lib/libcrypto/bn/asm/x86-mont.pl | 5 |
3 files changed, 10 insertions, 9 deletions
diff --git a/src/lib/libcrypto/bn/asm/bn-586.pl b/src/lib/libcrypto/bn/asm/bn-586.pl index c4e2baa6c5..b502fe60ee 100644 --- a/src/lib/libcrypto/bn/asm/bn-586.pl +++ b/src/lib/libcrypto/bn/asm/bn-586.pl | |||
| @@ -32,7 +32,8 @@ sub bn_mul_add_words | |||
| 32 | $c="ecx"; | 32 | $c="ecx"; |
| 33 | 33 | ||
| 34 | if ($sse2) { | 34 | if ($sse2) { |
| 35 | &picmeup("eax","OPENSSL_ia32cap_P"); | 35 | &picsetup("eax"); |
| 36 | &picsymbol("eax", "OPENSSL_ia32cap_P", "eax"); | ||
| 36 | &bt(&DWP(0,"eax"),"\$IA32CAP_BIT0_SSE2"); | 37 | &bt(&DWP(0,"eax"),"\$IA32CAP_BIT0_SSE2"); |
| 37 | &jnc(&label("maw_non_sse2")); | 38 | &jnc(&label("maw_non_sse2")); |
| 38 | 39 | ||
| @@ -218,7 +219,8 @@ sub bn_mul_words | |||
| 218 | $c="ecx"; | 219 | $c="ecx"; |
| 219 | 220 | ||
| 220 | if ($sse2) { | 221 | if ($sse2) { |
| 221 | &picmeup("eax","OPENSSL_ia32cap_P"); | 222 | &picsetup("eax"); |
| 223 | &picsymbol("eax", "OPENSSL_ia32cap_P", "eax"); | ||
| 222 | &bt(&DWP(0,"eax"),"\$IA32CAP_BIT0_SSE2"); | 224 | &bt(&DWP(0,"eax"),"\$IA32CAP_BIT0_SSE2"); |
| 223 | &jnc(&label("mw_non_sse2")); | 225 | &jnc(&label("mw_non_sse2")); |
| 224 | 226 | ||
| @@ -329,7 +331,8 @@ sub bn_sqr_words | |||
| 329 | $c="ecx"; | 331 | $c="ecx"; |
| 330 | 332 | ||
| 331 | if ($sse2) { | 333 | if ($sse2) { |
| 332 | &picmeup("eax","OPENSSL_ia32cap_P"); | 334 | &picsetup("eax"); |
| 335 | &picsymbol("eax", "OPENSSL_ia32cap_P", "eax"); | ||
| 333 | &bt(&DWP(0,"eax"),"\$IA32CAP_BIT0_SSE2"); | 336 | &bt(&DWP(0,"eax"),"\$IA32CAP_BIT0_SSE2"); |
| 334 | &jnc(&label("sqr_non_sse2")); | 337 | &jnc(&label("sqr_non_sse2")); |
| 335 | 338 | ||
diff --git a/src/lib/libcrypto/bn/asm/x86-gf2m.pl b/src/lib/libcrypto/bn/asm/x86-gf2m.pl index 9715b2158f..cb2f2a5c30 100644 --- a/src/lib/libcrypto/bn/asm/x86-gf2m.pl +++ b/src/lib/libcrypto/bn/asm/x86-gf2m.pl | |||
| @@ -200,7 +200,8 @@ $R="mm0"; | |||
| 200 | # void bn_GF2m_mul_2x2(BN_ULONG *r, BN_ULONG a1, BN_ULONG a0, BN_ULONG b1, BN_ULONG b0); | 200 | # void bn_GF2m_mul_2x2(BN_ULONG *r, BN_ULONG a1, BN_ULONG a0, BN_ULONG b1, BN_ULONG b0); |
| 201 | &function_begin_B("bn_GF2m_mul_2x2"); | 201 | &function_begin_B("bn_GF2m_mul_2x2"); |
| 202 | if (!$x86only) { | 202 | if (!$x86only) { |
| 203 | &picmeup("edx","OPENSSL_ia32cap_P"); | 203 | &picsetup("edx"); |
| 204 | &picsymbol("edx", "OPENSSL_ia32cap_P", "edx"); | ||
| 204 | &mov ("eax",&DWP(0,"edx")); | 205 | &mov ("eax",&DWP(0,"edx")); |
| 205 | &mov ("edx",&DWP(4,"edx")); | 206 | &mov ("edx",&DWP(4,"edx")); |
| 206 | &test ("eax","\$IA32CAP_MASK0_MMX"); # check MMX bit | 207 | &test ("eax","\$IA32CAP_MASK0_MMX"); # check MMX bit |
| @@ -308,6 +309,4 @@ if ($sse2) { | |||
| 308 | &ret (); | 309 | &ret (); |
| 309 | &function_end_B("bn_GF2m_mul_2x2"); | 310 | &function_end_B("bn_GF2m_mul_2x2"); |
| 310 | 311 | ||
| 311 | &asciz ("GF(2^m) Multiplication for x86, CRYPTOGAMS by <appro\@openssl.org>"); | ||
| 312 | |||
| 313 | &asm_finish(); | 312 | &asm_finish(); |
diff --git a/src/lib/libcrypto/bn/asm/x86-mont.pl b/src/lib/libcrypto/bn/asm/x86-mont.pl index e6c04739b1..6524651748 100755 --- a/src/lib/libcrypto/bn/asm/x86-mont.pl +++ b/src/lib/libcrypto/bn/asm/x86-mont.pl | |||
| @@ -113,7 +113,8 @@ $mul1="mm5"; | |||
| 113 | $temp="mm6"; | 113 | $temp="mm6"; |
| 114 | $mask="mm7"; | 114 | $mask="mm7"; |
| 115 | 115 | ||
| 116 | &picmeup("eax","OPENSSL_ia32cap_P"); | 116 | &picsetup("eax"); |
| 117 | &picsymbol("eax", "OPENSSL_ia32cap_P", "eax"); | ||
| 117 | &bt (&DWP(0,"eax"),"\$IA32CAP_BIT0_SSE2"); | 118 | &bt (&DWP(0,"eax"),"\$IA32CAP_BIT0_SSE2"); |
| 118 | &jnc (&label("non_sse2")); | 119 | &jnc (&label("non_sse2")); |
| 119 | 120 | ||
| @@ -588,6 +589,4 @@ $sbit=$num; | |||
| 588 | &set_label("just_leave"); | 589 | &set_label("just_leave"); |
| 589 | &function_end("bn_mul_mont"); | 590 | &function_end("bn_mul_mont"); |
| 590 | 591 | ||
| 591 | &asciz("Montgomery Multiplication for x86, CRYPTOGAMS by <appro\@openssl.org>"); | ||
| 592 | |||
| 593 | &asm_finish(); | 592 | &asm_finish(); |
