VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Pkcs5.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2021-01-01 23:58:06 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2021-01-02 01:16:31 +0100
commit9881744c95737264c7cd9f13b3c70042c03584aa (patch)
treed3400963fd7884c674a622c052e23b585f3e9043 /src/Common/Pkcs5.c
parentdc3700e8bb53bac72eb429554ef6a017ae071fde (diff)
downloadVeraCrypt-9881744c95737264c7cd9f13b3c70042c03584aa.tar.gz
VeraCrypt-9881744c95737264c7cd9f13b3c70042c03584aa.zip
Windows: Add support for ARM64 platform (e.g. Microsoft Surface Pro X). System encryption still not implemented on ARM64
Diffstat (limited to 'src/Common/Pkcs5.c')
-rw-r--r--src/Common/Pkcs5.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Common/Pkcs5.c b/src/Common/Pkcs5.c
index 3c0c6a97..3ac3cc2c 100644
--- a/src/Common/Pkcs5.c
+++ b/src/Common/Pkcs5.c
@@ -91,7 +91,7 @@ void hmac_sha256
NTSTATUS saveStatus = STATUS_INVALID_PARAMETER;
#ifdef _WIN64
XSTATE_SAVE SaveState;
- if (g_isIntel && HasSAVX())
+ if (IsCpuIntel() && HasSAVX())
saveStatus = KeSaveExtendedProcessorStateVC(XSTATE_MASK_GSSE, &SaveState);
#else
KFLOATING_SAVE floatingPointState;
@@ -218,7 +218,7 @@ void derive_key_sha256 (char *pwd, int pwd_len, char *salt, int salt_len, uint32
NTSTATUS saveStatus = STATUS_INVALID_PARAMETER;
#ifdef _WIN64
XSTATE_SAVE SaveState;
- if (g_isIntel && HasSAVX())
+ if (IsCpuIntel() && HasSAVX())
saveStatus = KeSaveExtendedProcessorStateVC(XSTATE_MASK_GSSE, &SaveState);
#else
KFLOATING_SAVE floatingPointState;
@@ -361,7 +361,7 @@ void hmac_sha512
NTSTATUS saveStatus = STATUS_INVALID_PARAMETER;
#ifdef _WIN64
XSTATE_SAVE SaveState;
- if (g_isIntel && HasSAVX())
+ if (IsCpuIntel() && HasSAVX())
saveStatus = KeSaveExtendedProcessorStateVC(XSTATE_MASK_GSSE, &SaveState);
#else
KFLOATING_SAVE floatingPointState;
@@ -463,7 +463,7 @@ void derive_key_sha512 (char *pwd, int pwd_len, char *salt, int salt_len, uint32
NTSTATUS saveStatus = STATUS_INVALID_PARAMETER;
#ifdef _WIN64
XSTATE_SAVE SaveState;
- if (g_isIntel && HasSAVX())
+ if (IsCpuIntel() && HasSAVX())
saveStatus = KeSaveExtendedProcessorStateVC(XSTATE_MASK_GSSE, &SaveState);
#else
KFLOATING_SAVE floatingPointState;
@@ -1277,7 +1277,9 @@ int get_pkcs5_iteration_count (int pkcs5_prf_id, int pim, BOOL truecryptMode, BO
default:
TC_THROW_FATAL_EXCEPTION; // Unknown/wrong ID
}
+#if _MSC_VER < 1900
return 0;
+#endif
}
int is_pkcs5_prf_supported (int pkcs5_prf_id, BOOL truecryptMode, PRF_BOOT_TYPE bootType)