Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1089)

Unified Diff: crypto/openssl_util.cc

Issue 442863003: Disable Poly1305 code only on bad chips. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Leak the LazyInstance. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/cpu.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/openssl_util.cc
diff --git a/crypto/openssl_util.cc b/crypto/openssl_util.cc
index 6f348ff1a54c0365f8becb70d68ae2f079429b84..79944891e2fbd286617c635bdc080f120f0fc848 100644
--- a/crypto/openssl_util.cc
+++ b/crypto/openssl_util.cc
@@ -17,6 +17,7 @@
#if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL)
#include <cpu-features.h>
+#include "base/cpu.h"
#endif
namespace crypto {
@@ -62,10 +63,9 @@ class OpenSSLInitSingleton {
(android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0;
if (has_neon)
CRYPTO_set_NEON_capable(1);
- // In all cases, currently, mark the NEON unit as broken because some
- // phones can't execute the Poly1305 code correctly. See
- // https://code.google.com/p/chromium/issues/detail?id=341598
- CRYPTO_set_NEON_functional(0);
+ // See https://code.google.com/p/chromium/issues/detail?id=341598
+ base::CPU cpu;
+ CRYPTO_set_NEON_functional(!cpu.has_broken_neon());
#endif
}
« no previous file with comments | « base/cpu.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698