mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 02:58:02 -06:00
MacOSX: Make AESNI availability linked to compiler target and not compilation host
This commit is contained in:
@@ -209,6 +209,7 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define CRYPTOPP_CPUID_AVAILABLE
|
#define CRYPTOPP_CPUID_AVAILABLE
|
||||||
|
#define TC_AES_HW_CPU
|
||||||
|
|
||||||
// these should not be used directly
|
// these should not be used directly
|
||||||
extern volatile int g_x86DetectionDone;
|
extern volatile int g_x86DetectionDone;
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
#ifdef TC_AES_HW_CPU
|
#ifdef TC_AES_HW_CPU
|
||||||
# include "Crypto/Aes_hw_cpu.h"
|
# include "Crypto/Aes_hw_cpu.h"
|
||||||
#endif
|
#endif
|
||||||
#include "Crypto/cpu.h"
|
|
||||||
|
|
||||||
extern "C" int IsAesHwCpuSupported ()
|
extern "C" int IsAesHwCpuSupported ()
|
||||||
{
|
{
|
||||||
@@ -32,7 +31,7 @@ extern "C" int IsAesHwCpuSupported ()
|
|||||||
|
|
||||||
if (!stateValid)
|
if (!stateValid)
|
||||||
{
|
{
|
||||||
state = g_hasAESNI ? true : false;
|
state = HasAESNI() ? true : false;
|
||||||
stateValid = true;
|
stateValid = true;
|
||||||
}
|
}
|
||||||
return state && VeraCrypt::Cipher::IsHwSupportEnabled();
|
return state && VeraCrypt::Cipher::IsHwSupportEnabled();
|
||||||
@@ -203,7 +202,7 @@ namespace VeraCrypt
|
|||||||
|
|
||||||
if (!stateValid)
|
if (!stateValid)
|
||||||
{
|
{
|
||||||
state = g_hasAESNI ? true : false;
|
state = HasAESNI() ? true : false;
|
||||||
stateValid = true;
|
stateValid = true;
|
||||||
}
|
}
|
||||||
return state && HwSupportEnabled;
|
return state && HwSupportEnabled;
|
||||||
|
|||||||
@@ -14,8 +14,7 @@
|
|||||||
#define TC_HEADER_Encryption_Ciphers
|
#define TC_HEADER_Encryption_Ciphers
|
||||||
|
|
||||||
#include "Platform/Platform.h"
|
#include "Platform/Platform.h"
|
||||||
#include "Crypto/config.h"
|
#include "Crypto/cpu.h"
|
||||||
|
|
||||||
|
|
||||||
namespace VeraCrypt
|
namespace VeraCrypt
|
||||||
{
|
{
|
||||||
@@ -126,10 +125,6 @@ namespace VeraCrypt
|
|||||||
|
|
||||||
#undef TC_EXCEPTION
|
#undef TC_EXCEPTION
|
||||||
|
|
||||||
#if (defined (TC_ARCH_X86) || defined (TC_ARCH_X64)) && !defined (__ppc__)
|
|
||||||
# define TC_AES_HW_CPU
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // TC_HEADER_Encryption_Ciphers
|
#endif // TC_HEADER_Encryption_Ciphers
|
||||||
|
|||||||
Reference in New Issue
Block a user