Skip to content

Commit 862a98a

Browse files
committed
Aarch64 and ARM32 AES XTS with crypto instructions
Optimised assembly of AES-XTS for Aarch64 and ARM32 using hardware crypto instructions. Aarch64 has loop unrolling. Update aes.c to not have AES-XTS implementation when assembly compilable. Update test of AES-XTS to check expected cipher text of partial block encryption.
1 parent 5a5a8c9 commit 862a98a

3 files changed

Lines changed: 1349 additions & 0 deletions

File tree

wolfcrypt/src/aes.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11041,6 +11041,7 @@ void AES_XTS_decrypt_avx1(const unsigned char *in, unsigned char *out,
1104111041

1104211042
#endif /* WOLFSSL_AESNI */
1104311043

11044+
#if !defined(WOLFSSL_ARMASM) || defined(WOLFSSL_ARMASM_NO_HW_CRYPTO)
1104411045
#ifdef HAVE_AES_ECB
1104511046
/* helper function for encrypting / decrypting full buffer at once */
1104611047
static WARN_UNUSED_RESULT int _AesXtsHelper(
@@ -11438,6 +11439,8 @@ int wc_AesXtsDecrypt(XtsAes* xaes, byte* out, const byte* in, word32 sz,
1143811439
return AesXtsDecrypt_sw(xaes, out, in, sz, i);
1143911440
}
1144011441
}
11442+
#endif /* !WOLFSSL_ARMASM || WOLFSSL_ARMASM_NO_HW_CRYPTO */
11443+
1144111444
#endif /* WOLFSSL_AES_XTS */
1144211445

1144311446
#ifdef WOLFSSL_AES_SIV

0 commit comments

Comments
 (0)