VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/Forms/RandomPoolEnrichmentDialog.cpp
diff options
context:
space:
mode:
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);
}