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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user