Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/include.am
Original file line number Diff line number Diff line change
Expand Up @@ -1885,7 +1885,9 @@ src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/ge_operations.c
if BUILD_CURVE25519_INTELASM
if !BUILD_X86_ASM
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/fe_x25519_asm.S
endif !BUILD_X86_ASM
else
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/fe_operations.c
endif BUILD_X86_ASM
else
if BUILD_ARMASM
if !BUILD_FIPS_V6_PLUS
Expand Down Expand Up @@ -1946,7 +1948,9 @@ src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/ge_operations.c
if BUILD_CURVE25519_INTELASM
if !BUILD_X86_ASM
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/fe_x25519_asm.S
endif !BUILD_X86_ASM
else
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/fe_operations.c
endif BUILD_X86_ASM
else
if !BUILD_FIPS_V6_PLUS
if BUILD_ARMASM
Expand Down
32 changes: 16 additions & 16 deletions wolfcrypt/src/aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -15759,7 +15759,7 @@ int wc_AesXtsDecryptSector(XtsAes* aes, byte* out, const byte* in, word32 sz,
}
#endif

#ifdef WOLFSSL_AESNI
#if defined(WOLFSSL_AESNI) && !defined(WOLFSSL_X86_BUILD)

#if defined(USE_INTEL_SPEEDUP_FOR_AES) && !defined(USE_INTEL_SPEEDUP)
#define USE_INTEL_SPEEDUP
Expand Down Expand Up @@ -15822,7 +15822,7 @@ void AES_XTS_decrypt_update_avx1(const unsigned char *in, unsigned char *out, wo
#endif /* HAVE_INTEL_AVX1 */
#endif /* HAVE_AES_DECRYPT */

#endif /* WOLFSSL_AESNI */
#endif /* WOLFSSL_AESNI && !WOLFSSL_X86_BUILD */

#ifdef HAVE_AES_ECB
#if (!defined(WOLFSSL_ARMASM) || (!defined(__aarch64__) && \
Expand Down Expand Up @@ -16075,7 +16075,7 @@ int wc_AesXtsEncrypt(XtsAes* xaes, byte* out, const byte* in, word32 sz,
AES_XTS_encrypt_AARCH32(in, out, sz, i, (byte*)xaes->aes.key,
(byte*)xaes->tweak.key, (byte*)xaes->aes.tmp, xaes->aes.rounds);
ret = 0;
#elif defined(WOLFSSL_AESNI)
#elif defined(WOLFSSL_AESNI) && !defined(WOLFSSL_X86_BUILD)
if (aes->use_aesni) {
SAVE_VECTOR_REGISTERS(return _svr_ret;);
#if defined(HAVE_INTEL_AVX1)
Expand Down Expand Up @@ -16177,7 +16177,7 @@ int wc_AesXtsEncryptInit(XtsAes* xaes, const byte* i, word32 iSz,
stream->bytes_crypted_with_this_tweak = 0;

{
#ifdef WOLFSSL_AESNI
#if defined(WOLFSSL_AESNI) && !defined(WOLFSSL_X86_BUILD)
if (aes->use_aesni) {
SAVE_VECTOR_REGISTERS(return _svr_ret;);
#if defined(HAVE_INTEL_AVX1)
Expand All @@ -16198,7 +16198,7 @@ int wc_AesXtsEncryptInit(XtsAes* xaes, const byte* i, word32 iSz,
RESTORE_VECTOR_REGISTERS();
}
else
#endif /* WOLFSSL_AESNI */
#endif /* WOLFSSL_AESNI && !WOLFSSL_X86_BUILD */
{
ret = AesXtsInitTweak_sw(xaes, stream->tweak_block);
}
Expand Down Expand Up @@ -16228,15 +16228,15 @@ static int AesXtsEncryptUpdate(XtsAes* xaes, byte* out, const byte* in, word32 s
{
int ret;

#ifdef WOLFSSL_AESNI
#if defined(WOLFSSL_AESNI) && !defined(WOLFSSL_X86_BUILD)
Aes *aes;
#endif

if (xaes == NULL || out == NULL || in == NULL) {
return BAD_FUNC_ARG;
}

#ifdef WOLFSSL_AESNI
#if defined(WOLFSSL_AESNI) && !defined(WOLFSSL_X86_BUILD)
aes = &xaes->aes;
#endif

Expand Down Expand Up @@ -16272,7 +16272,7 @@ static int AesXtsEncryptUpdate(XtsAes* xaes, byte* out, const byte* in, word32 s
}
#endif
{
#ifdef WOLFSSL_AESNI
#if defined(WOLFSSL_AESNI) && !defined(WOLFSSL_X86_BUILD)
if (aes->use_aesni) {
SAVE_VECTOR_REGISTERS(return _svr_ret;);
#if defined(HAVE_INTEL_AVX1)
Expand All @@ -16295,7 +16295,7 @@ static int AesXtsEncryptUpdate(XtsAes* xaes, byte* out, const byte* in, word32 s
RESTORE_VECTOR_REGISTERS();
}
else
#endif /* WOLFSSL_AESNI */
#endif /* WOLFSSL_AESNI && !WOLFSSL_X86_BUILD */
{
ret = AesXtsEncryptUpdate_sw(xaes, out, in, sz, stream->tweak_block);
}
Expand Down Expand Up @@ -16556,7 +16556,7 @@ int wc_AesXtsDecrypt(XtsAes* xaes, byte* out, const byte* in, word32 sz,
AES_XTS_decrypt_AARCH32(in, out, sz, i, (byte*)xaes->aes.key,
(byte*)xaes->tweak.key, (byte*)xaes->aes.tmp, xaes->aes.rounds);
ret = 0;
#elif defined(WOLFSSL_AESNI)
#elif defined(WOLFSSL_AESNI) && !defined(WOLFSSL_X86_BUILD)
if (aes->use_aesni) {
SAVE_VECTOR_REGISTERS(return _svr_ret;);
#if defined(HAVE_INTEL_AVX1)
Expand Down Expand Up @@ -16661,7 +16661,7 @@ int wc_AesXtsDecryptInit(XtsAes* xaes, const byte* i, word32 iSz,
stream->bytes_crypted_with_this_tweak = 0;

{
#ifdef WOLFSSL_AESNI
#if defined(WOLFSSL_AESNI) && !defined(WOLFSSL_X86_BUILD)
if (aes->use_aesni) {
SAVE_VECTOR_REGISTERS(return _svr_ret;);
#if defined(HAVE_INTEL_AVX1)
Expand All @@ -16682,7 +16682,7 @@ int wc_AesXtsDecryptInit(XtsAes* xaes, const byte* i, word32 iSz,
RESTORE_VECTOR_REGISTERS();
}
else
#endif /* WOLFSSL_AESNI */
#endif /* WOLFSSL_AESNI && !WOLFSSL_X86_BUILD */
{
ret = AesXtsInitTweak_sw(xaes, stream->tweak_block);
}
Expand Down Expand Up @@ -16710,15 +16710,15 @@ static int AesXtsDecryptUpdate(XtsAes* xaes, byte* out, const byte* in, word32 s
struct XtsAesStreamData *stream)
{
int ret;
#ifdef WOLFSSL_AESNI
#if defined(WOLFSSL_AESNI) && !defined(WOLFSSL_X86_BUILD)
Aes *aes;
#endif

if (xaes == NULL || out == NULL || in == NULL) {
return BAD_FUNC_ARG;
}

#ifdef WOLFSSL_AESNI
#if defined(WOLFSSL_AESNI) && !defined(WOLFSSL_X86_BUILD)
#ifdef WC_AES_XTS_SUPPORT_SIMULTANEOUS_ENC_AND_DEC_KEYS
aes = &xaes->aes_decrypt;
#else
Expand Down Expand Up @@ -16748,7 +16748,7 @@ static int AesXtsDecryptUpdate(XtsAes* xaes, byte* out, const byte* in, word32 s
#endif

{
#ifdef WOLFSSL_AESNI
#if defined(WOLFSSL_AESNI) && !defined(WOLFSSL_X86_BUILD)
if (aes->use_aesni) {
SAVE_VECTOR_REGISTERS(return _svr_ret;);
#if defined(HAVE_INTEL_AVX1)
Expand All @@ -16771,7 +16771,7 @@ static int AesXtsDecryptUpdate(XtsAes* xaes, byte* out, const byte* in, word32 s
RESTORE_VECTOR_REGISTERS();
}
else
#endif /* WOLFSSL_AESNI */
#endif /* WOLFSSL_AESNI && !WOLFSSL_X86_BUILD */
{
ret = AesXtsDecryptUpdate_sw(xaes, out, in, sz,
stream->tweak_block);
Expand Down
10 changes: 5 additions & 5 deletions wolfcrypt/src/aes_asm.S
Original file line number Diff line number Diff line change
Expand Up @@ -1831,11 +1831,11 @@ _AES_ECB_decrypt_AESNI:
push %edi
push %esi
push %ebx
movl 20(%esp), %edi
movl 24(%esp), %esi
movl 28(%esp), %edx
movl 32(%esp), %ecx
movl 36(%esp), %eax
movl 16(%esp), %edi
movl 20(%esp), %esi
movl 24(%esp), %edx
movl 28(%esp), %ecx
movl 32(%esp), %eax


movl %edx, %ebx
Expand Down
2 changes: 0 additions & 2 deletions wolfcrypt/src/aes_gcm_asm.S
Original file line number Diff line number Diff line change
Expand Up @@ -3485,7 +3485,6 @@ L_AES_GCM_decrypt_aesni_last_block_start:
movdqa %xmm1, %xmm12
pclmulqdq $0x00, %xmm0, %xmm12
aesenc 80(%r15), %xmm8
movdqa %xmm1, %xmm1
pclmulqdq $0x11, %xmm0, %xmm1
aesenc 96(%r15), %xmm8
pxor %xmm11, %xmm10
Expand Down Expand Up @@ -6303,7 +6302,6 @@ L_AES_GCM_decrypt_update_aesni_last_block_start:
movdqa %xmm1, %xmm12
pclmulqdq $0x00, %xmm0, %xmm12
aesenc 80(%rdi), %xmm8
movdqa %xmm1, %xmm1
pclmulqdq $0x11, %xmm0, %xmm1
aesenc 96(%rdi), %xmm8
pxor %xmm11, %xmm10
Expand Down
Loading
Loading