VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/ExpandVolume/DlgExpandVolume.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ExpandVolume/DlgExpandVolume.cpp')
-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 73a38b59..0a24c2c2 100644
--- a/src/ExpandVolume/DlgExpandVolume.cpp
+++ b/src/ExpandVolume/DlgExpandVolume.cpp
@@ -345,29 +345,9 @@ BOOL CALLBACK ExpandVolProgressDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, L
DWORD mouseEventsCounter;
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",
*((DWORD*) (randPool + 12)), *((DWORD*) (randPool + 8)), *((DWORD*) (randPool + 4)), *((DWORD*) (randPool)));