Fix a bug where intrinsics were ignored when compiling for apple silicon (#1074)

* Found an error on apple silicon not reporting that it supports SHA2 instructions

* Update output of test_hash

Co-authored-by: Jason Goertzen <Martyrshot@gmail.com>
This commit is contained in:
Douglas Stebila 2021-08-09 13:02:50 -04:00 committed by GitHub
parent 2db7f97922
commit c2eedffb1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -54,7 +54,7 @@ int main(void) {
#if defined(__ARM_FEATURE_AES)
printf("ARM_AES;");
#endif
#if defined(__ARM_FEATURE_SHA2)
#if (defined(__APPLE__) && defined(__aarch64__)) || defined(__ARM_FEATURE_SHA2)
printf("ARM_SHA2;");
#endif
#if defined(__ARM_FEATURE_SHA3)

View File

@ -186,6 +186,8 @@ static void print_oqs_configuration(void) {
#endif
#if defined(OQS_USE_SHA2_OPENSSL)
printf("SHA-2: OpenSSL\n");
#elif defined(OQS_USE_ARM_SHA2_INSTRUCTIONS)
printf("SHA-2: C and ARM CRYPTO extensions\n");
#else
printf("SHA-2: C\n");
#endif