VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/Forms/VolumeCreationProgressWizardPage.cpp
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-02-09 00:49:04 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-02-09 00:52:28 +0100
commit39fb2edc25f2703744932f25d956bf7af604fc5f (patch)
treea25f2ab7bd6ee5d55b5e89093b86f6b7f802fa7e /src/Main/Forms/VolumeCreationProgressWizardPage.cpp
parent0863924483c09d05948f63d1b1740f107e3e80fe (diff)
downloadVeraCrypt-39fb2edc25f2703744932f25d956bf7af604fc5f.tar.gz
VeraCrypt-39fb2edc25f2703744932f25d956bf7af604fc5f.zip
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
Diffstat (limited to 'src/Main/Forms/VolumeCreationProgressWizardPage.cpp')
-rw-r--r--src/Main/Forms/VolumeCreationProgressWizardPage.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/Main/Forms/VolumeCreationProgressWizardPage.cpp b/src/Main/Forms/VolumeCreationProgressWizardPage.cpp
index a1964958..08986f5e 100644
--- a/src/Main/Forms/VolumeCreationProgressWizardPage.cpp
+++ b/src/Main/Forms/VolumeCreationProgressWizardPage.cpp
@@ -20,9 +20,10 @@ namespace VeraCrypt
: VolumeCreationProgressWizardPageBase (parent),
PreviousGaugeValue (0),
ProgressBarRange (1),
RealProgressBarRange (1),
- VolumeCreatorRunning (false)
+ VolumeCreatorRunning (false),
+ MouseEventsCounter (0)
{
DisplayKeysCheckBox->SetValue (displayKeyInfo);
#ifdef TC_WINDOWS
DisplayKeysCheckBox->SetLabel (L"");
@@ -34,8 +35,10 @@ namespace VeraCrypt
#else
ProgressGauge->SetMinSize (wxSize (-1, Gui->GetCharHeight (this) * 2));
#endif
+ CollectedEntropy->SetRange (RNG_POOL_SIZE * 8);
+
if (DisplayKeysCheckBox->IsChecked())
ShowBytes (RandomPoolSampleStaticText, RandomNumberGenerator::PeekPool(), true);
else
ShowAsterisks (RandomPoolSampleStaticText);
@@ -183,5 +186,12 @@ namespace VeraCrypt
ProgressBarRange = progressBarRange;
RealProgressBarRange = ProgressGauge->GetSize().GetWidth();
ProgressGauge->SetRange (RealProgressBarRange);
}
+
+ void VolumeCreationProgressWizardPage::IncrementEntropyProgress ()
+ {
+ ScopeLock lock (AccessMutex);
+ if (MouseEventsCounter < (RNG_POOL_SIZE * 8))
+ CollectedEntropy->SetValue (++MouseEventsCounter);
+ }
}