2015-01-15 00:37:38 +00:00
|
|
|
/* Copyright (c) 2014, Google Inc.
|
2014-06-20 20:00:00 +01:00
|
|
|
*
|
2015-01-15 00:37:38 +00:00
|
|
|
* Permission to use, copy, modify, and/or distribute this software for any
|
|
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
|
|
* copyright notice and this permission notice appear in all copies.
|
2014-06-20 20:00:00 +01:00
|
|
|
*
|
2015-01-15 00:37:38 +00:00
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
|
|
|
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
|
|
|
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
|
|
|
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
|
2014-06-20 20:00:00 +01:00
|
|
|
|
|
|
|
#include <openssl/cpu.h>
|
|
|
|
|
2015-10-16 23:46:46 +01:00
|
|
|
#if (defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) && \
|
|
|
|
!defined(OPENSSL_STATIC_ARMCAP)
|
2014-06-20 20:00:00 +01:00
|
|
|
|
2015-08-25 02:03:17 +01:00
|
|
|
#include <openssl/arm_arch.h>
|
2014-06-20 20:00:00 +01:00
|
|
|
|
2015-01-15 00:37:38 +00:00
|
|
|
|
2015-10-16 23:46:46 +01:00
|
|
|
extern uint32_t OPENSSL_armcap_P;
|
|
|
|
|
2015-11-17 23:25:00 +00:00
|
|
|
char CRYPTO_is_NEON_capable_at_runtime(void) {
|
2014-06-20 20:00:00 +01:00
|
|
|
return (OPENSSL_armcap_P & ARMV7_NEON) != 0;
|
|
|
|
}
|
|
|
|
|
2015-10-16 23:46:46 +01:00
|
|
|
int CRYPTO_is_ARMv8_AES_capable(void) {
|
|
|
|
return (OPENSSL_armcap_P & ARMV8_AES) != 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int CRYPTO_is_ARMv8_PMULL_capable(void) {
|
|
|
|
return (OPENSSL_armcap_P & ARMV8_PMULL) != 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* (defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) &&
|
|
|
|
!defined(OPENSSL_STATIC_ARMCAP) */
|