From a3f200abe649499a0b5f0bfe248d82cc897f7e78 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 23 Aug 2023 22:18:11 +0200 Subject: [PATCH] Manually define __ARM_FEATURE_AES (necessary for CheriOS) --- .../aegis128l/armcrypto/aead_aegis128l_armcrypto.c | 4 ++++ .../aegis256/armcrypto/aead_aegis256_armcrypto.c | 6 +++++- .../aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/libsodium/crypto_aead/aegis128l/armcrypto/aead_aegis128l_armcrypto.c b/src/libsodium/crypto_aead/aegis128l/armcrypto/aead_aegis128l_armcrypto.c index de7aa4dc..45b82207 100644 --- a/src/libsodium/crypto_aead/aegis128l/armcrypto/aead_aegis128l_armcrypto.c +++ b/src/libsodium/crypto_aead/aegis128l/armcrypto/aead_aegis128l_armcrypto.c @@ -17,6 +17,10 @@ #if defined(HAVE_ARMCRYPTO) && defined(NATIVE_LITTLE_ENDIAN) +#ifndef __ARM_FEATURE_AES +#define __ARM_FEATURE_AES 1 +#endif + #include typedef uint8x16_t aes_block_t; diff --git a/src/libsodium/crypto_aead/aegis256/armcrypto/aead_aegis256_armcrypto.c b/src/libsodium/crypto_aead/aegis256/armcrypto/aead_aegis256_armcrypto.c index 5d934a80..359c5fc9 100644 --- a/src/libsodium/crypto_aead/aegis256/armcrypto/aead_aegis256_armcrypto.c +++ b/src/libsodium/crypto_aead/aegis256/armcrypto/aead_aegis256_armcrypto.c @@ -17,7 +17,11 @@ #if defined(HAVE_ARMCRYPTO) && defined(NATIVE_LITTLE_ENDIAN) -# include +#ifndef __ARM_FEATURE_AES +#define __ARM_FEATURE_AES 1 +#endif + +#include typedef uint8x16_t aes_block_t; #define AES_BLOCK_XOR(A, B) veorq_u8((A), (B)) diff --git a/src/libsodium/crypto_aead/aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c b/src/libsodium/crypto_aead/aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c index 32484ffa..f730ee79 100644 --- a/src/libsodium/crypto_aead/aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c +++ b/src/libsodium/crypto_aead/aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c @@ -19,6 +19,10 @@ #define __vectorcall #endif +#ifndef __ARM_FEATURE_AES +#define __ARM_FEATURE_AES 1 +#endif + #include #define ABYTES crypto_aead_aes256gcm_ABYTES