VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/Forms/RandomPoolEnrichmentDialog.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/RandomPoolEnrichmentDialog.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/RandomPoolEnrichmentDialog.cpp')
-rw-r--r--src/Main/Forms/RandomPoolEnrichmentDialog.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Main/Forms/RandomPoolEnrichmentDialog.cpp b/src/Main/Forms/RandomPoolEnrichmentDialog.cpp
index f8b04d24..ecbfe7ac 100644
--- a/src/Main/Forms/RandomPoolEnrichmentDialog.cpp
+++ b/src/Main/Forms/RandomPoolEnrichmentDialog.cpp
@@ -35,6 +35,8 @@ namespace VeraCrypt
HideBytes (RandomPoolStaticText, 24);
MouseStaticText->Wrap (Gui->GetCharWidth (MouseStaticText) * 70);
+
+ CollectedEntropy->SetRange (RNG_POOL_SIZE * 8);
MainSizer->SetMinSize (wxSize (-1, Gui->GetCharHeight (this) * 24));
@@ -76,7 +78,8 @@ namespace VeraCrypt
/* conservative estimate: 1 mouse move event brings 1 bit of entropy
* https://security.stackexchange.com/questions/32844/for-how-much-time-should-i-randomly-move-the-mouse-for-generating-encryption-key/32848#32848
*/
- if (MouseEventsCounter < 2560)
+ ScopeLock lock (AccessMutex);
+ if (MouseEventsCounter < (RNG_POOL_SIZE * 8))
CollectedEntropy->SetValue (++MouseEventsCounter);
}