VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common
diff options
context:
space:
mode:
Diffstat (limited to 'src/Common')
-rw-r--r--src/Common/Crypto.c28
-rw-r--r--src/Common/Dlgcode.c4
-rw-r--r--src/Common/Dlgcode.h2
-rw-r--r--src/Common/Random.c4
-rw-r--r--src/Common/Tests.c2
5 files changed, 10 insertions, 30 deletions
diff --git a/src/Common/Crypto.c b/src/Common/Crypto.c
index 32ef4b56..2f4e447f 100644
--- a/src/Common/Crypto.c
+++ b/src/Common/Crypto.c
@@ -1164,8 +1164,6 @@ BOOL IsAesHwCpuSupported ()
}
return state && !HwEncryptionDisabled;
-#elif defined (_M_ARM64) || defined(__arm__) || defined (__arm64__) || defined (__aarch64__)
- return 0;
#else
return (HasAESNI() && !HwEncryptionDisabled)? TRUE : FALSE;
#endif
@@ -1483,29 +1481,3 @@ void VcUnprotectKeys (PCRYPTO_INFO pCryptoInfo, uint64 encID)
#endif
-#if defined(_M_ARM64) || defined(__arm__) || defined (__arm64__) || defined (__aarch64__)
-/* dummy implementation that should never be called */
-void aes_hw_cpu_decrypt(const uint8* ks, uint8* data)
-{
- ks = ks;
- data = data;
-}
-
-void aes_hw_cpu_decrypt_32_blocks(const uint8* ks, uint8* data)
-{
- ks = ks;
- data = data;
-}
-
-void aes_hw_cpu_encrypt(const uint8* ks, uint8* data)
-{
- ks = ks;
- data = data;
-}
-
-void aes_hw_cpu_encrypt_32_blocks(const uint8* ks, uint8* data)
-{
- ks = ks;
- data = data;
-}
-#endif
diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c
index 045def76..e471fc46 100644
--- a/src/Common/Dlgcode.c
+++ b/src/Common/Dlgcode.c
@@ -1046,7 +1046,7 @@ BOOL IsOSVersionAtLeast (OSVersionEnum reqMinOS, int reqMinServicePack)
>= (major << 16 | minor << 8 | reqMinServicePack));
}
-BOOL IsWin10BuildAtLeast(DWORD minBuild)
+BOOL IsWin10BuildAtLeast(int minBuild)
{
// Must first be recognized as Windows 10 or higher
if (nCurrentOS < WIN_10)
@@ -14883,6 +14883,7 @@ void GetAppRandomSeed (unsigned char* pbRandSeed, size_t cbRandSeed)
}
}
+#ifndef _M_ARM64
// use RDSEED or RDRAND from CPU as source of entropy if enabled
if ( IsCpuRngEnabled() &&
( (HasRDSEED() && RDSEED_getBytes (digest, sizeof (digest)))
@@ -14891,6 +14892,7 @@ void GetAppRandomSeed (unsigned char* pbRandSeed, size_t cbRandSeed)
{
WHIRLPOOL_add (digest, sizeof(digest), &tctx);
}
+#endif
WHIRLPOOL_finalize (&tctx, digest);
count = VC_MIN (cbRandSeed, sizeof (digest));
diff --git a/src/Common/Dlgcode.h b/src/Common/Dlgcode.h
index 8148bd09..aaaad97e 100644
--- a/src/Common/Dlgcode.h
+++ b/src/Common/Dlgcode.h
@@ -503,7 +503,7 @@ void Debug (char *format, ...);
void DebugMsgBox (char *format, ...);
BOOL IsOSAtLeast (OSVersionEnum reqMinOS);
BOOL IsOSVersionAtLeast (OSVersionEnum reqMinOS, int reqMinServicePack);
-BOOL IsWin10BuildAtLeast(DWORD minBuild);
+BOOL IsWin10BuildAtLeast(int minBuild);
BOOL IsSupportedOS ();
BOOL Is64BitOs ();
BOOL IsARM();
diff --git a/src/Common/Random.c b/src/Common/Random.c
index 0aab0cff..10995f74 100644
--- a/src/Common/Random.c
+++ b/src/Common/Random.c
@@ -878,6 +878,7 @@ BOOL SlowPoll (void)
}
}
+#ifndef _M_ARM64
// use RDSEED or RDRAND from CPU as source of entropy if present
if ( IsCpuRngEnabled() &&
( (HasRDSEED() && RDSEED_getBytes (buffer, sizeof (buffer)))
@@ -886,6 +887,7 @@ BOOL SlowPoll (void)
{
RandaddBuf (buffer, sizeof (buffer));
}
+#endif
burn(buffer, sizeof (buffer));
@@ -1011,6 +1013,7 @@ BOOL FastPoll (void)
return FALSE;
}
+#ifndef _M_ARM64
// use RDSEED or RDRAND from CPU as source of entropy if enabled
if ( IsCpuRngEnabled() &&
( (HasRDSEED() && RDSEED_getBytes (buffer, sizeof (buffer)))
@@ -1019,6 +1022,7 @@ BOOL FastPoll (void)
{
RandaddBuf (buffer, sizeof (buffer));
}
+#endif
burn (buffer, sizeof(buffer));
diff --git a/src/Common/Tests.c b/src/Common/Tests.c
index f6a9183d..89af24f1 100644
--- a/src/Common/Tests.c
+++ b/src/Common/Tests.c
@@ -1490,7 +1490,9 @@ BOOL AutoTestAlgorithms (void)
{
/* unexepected exception raised. Disable all CPU extended feature and try again */
EnableHwEncryption (hwEncryptionEnabled);
+#ifndef _M_ARM64
DisableCPUExtendedFeatures ();
+#endif
__try
{
result = DoAutoTestAlgorithms();