diff options
author | Adam Langley <agl@chromium.org> | 2014-07-31 23:16:48 +0400 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2014-08-01 02:42:15 +0400 |
commit | 31ebde9e5e7573f70e132e63abf65036688b46ec (patch) | |
tree | 60ebe30b2bb4489272f8ae7e5205743af831ea69 /crypto/poly1305 | |
parent | eb7d2ed1fe8a33b3e3871502ba7e12efaf94360c (diff) |
Add a control to disable the Poly1305 NEON code.
Some phones have a buggy NEON unit and the Poly1305 NEON code fails on
them, even though other NEON code appears to work fine.
This change:
1) Fixes a bug where NEON was assumed even when the code wasn't compiled
in NEON mode.
2) Adds a second NEON control bit that can be disabled in order to run
NEON code, but not the Poly1305 NEON code.
https://code.google.com/p/chromium/issues/detail?id=341598
Change-Id: Icb121bf8dba47c7a46c7667f676ff7a4bc973625
Reviewed-on: https://boringssl-review.googlesource.com/1351
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/poly1305')
-rw-r--r-- | crypto/poly1305/poly1305.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/poly1305/poly1305.c b/crypto/poly1305/poly1305.c index 256ad69b..9b9c734c 100644 --- a/crypto/poly1305/poly1305.c +++ b/crypto/poly1305/poly1305.c @@ -166,7 +166,7 @@ void CRYPTO_poly1305_init(poly1305_state *statep, const uint8_t key[32]) { uint32_t t0, t1, t2, t3; #if defined(OPENSSL_ARM) - if (CRYPTO_is_NEON_capable()) { + if (CRYPTO_is_NEON_functional()) { CRYPTO_poly1305_init_neon(statep, key); return; } @@ -213,7 +213,7 @@ void CRYPTO_poly1305_update(poly1305_state *statep, const uint8_t *in, struct poly1305_state_st *state = (struct poly1305_state_st *)statep; #if defined(OPENSSL_ARM) - if (CRYPTO_is_NEON_capable()) { + if (CRYPTO_is_NEON_functional()) { CRYPTO_poly1305_update_neon(statep, in, in_len); return; } @@ -256,7 +256,7 @@ void CRYPTO_poly1305_finish(poly1305_state *statep, uint8_t mac[16]) { uint32_t b, nb; #if defined(OPENSSL_ARM) - if (CRYPTO_is_NEON_capable()) { + if (CRYPTO_is_NEON_functional()) { CRYPTO_poly1305_finish_neon(statep, mac); return; } |