Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify AES-NI detection logic #641

Closed
wants to merge 1 commit into from
Closed
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
6 changes: 3 additions & 3 deletions src/headers/tomcrypt_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2);
#define ENDIAN_LITTLE
#define ENDIAN_64BITWORD
#define LTC_FAST
#if defined(__SSE4_1__)
#if __SSE4_1__ == 1
#define LTC_AMD64_SSE4_1
#if defined(__SSE4_1__) && defined(__AES__) && defined(LTC_AES_NI)
#if (__SSE4_1__ == 1) && (__AES__ == 1)
#define LTC_HAS_AES_NI
#endif
#endif
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/headers/tomcrypt_cipher.h
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ extern const struct ltc_cipher_descriptor rijndael_desc;
extern const struct ltc_cipher_descriptor rijndael_enc_desc;
#endif

#if defined(LTC_AES_NI) && defined(LTC_AMD64_SSE4_1)
#if defined(LTC_HAS_AES_NI)
int aesni_is_supported(void);
int aesni_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey);
int aesni_ecb_encrypt(const unsigned char *pt, unsigned char *ct, const symmetric_key *skey);
Expand Down
2 changes: 1 addition & 1 deletion src/headers/tomcrypt_custom.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
#define LTC_RC6
#define LTC_SAFERP
#define LTC_RIJNDAEL
#ifndef LTC_NO_AES_NI
#if !defined(LTC_NO_AES_NI)
#define LTC_AES_NI
#endif
#define LTC_XTEA
Expand Down
4 changes: 0 additions & 4 deletions src/headers/tomcrypt_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,6 @@ typedef struct

/* tomcrypt_cipher.h */

#if defined(LTC_AES_NI) && defined(LTC_AMD64_SSE4_1)
#define LTC_HAS_AES_NI
#endif

void blowfish_enc(ulong32 *data, unsigned long blocks, const symmetric_key *skey);
int blowfish_expand(const unsigned char *key, int keylen,
const unsigned char *data, int datalen,
Expand Down
2 changes: 1 addition & 1 deletion src/misc/crypt/crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ const char *crypt_build_settings =
#if defined(LTC_ADLER32)
" ADLER32 "
#endif
#if defined(LTC_AES_NI) && defined(LTC_AMD64_SSE4_1)
#if defined(LTC_AES_NI) && defined(LTC_HAS_AES_NI)
" AES-NI "
#endif
#if defined(LTC_BASE64)
Expand Down
Loading