VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/ExpandVolume
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-02-11 22:54:35 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-02-11 23:04:31 (GMT)
commitd7d4c98775e34c7cb723ca813e8a76fe83610013 (patch)
tree262b84c9543995c64a2c93296f3dfebd4e27d3f3 /src/ExpandVolume
parent89d238bb3241fe8c285e9b748c0d99fa10b6a590 (diff)
downloadVeraCrypt-d7d4c98775e34c7cb723ca813e8a76fe83610013.zip
VeraCrypt-d7d4c98775e34c7cb723ca813e8a76fe83610013.tar.gz
Windows: Add colors (Red, Yellow, Green) to the collected randomness indicator depending on how much entropy was gathered. Code re-factoring.
Diffstat (limited to 'src/ExpandVolume')
-rw-r--r--src/ExpandVolume/DlgExpandVolume.cpp22
1 files changed, 1 insertions, 21 deletions
diff --git a/src/ExpandVolume/DlgExpandVolume.cpp b/src/ExpandVolume/DlgExpandVolume.cpp
index 73a38b5..0a24c2c 100644
--- a/src/ExpandVolume/DlgExpandVolume.cpp
+++ b/src/ExpandVolume/DlgExpandVolume.cpp
@@ -346,27 +346,7 @@ BOOL CALLBACK ExpandVolProgressDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, L
RandpeekBytes (hwndDlg, randPool, sizeof (randPool),&mouseEventsCounter);
- /* 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 (mouseEntropyGathered == 0xFFFFFFFF)
- {
- mouseEventsInitialCount = mouseEventsCounter;
- mouseEntropyGathered = 0;
- }
- else
- {
- if ( mouseEntropyGathered < maxEntropyLevel
- && (mouseEventsCounter >= mouseEventsInitialCount)
- && (mouseEventsCounter - mouseEventsInitialCount) <= maxEntropyLevel)
- mouseEntropyGathered = mouseEventsCounter - mouseEventsInitialCount;
- else
- mouseEntropyGathered = maxEntropyLevel;
-
- SendMessage (hEntropyBar, PBM_SETPOS,
- (WPARAM) (mouseEntropyGathered),
- 0);
- }
+ ProcessEntropyEstimate (hEntropyBar, &mouseEventsInitialCount, mouseEventsCounter, maxEntropyLevel, &mouseEntropyGathered);
if (showRandPool)
StringCbPrintfW (szRndPool, sizeof(szRndPool), L"%08X%08X%08X%08X",