mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-05-21 20:11:30 +00:00
Linux/MacOSX: add progress bar for mouse collected entropy in GUI of volume creation wizard. Add mutex protection in event handler for shared counter variable
This commit is contained in:
@@ -21,7 +21,8 @@ namespace VeraCrypt
|
||||
PreviousGaugeValue (0),
|
||||
ProgressBarRange (1),
|
||||
RealProgressBarRange (1),
|
||||
VolumeCreatorRunning (false)
|
||||
VolumeCreatorRunning (false),
|
||||
MouseEventsCounter (0)
|
||||
{
|
||||
DisplayKeysCheckBox->SetValue (displayKeyInfo);
|
||||
#ifdef TC_WINDOWS
|
||||
@@ -35,6 +36,8 @@ namespace VeraCrypt
|
||||
ProgressGauge->SetMinSize (wxSize (-1, Gui->GetCharHeight (this) * 2));
|
||||
#endif
|
||||
|
||||
CollectedEntropy->SetRange (RNG_POOL_SIZE * 8);
|
||||
|
||||
if (DisplayKeysCheckBox->IsChecked())
|
||||
ShowBytes (RandomPoolSampleStaticText, RandomNumberGenerator::PeekPool(), true);
|
||||
else
|
||||
@@ -184,4 +187,11 @@ namespace VeraCrypt
|
||||
RealProgressBarRange = ProgressGauge->GetSize().GetWidth();
|
||||
ProgressGauge->SetRange (RealProgressBarRange);
|
||||
}
|
||||
|
||||
void VolumeCreationProgressWizardPage::IncrementEntropyProgress ()
|
||||
{
|
||||
ScopeLock lock (AccessMutex);
|
||||
if (MouseEventsCounter < (RNG_POOL_SIZE * 8))
|
||||
CollectedEntropy->SetValue (++MouseEventsCounter);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user