diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-12-28 22:58:54 +0100 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-12-31 01:56:16 +0100 |
commit | d462806ea970434ab9f09748f74a86608e1fb31e (patch) | |
tree | 372c621b6af698a7b8f8d303554fbc852ee0655a /Tests/bench.bat | |
parent | 859c111d013e64f9896daa64e0972befc11930ab (diff) | |
download | VeraCrypt-d462806ea970434ab9f09748f74a86608e1fb31e.tar.gz VeraCrypt-d462806ea970434ab9f09748f74a86608e1fb31e.zip |
Windows: Make benchmark batch file run a PRF measurement only when associated container file is present.
Diffstat (limited to 'Tests/bench.bat')
-rw-r--r-- | Tests/bench.bat | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/Tests/bench.bat b/Tests/bench.bat index fa018676..ec21ed02 100644 --- a/Tests/bench.bat +++ b/Tests/bench.bat @@ -10,6 +10,8 @@ goto :exit echo Using drive letter %mydriveletter%: for our tests
echo.
+IF NOT EXIST test.sha512.hc GOTO :whirlpool
+
rem Get start time:
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
@@ -63,6 +65,10 @@ echo. "c:\Program Files\VeraCrypt\veracrypt.exe" /dismount %mydriveletter% /silent /q
+:whirlpool
+
+IF NOT EXIST test.whirlpool.hc GOTO :sha256
+
rem Get start time:
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
@@ -116,6 +122,10 @@ echo. "c:\Program Files\VeraCrypt\veracrypt.exe" /dismount %mydriveletter% /silent /q
+:sha256
+
+IF NOT EXIST test.sha256.hc GOTO :ripemd160
+
rem Get start time:
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
@@ -169,6 +179,10 @@ echo. "c:\Program Files\VeraCrypt\veracrypt.exe" /dismount %mydriveletter% /silent /q
+:ripemd160
+
+IF NOT EXIST test.ripemd160.hc GOTO :autodetect
+
rem Get start time:
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
@@ -222,13 +236,19 @@ echo. "c:\Program Files\VeraCrypt\veracrypt.exe" /dismount %mydriveletter% /silent /q
+:autodetect
+
+call :availablevolume testvolume && goto :contautodetect
+goto :exit
+:contautodetect
+
rem Get start time:
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
)
rem Try to mount with a wrong password and PRF autodetection
-"c:\Program Files\VeraCrypt\veracrypt.exe" /volume test.sha512.hc /l %mydriveletter% /password wrongpassword /q /silent /m ro
+"c:\Program Files\VeraCrypt\veracrypt.exe" /volume %testvolume% /l %mydriveletter% /password wrongpassword /q /silent /m ro
rem Get end time:
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
@@ -283,4 +303,19 @@ set drive= :freedrive0
endlocal & set "%output_var%=%drive%" & exit /b %exitcode%
+:availablevolume
+setlocal EnableDelayedExpansion
+set exitcode=0
+set "output_var=%~1"
+for %%i in (test.sha512.hc,test.sha256.hc,test.whirlpool.hc,test.ripemd160.hc) do (
+ if exist %%i (
+ set "volume=%%i"
+ goto :availablevolume0
+ )
+)
+set exitcode=1
+set volume=
+:availablevolume0
+endlocal & set "%output_var%=%volume%" & exit /b %exitcode%
+
:exit
|