2015-09-24 20:52:02 +00:00
|
|
|
/* Copyright (c) 2014, Google Inc.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* 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. */
|
|
|
|
|
|
|
|
#include <openssl/cpu.h>
|
|
|
|
|
2018-07-30 02:07:02 +00:00
|
|
|
#if (defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) && \
|
|
|
|
!defined(OPENSSL_STATIC_ARMCAP)
|
2015-09-24 20:52:02 +00:00
|
|
|
|
2018-07-30 02:07:02 +00:00
|
|
|
#include <openssl/arm_arch.h>
|
2015-09-24 20:52:02 +00:00
|
|
|
|
|
|
|
|
2018-07-30 02:07:02 +00:00
|
|
|
extern uint32_t OPENSSL_armcap_P;
|
2015-09-24 20:52:02 +00:00
|
|
|
|
2018-07-30 02:07:02 +00:00
|
|
|
char CRYPTO_is_NEON_capable_at_runtime(void) {
|
2015-09-24 20:52:02 +00:00
|
|
|
return (OPENSSL_armcap_P & ARMV7_NEON) != 0;
|
|
|
|
}
|
|
|
|
|
2018-07-30 02:07:02 +00:00
|
|
|
int CRYPTO_is_ARMv8_AES_capable(void) {
|
|
|
|
return (OPENSSL_armcap_P & ARMV8_AES) != 0;
|
2015-09-24 20:52:02 +00:00
|
|
|
}
|
|
|
|
|
2018-07-30 02:07:02 +00:00
|
|
|
int CRYPTO_is_ARMv8_PMULL_capable(void) {
|
|
|
|
return (OPENSSL_armcap_P & ARMV8_PMULL) != 0;
|
2015-09-24 20:52:02 +00:00
|
|
|
}
|
|
|
|
|
2018-07-30 02:07:02 +00:00
|
|
|
#endif /* (defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) &&
|
|
|
|
!defined(OPENSSL_STATIC_ARMCAP) */
|