Skip to content

Commit

Permalink
fix aesce
Browse files Browse the repository at this point in the history
Signed-off-by: Jerry Yu <[email protected]>
  • Loading branch information
yuhaoth committed Apr 4, 2023
1 parent 4196260 commit fd8c606
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions library/aesce.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,9 @@
#include <string.h>
#include "common.h"

#if defined(MBEDTLS_AESCE_C)

#include "aesce.h"

#if defined(MBEDTLS_HAVE_ARM64)
#if MBEDTLS_AES_HAVE_AESCE

#if !defined(__ARM_FEATURE_AES) || defined(MBEDTLS_ENABLE_ARM_CRYPTO_EXTENSIONS_COMPILER_FLAG)
# if defined(__clang__)
Expand Down Expand Up @@ -74,23 +72,6 @@
#include <sys/auxv.h>
#endif

#if !defined(MBEDTLS_AES_HAS_NO_BUILTIN)
/*
* AES instruction support detection routine
*/
int mbedtls_aesce_has_support(void)
{
#if defined(__linux__)
unsigned long auxval = getauxval(AT_HWCAP);
return (auxval & (HWCAP_ASIMD | HWCAP_AES)) ==
(HWCAP_ASIMD | HWCAP_AES);
#else
/* Assume AES instructions are supported. */
return 1;
#endif
}
#endif

static uint8x16_t aesce_encrypt_block(uint8x16_t block,
unsigned char *keys,
int rounds)
Expand Down Expand Up @@ -408,6 +389,5 @@ void mbedtls_aesce_gcm_mult(unsigned char c[16],
#undef MBEDTLS_POP_TARGET_PRAGMA
#endif

#endif /* MBEDTLS_HAVE_ARM64 */

#endif /* MBEDTLS_AESCE_C */
#endif /* MBEDTLS_AES_HAVE_AESCE */

0 comments on commit fd8c606

Please sign in to comment.