1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 19:08:26 -06:00

Windows: Add option to enable use of CPU RDRAND/RDSEED as source of entropy which is now disabled by default

This commit is contained in:
Mounir IDRASSI
2019-02-07 15:24:56 +01:00
parent 6bb1f24ed5
commit e5b9cee868
48 changed files with 108 additions and 15 deletions

View File

@@ -1535,10 +1535,11 @@ static VOID SetupThreadProc (PVOID threadArg)
KeQuerySystemTime( &iSeed );
WHIRLPOOL_init (&tctx);
WHIRLPOOL_add ((unsigned char *) &(iSeed.QuadPart), sizeof(iSeed.QuadPart), &tctx);
// use RDSEED or RDRAND from CPU as source of entropy if present
if ( (HasRDSEED() && RDSEED_getBytes (digest, sizeof (digest)))
// 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);
}