VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Driver
diff options
context:
space:
mode:
Diffstat (limited to 'src/Driver')
-rw-r--r--src/Driver/Driver.vcxproj4
-rw-r--r--src/Driver/Driver.vcxproj.filters3
-rw-r--r--src/Driver/Ntdriver.c11
3 files changed, 17 insertions, 1 deletions
diff --git a/src/Driver/Driver.vcxproj b/src/Driver/Driver.vcxproj
index aa920225..628e24a4 100644
--- a/src/Driver/Driver.vcxproj
+++ b/src/Driver/Driver.vcxproj
@@ -227,8 +227,12 @@ copy $(OutDir)veracrypt.inf "$(SolutionDir)Debug\Setup Files\veracrypt.inf"</Com
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\Crypto\Aeskey.c" />
<ClCompile Include="..\Crypto\Aestab.c" />
+ <ClCompile Include="..\Crypto\Aes_hw_armv8.c">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ </ClCompile>
<ClCompile Include="..\Crypto\blake2s.c" />
<ClCompile Include="..\Crypto\blake2s_SSE2.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
diff --git a/src/Driver/Driver.vcxproj.filters b/src/Driver/Driver.vcxproj.filters
index 478432fa..6f43b0e8 100644
--- a/src/Driver/Driver.vcxproj.filters
+++ b/src/Driver/Driver.vcxproj.filters
@@ -164,8 +164,11 @@
</ClCompile>
<ClCompile Include="..\Driver\VolumeFilter.c">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="..\Crypto\Aes_hw_armv8.c">
+ <Filter>Crypto\Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\Common\Tcdefs.h">
<Filter>Common</Filter>
diff --git a/src/Driver/Ntdriver.c b/src/Driver/Ntdriver.c
index ab208019..6d218517 100644
--- a/src/Driver/Ntdriver.c
+++ b/src/Driver/Ntdriver.c
@@ -231,17 +231,18 @@ void GetDriverRandomSeed (unsigned char* pbRandSeed, size_t cbRandSeed)
WHIRLPOOL_add (digest, (unsigned int) rndLen, &tctx);
jent_entropy_collector_free (ec);
}
}
-
+#ifndef _M_ARM64
// use RDSEED or RDRAND from CPU as source of entropy if enabled
if ( IsCpuRngEnabled() &&
( (HasRDSEED() && RDSEED_getBytes (digest, sizeof (digest)))
|| (HasRDRAND() && RDRAND_getBytes (digest, sizeof (digest)))
))
{
WHIRLPOOL_add (digest, sizeof(digest), &tctx);
}
+#endif
WHIRLPOOL_finalize (&tctx, digest);
count = VC_MIN (cbRandSeed, sizeof (digest));
@@ -265,9 +266,13 @@ NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
int i;
Dump("DriverEntry " TC_APP_NAME " " VERSION_STRING VERSION_STRING_SUFFIX "\n");
+#ifndef _M_ARM64
DetectX86Features();
+#else
+ DetectArmFeatures();
+#endif
PsGetVersion(&OsMajorVersion, &OsMinorVersion, NULL, NULL);
Dump("OsMajorVersion=%d OsMinorVersion=%d\n", OsMajorVersion, OsMinorVersion);
@@ -292,9 +297,13 @@ NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
if (!SelfTestsPassed)
{
// in case of system encryption, if self-tests fail, disable all extended CPU
// features and try again in order to workaround faulty configurations
+#ifndef _M_ARM64
DisableCPUExtendedFeatures();
+#else
+ EnableHwEncryption(FALSE);
+#endif
SelfTestsPassed = AutoTestAlgorithms();
// BUG CHECK if the self-tests still fail
if (!SelfTestsPassed)