[openssl] master update
Matt Caswell
matt at openssl.org
Thu Apr 22 07:47:41 UTC 2021
The branch master has been updated
via cd28d129b6a5b84ac40b4a3f8060a6f764aa02b4 (commit)
from af9fb19a476911bf7ceabcf3b21923dd5bbd9ac6 (commit)
- Log -----------------------------------------------------------------
commit cd28d129b6a5b84ac40b4a3f8060a6f764aa02b4
Author: Matt Caswell <matt at openssl.org>
Date: Mon Apr 19 17:31:28 2021 +0100
Avoid the need for Configure time 128-bit int detection
We just detect this at compile time instead.
This avoids cross-compilation problems where the host platform supports
128-bit ints, but the target platform does not (or vice versa). This was
causing a problem on some platforms where, dependent on the CFLAGS, 128 bit
ints were either supported or not.
Fixes #14804
Reviewed-by: Richard Levitte <levitte at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14941)
-----------------------------------------------------------------------
Summary of changes:
Configure | 14 --------------
crypto/ec/build.info | 9 ++-------
crypto/ec/curve448/arch_32/{f_impl.c => f_impl32.c} | 11 ++++++++++-
crypto/ec/curve448/arch_64/{f_impl.c => f_impl64.c} | 11 ++++++++++-
4 files changed, 22 insertions(+), 23 deletions(-)
rename crypto/ec/curve448/arch_32/{f_impl.c => f_impl32.c} (92%)
rename crypto/ec/curve448/arch_64/{f_impl.c => f_impl64.c} (96%)
diff --git a/Configure b/Configure
index 76c27bacb8..613b48e7d9 100755
--- a/Configure
+++ b/Configure
@@ -1573,20 +1573,6 @@ if (!$disabled{asm} && !$predefined_C{__MACH__} && $^O ne 'VMS') {
}
}
-# Check if __SIZEOF_INT128__ is defined by compiler
-$config{use_int128} = 0;
-{
- my $cc = $config{CROSS_COMPILE}.$config{CC};
- open(PIPE, "$cc -E -dM - </dev/null 2>&1 |");
- while(<PIPE>) {
- if (m/__SIZEOF_INT128__/) {
- $config{use_int128} = 1;
- last;
- }
- }
- close(PIPE);
-}
-
# Deal with bn_ops ###################################################
$config{bn_ll} =0;
diff --git a/crypto/ec/build.info b/crypto/ec/build.info
index e4c8cf6d82..ed256981c7 100644
--- a/crypto/ec/build.info
+++ b/crypto/ec/build.info
@@ -50,13 +50,8 @@ $COMMON=ec_lib.c ecp_smpl.c ecp_mont.c ecp_nist.c ec_cvt.c ec_mult.c \
ecdsa_ossl.c ecdsa_sign.c ecdsa_vrf.c curve25519.c \
curve448/f_generic.c curve448/scalar.c \
curve448/curve448_tables.c curve448/eddsa.c curve448/curve448.c \
- $ECASM ec_backend.c ecx_backend.c ecdh_kdf.c
-
-IF[{- $config{'use_int128'} eq "1" -}]
- $COMMON=$COMMON curve448/arch_64/f_impl.c
-ELSE
- $COMMON=$COMMON curve448/arch_32/f_impl.c
-ENDIF
+ $ECASM ec_backend.c ecx_backend.c ecdh_kdf.c curve448/arch_64/f_impl64.c \
+ curve448/arch_32/f_impl32.c
IF[{- !$disabled{'ec_nistp_64_gcc_128'} -}]
$COMMON=$COMMON ecp_nistp224.c ecp_nistp256.c ecp_nistp521.c ecp_nistputil.c
diff --git a/crypto/ec/curve448/arch_32/f_impl.c b/crypto/ec/curve448/arch_32/f_impl32.c
similarity index 92%
rename from crypto/ec/curve448/arch_32/f_impl.c
rename to crypto/ec/curve448/arch_32/f_impl32.c
index 2e9419b66d..812c06d84a 100644
--- a/crypto/ec/curve448/arch_32/f_impl.c
+++ b/crypto/ec/curve448/arch_32/f_impl32.c
@@ -10,7 +10,15 @@
* Originally written by Mike Hamburg
*/
-#include "../field.h"
+#include "openssl/macros.h"
+#include "internal/numbers.h"
+
+#ifdef UINT128_MAX
+/* We have support for 128 bit ints, so do nothing here */
+NON_EMPTY_TRANSLATION_UNIT
+#else
+
+# include "../field.h"
void gf_mul(gf_s * RESTRICT cs, const gf as, const gf bs)
{
@@ -93,3 +101,4 @@ void gf_sqr(gf_s * RESTRICT cs, const gf as)
{
gf_mul(cs, as, as); /* Performs better with a dedicated square */
}
+#endif
diff --git a/crypto/ec/curve448/arch_64/f_impl.c b/crypto/ec/curve448/arch_64/f_impl64.c
similarity index 96%
rename from crypto/ec/curve448/arch_64/f_impl.c
rename to crypto/ec/curve448/arch_64/f_impl64.c
index 035355cf04..bdafc0de92 100644
--- a/crypto/ec/curve448/arch_64/f_impl.c
+++ b/crypto/ec/curve448/arch_64/f_impl64.c
@@ -10,7 +10,15 @@
* Originally written by Mike Hamburg
*/
-#include "../field.h"
+#include "openssl/macros.h"
+#include "internal/numbers.h"
+
+#ifndef UINT128_MAX
+/* No support for 128 bit ints, so do nothing here */
+NON_EMPTY_TRANSLATION_UNIT
+#else
+
+# include "../field.h"
void gf_mul(gf_s * RESTRICT cs, const gf as, const gf bs)
{
@@ -198,3 +206,4 @@ void gf_sqr(gf_s * RESTRICT cs, const gf as)
c[4] += ((uint64_t)(accum0)) + ((uint64_t)(accum1));
c[0] += ((uint64_t)(accum1));
}
+#endif
More information about the openssl-commits
mailing list