ec/curve25519.c: resolve regression with Android NDK's arm64 gcc.
authorAndy Polyakov <appro@openssl.org>
Mon, 12 Mar 2018 09:46:23 +0000 (10:46 +0100)
committerAndy Polyakov <appro@openssl.org>
Tue, 13 Mar 2018 18:31:53 +0000 (19:31 +0100)
Unlike "upstream", Android NDK's arm64 gcc [but not clang] performs
64x64=128-bit multiplications with library calls, which appears to
have devastating impact on performance. [The condition is reduced to
__ANDROID__ [&& !__clang__], because x86_64 has corresponding
assembly module.]

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5589)

crypto/ec/curve25519.c

index 45525f4..0f18ff7 100644 (file)
@@ -13,7 +13,8 @@
 
 #if defined(X25519_ASM) \
     || ( (defined(__SIZEOF_INT128__) && __SIZEOF_INT128__ == 16) \
-         && !defined(__sparc__) )
+         && !defined(__sparc__) \
+         && !(defined(__ANDROID__) && !defined(__clang__)) )
 /*
  * Base 2^51 implementation.
  */