diff options
Diffstat (limited to 'src/Main/Forms/BenchmarkDialog.cpp')
-rw-r--r-- | src/Main/Forms/BenchmarkDialog.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/Main/Forms/BenchmarkDialog.cpp b/src/Main/Forms/BenchmarkDialog.cpp index 7b0209ff..168630fa 100644 --- a/src/Main/Forms/BenchmarkDialog.cpp +++ b/src/Main/Forms/BenchmarkDialog.cpp @@ -2,18 +2,21 @@ Derived from source code of TrueCrypt 7.1a, which is Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed by the TrueCrypt License 3.0. Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is contained in the file License.txt included in VeraCrypt binary and source code distribution packages. */ #include "System.h" #include "Volume/EncryptionModeXTS.h" +#ifdef WOLFCRYPT_BACKEND +#include "Volume/EncryptionModeWolfCryptXTS.h" +#endif #include "Main/GraphicUserInterface.h" #include "BenchmarkDialog.h" namespace VeraCrypt { @@ -40,14 +43,14 @@ namespace VeraCrypt BenchmarkChoice->Select (0); BufferSizeChoice->Select (1); UpdateBenchmarkList (); - - wxTextValidator validator (wxFILTER_INCLUDE_CHAR_LIST); // wxFILTER_NUMERIC does not exclude - . , etc. - const wxChar *valArr[] = { L"0", L"1", L"2", L"3", L"4", L"5", L"6", L"7", L"8", L"9" }; - validator.SetIncludes (wxArrayString (array_capacity (valArr), (const wxChar **) &valArr)); + + VolumePimText->SetMinSize (wxSize (Gui->GetCharWidth (VolumePimText) * 15, -1)); + + wxTextValidator validator (wxFILTER_DIGITS); VolumePimText->SetValidator (validator); Layout(); Fit(); Center(); @@ -207,13 +210,17 @@ namespace VeraCrypt BenchmarkResult result; result.AlgorithmName = ea->GetName(true); Buffer key (ea->GetKeySize()); ea->SetKey (key); - + #ifdef WOLFCRYPT_BACKEND + shared_ptr <EncryptionMode> xts (new EncryptionModeWolfCryptXTS); + ea->SetKeyXTS (key); + #else shared_ptr <EncryptionMode> xts (new EncryptionModeXTS); - xts->SetKey (key); + #endif + xts->SetKey (key); ea->SetMode (xts); wxLongLong startTime = wxGetLocalTimeMillis(); // CPU "warm up" (an attempt to prevent skewed results on systems where CPU frequency gradually changes depending on CPU load). @@ -272,11 +279,11 @@ namespace VeraCrypt Buffer dk(MASTER_KEYDATA_SIZE); Buffer salt(64); const char *tmp_salt = {"\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xAA\xBB\xCC\xDD\xEE\xFF\x01\x23\x45\x67\x89\xAB\xCD\xEF\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xAA\xBB\xCC\xDD\xEE\xFF\x01\x23\x45\x67\x89\xAB\xCD\xEF\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xAA\xBB\xCC\xDD\xEE\xFF"}; unsigned long pim; Pkcs5KdfList prfList = Pkcs5Kdf::GetAvailableAlgorithms (); - VolumePassword password ((const byte*) "passphrase-1234567890", 21); + VolumePassword password ((const uint8*) "passphrase-1234567890", 21); memcpy (&pim, buffer.Ptr (), sizeof (unsigned long)); memcpy (salt.Ptr(), tmp_salt, 64); foreach (shared_ptr <Pkcs5Kdf> prf, prfList) |