diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2019-02-07 15:24:56 +0100 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2019-02-08 01:50:03 +0100 |
commit | e5b9cee8681dc45340321f759079b344a3b2676c (patch) | |
tree | 7e4875ccf109ebd2d2a858ec0368f2d9d46e2a5a /src/Common/Crypto.c | |
parent | 6bb1f24ed571bccd4d1d247dafdc1dda6eaa3d8d (diff) | |
download | VeraCrypt-e5b9cee8681dc45340321f759079b344a3b2676c.tar.gz VeraCrypt-e5b9cee8681dc45340321f759079b344a3b2676c.zip |
Windows: Add option to enable use of CPU RDRAND/RDSEED as source of entropy which is now disabled by default
Diffstat (limited to 'src/Common/Crypto.c')
-rw-r--r-- | src/Common/Crypto.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/Common/Crypto.c b/src/Common/Crypto.c index 299595bd..a6f3ffb7 100644 --- a/src/Common/Crypto.c +++ b/src/Common/Crypto.c @@ -1216,3 +1216,29 @@ BOOL IsHwEncryptionEnabled () } #endif // !TC_WINDOWS_BOOT + +#ifndef TC_WINDOWS_BOOT + +static BOOL CpuRngDisabled = FALSE; + +BOOL IsCpuRngSupport () +{ + if (HasRDSEED() || HasRDSEED()) + return TRUE; + else + return FALSE; +} + +void EnableCpuRng (BOOL enable) +{ + CpuRngDisabled = !enable; +} + +BOOL IsCpuRngEnabled () +{ + return !CpuRngDisabled; +} + + +#endif + |