VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/Forms
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2018-08-09 19:18:18 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2018-08-10 01:31:32 +0200
commitc84bcd4b474b994cd7aec29ee3a8412d564ce4b2 (patch)
tree65cf187060ca99d6c06f02f8c4d97cc2cec2c712 /src/Main/Forms
parent1b59879411700450c5d14225ba9c6a509cfe0f8f (diff)
downloadVeraCrypt-c84bcd4b474b994cd7aec29ee3a8412d564ce4b2.tar.gz
VeraCrypt-c84bcd4b474b994cd7aec29ee3a8412d564ce4b2.zip
Linux/MacOSX/FreeBSD: Implement benchmarking for Hash and PKCS-5 PRF algorithms.
Diffstat (limited to 'src/Main/Forms')
-rw-r--r--src/Main/Forms/BenchmarkDialog.cpp345
-rw-r--r--src/Main/Forms/BenchmarkDialog.h18
-rw-r--r--src/Main/Forms/Forms.cpp104
-rw-r--r--src/Main/Forms/Forms.h14
-rw-r--r--src/Main/Forms/TrueCrypt.fbp366
5 files changed, 725 insertions, 122 deletions
diff --git a/src/Main/Forms/BenchmarkDialog.cpp b/src/Main/Forms/BenchmarkDialog.cpp
index 440bc1d9..18712274 100644
--- a/src/Main/Forms/BenchmarkDialog.cpp
+++ b/src/Main/Forms/BenchmarkDialog.cpp
@@ -38,38 +38,125 @@ namespace VeraCrypt
BufferSizeChoice->Append (Gui->SizeToString (size), (void *) size);
}
+ BenchmarkChoice->Select (0);
BufferSizeChoice->Select (1);
-
- list <int> colPermilles;
- BenchmarkListCtrl->InsertColumn (ColumnAlgorithm, LangString["ALGORITHM"], wxLIST_FORMAT_LEFT, 1);
- colPermilles.push_back (322);
-
- BenchmarkListCtrl->InsertColumn (ColumnEncryption, LangString["ENCRYPTION"], wxLIST_FORMAT_RIGHT, 1);
- colPermilles.push_back (226);
-
- BenchmarkListCtrl->InsertColumn (ColumnDecryption, LangString["DECRYPTION"], wxLIST_FORMAT_RIGHT, 1);
- colPermilles.push_back (226);
-
- BenchmarkListCtrl->InsertColumn (ColumnMean, LangString["MEAN"], wxLIST_FORMAT_RIGHT, 1);
- colPermilles.push_back (226);
-
- Gui->SetListCtrlWidth (BenchmarkListCtrl, 62, false);
- Gui->SetListCtrlHeight (BenchmarkListCtrl, 14);
- Gui->SetListCtrlColumnWidths (BenchmarkListCtrl, colPermilles);
+
+ 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->SetValidator (validator);
Layout();
Fit();
Center();
}
+
+ void BenchmarkDialog::UpdateBenchmarkList ()
+ {
+ int index = BenchmarkChoice->GetSelection ();
+ if (index == 1)
+ {
+ // PRF case
+ m_volumePimLabel->Show ();
+ VolumePimText->Show ();
+
+ BufferSizeChoice->Hide ();
+ m_bufferSizeLabel->Hide ();
+ }
+ else
+ {
+ m_volumePimLabel->Hide ();
+ VolumePimText->Hide ();
+
+ BufferSizeChoice->Show ();
+ m_bufferSizeLabel->Show ();
+ }
+
+ BenchmarkListCtrl->DeleteAllItems();
+ BenchmarkListCtrl->DeleteAllColumns();
+
+ if (index == 0)
+ {
+ // encryption case
+ list <int> colPermilles;
+ BenchmarkListCtrl->InsertColumn (ColumnAlgorithm, LangString["ALGORITHM"], wxLIST_FORMAT_LEFT, 1);
+ colPermilles.push_back (322);
+
+ BenchmarkListCtrl->InsertColumn (ColumnEncryption, LangString["ENCRYPTION"], wxLIST_FORMAT_RIGHT, 1);
+ colPermilles.push_back (226);
+
+ BenchmarkListCtrl->InsertColumn (ColumnDecryption, LangString["DECRYPTION"], wxLIST_FORMAT_RIGHT, 1);
+ colPermilles.push_back (226);
+
+ BenchmarkListCtrl->InsertColumn (ColumnMean, LangString["MEAN"], wxLIST_FORMAT_RIGHT, 1);
+ colPermilles.push_back (226);
+
+ Gui->SetListCtrlWidth (BenchmarkListCtrl, 62, false);
+ Gui->SetListCtrlHeight (BenchmarkListCtrl, 14);
+ Gui->SetListCtrlColumnWidths (BenchmarkListCtrl, colPermilles);
+ }
+ else if (index == 1)
+ {
+ // PRF case
+ list <int> colPermilles;
+ BenchmarkListCtrl->InsertColumn (ColumnAlgorithm, LangString["ALGORITHM"], wxLIST_FORMAT_LEFT, 1);
+ colPermilles.push_back (322);
+
+ BenchmarkListCtrl->InsertColumn (ColumnTime, LangString["TIME"], wxLIST_FORMAT_RIGHT, 1);
+ colPermilles.push_back (226);
+
+ BenchmarkListCtrl->InsertColumn (ColumnIterations, LangString["ITERATIONS"], wxLIST_FORMAT_RIGHT, 1);
+ colPermilles.push_back (226);
+
+ Gui->SetListCtrlWidth (BenchmarkListCtrl, 62, false);
+ Gui->SetListCtrlHeight (BenchmarkListCtrl, 14);
+ Gui->SetListCtrlColumnWidths (BenchmarkListCtrl, colPermilles);
+ }
+ else
+ {
+ // Hash case
+ list <int> colPermilles;
+ BenchmarkListCtrl->InsertColumn (ColumnAlgorithm, LangString["ALGORITHM"], wxLIST_FORMAT_LEFT, 1);
+ colPermilles.push_back (322);
+
+ BenchmarkListCtrl->InsertColumn (ColumnEncryption, LangString["MEAN"], wxLIST_FORMAT_RIGHT, 1);
+ colPermilles.push_back (226);
+
+ Gui->SetListCtrlWidth (BenchmarkListCtrl, 62, false);
+ Gui->SetListCtrlHeight (BenchmarkListCtrl, 14);
+ Gui->SetListCtrlColumnWidths (BenchmarkListCtrl, colPermilles);
+ }
+ }
+
+ void BenchmarkDialog::OnBenchmarkChoiceSelected (wxCommandEvent& event)
+ {
+ UpdateBenchmarkList ();
+
+ Layout();
+ Fit();
+ }
void BenchmarkDialog::OnBenchmarkButtonClick (wxCommandEvent& event)
{
list <BenchmarkResult> results;
wxBusyCursor busy;
- Buffer buffer ((size_t) Gui->GetSelectedData <size_t> (BufferSizeChoice));
+ int opIndex = BenchmarkChoice->GetSelection ();
+ Buffer buffer ((opIndex == 1)? sizeof (unsigned long) : (size_t) Gui->GetSelectedData <size_t> (BufferSizeChoice));
+
+ if (opIndex == 1)
+ {
+ unsigned long pim = 0;
+ if (!VolumePimText->GetValue().ToULong (&pim))
+ pim = 0;
+
+ memcpy (buffer.Ptr (), &pim, sizeof (unsigned long));
+ }
+
- BenchmarkThreadRoutine routine(this, results, buffer);
+ BenchmarkThreadRoutine routine(this, results, buffer, opIndex);
Gui->ExecuteWaitThreadRoutine (this, &routine);
BenchmarkListCtrl->DeleteAllItems();
@@ -79,9 +166,21 @@ namespace VeraCrypt
vector <wstring> fields (BenchmarkListCtrl->GetColumnCount());
fields[ColumnAlgorithm] = result.AlgorithmName;
- fields[ColumnEncryption] = Gui->SpeedToString (result.EncryptionSpeed);
- fields[ColumnDecryption] = Gui->SpeedToString (result.DecryptionSpeed);
- fields[ColumnMean] = Gui->SpeedToString (result.MeanSpeed);
+ if (opIndex == 0)
+ {
+ fields[ColumnEncryption] = Gui->SpeedToString (result.EncryptionSpeed);
+ fields[ColumnDecryption] = Gui->SpeedToString (result.DecryptionSpeed);
+ fields[ColumnMean] = Gui->SpeedToString (result.MeanSpeed);
+ }
+ else if (opIndex == 1)
+ {
+ fields[ColumnTime] = wxString::Format (wxT("%llu ms"), (unsigned long long) result.Time);
+ fields[ColumnIterations] = wxString::Format (wxT("%llu"), (unsigned long long) result.Iterations);
+ }
+ else
+ {
+ fields[ColumnHashMean] = Gui->SpeedToString (result.MeanSpeed);
+ }
Gui->AppendToListCtrl (BenchmarkListCtrl, fields);
}
@@ -94,78 +193,184 @@ namespace VeraCrypt
Fit();
}
- void BenchmarkDialog::DoBenchmark (list<BenchmarkResult>& results, Buffer& buffer)
+ void BenchmarkDialog::DoBenchmark (list<BenchmarkResult>& results, Buffer& buffer, int opIndex)
{
try
{
- EncryptionAlgorithmList encryptionAlgorithms = EncryptionAlgorithm::GetAvailableAlgorithms();
- foreach (shared_ptr <EncryptionAlgorithm> ea, encryptionAlgorithms)
+ if (opIndex == 0)
{
- if (!ea->IsDeprecated())
+ EncryptionAlgorithmList encryptionAlgorithms = EncryptionAlgorithm::GetAvailableAlgorithms();
+ foreach (shared_ptr <EncryptionAlgorithm> ea, encryptionAlgorithms)
{
- BenchmarkResult result;
- result.AlgorithmName = ea->GetName(true);
+ if (!ea->IsDeprecated())
+ {
+ BenchmarkResult result;
+ result.AlgorithmName = ea->GetName(true);
- Buffer key (ea->GetKeySize());
- ea->SetKey (key);
+ Buffer key (ea->GetKeySize());
+ ea->SetKey (key);
- shared_ptr <EncryptionMode> xts (new EncryptionModeXTS);
- xts->SetKey (key);
- ea->SetMode (xts);
+ shared_ptr <EncryptionMode> xts (new EncryptionModeXTS);
+ xts->SetKey (key);
+ ea->SetMode (xts);
- wxLongLong startTime = wxGetLocalTimeMillis();
+ wxLongLong startTime = wxGetLocalTimeMillis();
- // CPU "warm up" (an attempt to prevent skewed results on systems where CPU frequency gradually changes depending on CPU load).
- do
- {
- ea->EncryptSectors (buffer, 0, buffer.Size() / ENCRYPTION_DATA_UNIT_SIZE, ENCRYPTION_DATA_UNIT_SIZE);
- }
- while (wxGetLocalTimeMillis().GetValue() - startTime.GetValue() < 20);
+ // CPU "warm up" (an attempt to prevent skewed results on systems where CPU frequency gradually changes depending on CPU load).
+ do
+ {
+ ea->EncryptSectors (buffer, 0, buffer.Size() / ENCRYPTION_DATA_UNIT_SIZE, ENCRYPTION_DATA_UNIT_SIZE);
+ }
+ while (wxGetLocalTimeMillis().GetValue() - startTime.GetValue() < 20);
- uint64 size = 0;
- uint64 time;
- startTime = wxGetLocalTimeMillis();
+ uint64 size = 0;
+ uint64 time;
+ startTime = wxGetLocalTimeMillis();
- do
- {
- ea->EncryptSectors (buffer, 0, buffer.Size() / ENCRYPTION_DATA_UNIT_SIZE, ENCRYPTION_DATA_UNIT_SIZE);
- size += buffer.Size();
- time = (uint64) (wxGetLocalTimeMillis().GetValue() - startTime.GetValue());
- }
- while (time < 100);
+ do
+ {
+ ea->EncryptSectors (buffer, 0, buffer.Size() / ENCRYPTION_DATA_UNIT_SIZE, ENCRYPTION_DATA_UNIT_SIZE);
+ size += buffer.Size();
+ time = (uint64) (wxGetLocalTimeMillis().GetValue() - startTime.GetValue());
+ }
+ while (time < 100);
- result.EncryptionSpeed = size * 1000 / time;
+ result.EncryptionSpeed = size * 1000 / time;
- startTime = wxGetLocalTimeMillis();
- size = 0;
+ startTime = wxGetLocalTimeMillis();
+ size = 0;
+
+ do
+ {
+ ea->DecryptSectors (buffer, 0, buffer.Size() / ENCRYPTION_DATA_UNIT_SIZE, ENCRYPTION_DATA_UNIT_SIZE);
+ size += buffer.Size();
+ time = (uint64) (wxGetLocalTimeMillis().GetValue() - startTime.GetValue());
+ }
+ while (time < 100);
+
+ result.DecryptionSpeed = size * 1000 / time;
+ result.MeanSpeed = (result.EncryptionSpeed + result.DecryptionSpeed) / 2;
+
+ bool inserted = false;
+ for (list <BenchmarkResult>::iterator i = results.begin(); i != results.end(); ++i)
+ {
+ if (i->MeanSpeed < result.MeanSpeed)
+ {
+ results.insert (i, result);
+ inserted = true;
+ break;
+ }
+ }
- do
+ if (!inserted)
+ results.push_back (result);
+ }
+ }
+ }
+ else if (opIndex == 1)
+ {
+ 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 (false);
+ VolumePassword password ((const byte*) "passphrase-1234567890", 21);
+
+ memcpy (&pim, buffer.Ptr (), sizeof (unsigned long));
+ memcpy (salt.Ptr(), tmp_salt, 64);
+
+ foreach (shared_ptr <Pkcs5Kdf> prf, prfList)
+ {
+ if (!prf->IsDeprecated())
{
- ea->DecryptSectors (buffer, 0, buffer.Size() / ENCRYPTION_DATA_UNIT_SIZE, ENCRYPTION_DATA_UNIT_SIZE);
- size += buffer.Size();
+ BenchmarkResult result;
+ result.AlgorithmName = prf->GetName ();
+ result.Iterations = (uint64) prf->GetIterationCount (pim);
+
+ uint64 time;
+ wxLongLong startTime = wxGetLocalTimeMillis();
+
+ for (int i = 1; i <= 2; i++)
+ {
+ prf->DeriveKey (dk, password, pim, salt);
+ }
+
time = (uint64) (wxGetLocalTimeMillis().GetValue() - startTime.GetValue());
- }
- while (time < 100);
- result.DecryptionSpeed = size * 1000 / time;
- result.MeanSpeed = (result.EncryptionSpeed + result.DecryptionSpeed) / 2;
+ result.Time = time / 2;
+
+ bool inserted = false;
+ for (list <BenchmarkResult>::iterator i = results.begin(); i != results.end(); ++i)
+ {
+ if (i->Time > result.Time)
+ {
+ results.insert (i, result);
+ inserted = true;
+ break;
+ }
+ }
- bool inserted = false;
- for (list <BenchmarkResult>::iterator i = results.begin(); i != results.end(); ++i)
+ if (!inserted)
+ results.push_back (result);
+ }
+ }
+
+ }
+ else
+ {
+ Buffer digest (1024);
+ HashList hashAlgorithms = Hash::GetAvailableAlgorithms ();
+ foreach (shared_ptr <Hash> hash, hashAlgorithms)
+ {
+ if (!hash->IsDeprecated())
{
- if (i->MeanSpeed < result.MeanSpeed)
+ BenchmarkResult result;
+ result.AlgorithmName = hash->GetName ();
+
+ uint64 size = 0;
+ uint64 time;
+ wxLongLong startTime = wxGetLocalTimeMillis();
+
+ // CPU "warm up" (an attempt to prevent skewed results on systems where CPU frequency gradually changes depending on CPU load).
+ do
{
- results.insert (i, result);
- inserted = true;
- break;
+ hash->Init ();
+ hash->ProcessData (digest);
+ hash->GetDigest (digest);
}
- }
+ while (wxGetLocalTimeMillis().GetValue() - startTime.GetValue() < 100);
+
- if (!inserted)
- results.push_back (result);
+ startTime = wxGetLocalTimeMillis();
+ do
+ {
+ hash->Init ();
+ hash->ProcessData (buffer);
+ hash->GetDigest (digest);
+ time = (uint64) (wxGetLocalTimeMillis().GetValue() - startTime.GetValue());
+ size += buffer.Size ();
+ }
+ while (time < 2000);
+
+ result.MeanSpeed = size * 1000 / time;
+
+ bool inserted = false;
+ for (list <BenchmarkResult>::iterator i = results.begin(); i != results.end(); ++i)
+ {
+ if (i->MeanSpeed < result.MeanSpeed)
+ {
+ results.insert (i, result);
+ inserted = true;
+ break;
+ }
+ }
+
+ if (!inserted)
+ results.push_back (result);
+
+ }
}
}
-
}
catch (exception &e)
{
diff --git a/src/Main/Forms/BenchmarkDialog.h b/src/Main/Forms/BenchmarkDialog.h
index 7fd3d011..16a5446b 100644
--- a/src/Main/Forms/BenchmarkDialog.h
+++ b/src/Main/Forms/BenchmarkDialog.h
@@ -29,7 +29,10 @@ namespace VeraCrypt
ColumnAlgorithm = 0,
ColumnEncryption,
ColumnDecryption,
- ColumnMean
+ ColumnMean,
+ ColumnTime = 1,
+ ColumnIterations = 2,
+ ColumnHashMean = 1
};
struct BenchmarkResult
@@ -38,9 +41,13 @@ namespace VeraCrypt
uint64 EncryptionSpeed;
uint64 DecryptionSpeed;
uint64 MeanSpeed;
+ uint64 Time;
+ uint64 Iterations;
};
- void DoBenchmark (list<BenchmarkResult>& results, Buffer& buffer);
+ void UpdateBenchmarkList ();
+ void DoBenchmark (list<BenchmarkResult>& results, Buffer& buffer, int opIndex);
+ void OnBenchmarkChoiceSelected (wxCommandEvent& event);
void OnBenchmarkButtonClick (wxCommandEvent& event);
class BenchmarkThreadRoutine : public WaitThreadRoutine
@@ -49,10 +56,11 @@ namespace VeraCrypt
BenchmarkDialog* m_pDlg;
list<BenchmarkResult>& m_results;
Buffer& m_buffer;
- BenchmarkThreadRoutine(BenchmarkDialog* pDlg, list<BenchmarkResult>& results, Buffer& buffer)
- : m_pDlg(pDlg), m_results(results), m_buffer(buffer) { }
+ int m_opIndex;
+ BenchmarkThreadRoutine(BenchmarkDialog* pDlg, list<BenchmarkResult>& results, Buffer& buffer, int opIndex)
+ : m_pDlg(pDlg), m_results(results), m_buffer(buffer), m_opIndex (opIndex) { }
virtual ~BenchmarkThreadRoutine() { }
- virtual void ExecutionCode(void) { m_pDlg->DoBenchmark (m_results, m_buffer); }
+ virtual void ExecutionCode(void) { m_pDlg->DoBenchmark (m_results, m_buffer, m_opIndex); }
};
};
}
diff --git a/src/Main/Forms/Forms.cpp b/src/Main/Forms/Forms.cpp
index 2df4f3ae..ad1a3ee8 100644
--- a/src/Main/Forms/Forms.cpp
+++ b/src/Main/Forms/Forms.cpp
@@ -1,8 +1,8 @@
///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version Jun 5 2014)
+// C++ code generated with wxFormBuilder (version Jun 20 2018)
// http://www.wxformbuilder.org/
//
-// PLEASE DO "NOT" EDIT THIS FILE!
+// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "System.h"
@@ -767,79 +767,111 @@ AboutDialogBase::~AboutDialogBase()
BenchmarkDialogBase::BenchmarkDialogBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
-
+
wxBoxSizer* bSizer153;
bSizer153 = new wxBoxSizer( wxVERTICAL );
-
+
wxBoxSizer* bSizer154;
bSizer154 = new wxBoxSizer( wxVERTICAL );
-
- wxBoxSizer* bSizer155;
- bSizer155 = new wxBoxSizer( wxHORIZONTAL );
-
- wxStaticText* m_staticText54;
- m_staticText54 = new wxStaticText( this, wxID_ANY, _("Buffer Size:"), wxDefaultPosition, wxDefaultSize, 0 );
- m_staticText54->Wrap( -1 );
- bSizer155->Add( m_staticText54, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
-
+
+ wxFlexGridSizer* fgSizer9;
+ fgSizer9 = new wxFlexGridSizer( 3, 2, 0, 0 );
+ fgSizer9->AddGrowableCol( 1 );
+ fgSizer9->SetFlexibleDirection( wxHORIZONTAL );
+ fgSizer9->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
+
+ m_staticText70 = new wxStaticText( this, wxID_ANY, _("Benchmark:"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticText70->Wrap( -1 );
+
+ fgSizer9->Add( m_staticText70, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+
+ wxString BenchmarkChoiceChoices[] = { _("Encryption Algorithm"), _("PKCS-5 PRF"), _("Hash Algorithm") };
+ int BenchmarkChoiceNChoices = sizeof( BenchmarkChoiceChoices ) / sizeof( wxString );
+ BenchmarkChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, BenchmarkChoiceNChoices, BenchmarkChoiceChoices, 0 );
+ BenchmarkChoice->SetSelection( 0 );
+ fgSizer9->Add( BenchmarkChoice, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+
+ m_bufferSizeLabel = new wxStaticText( this, wxID_ANY, _("Buffer Size:"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_bufferSizeLabel->Wrap( -1 );
+
+ fgSizer9->Add( m_bufferSizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
+
wxArrayString BufferSizeChoiceChoices;
BufferSizeChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, BufferSizeChoiceChoices, 0 );
BufferSizeChoice->SetSelection( 0 );
- bSizer155->Add( BufferSizeChoice, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
-
-
- bSizer154->Add( bSizer155, 0, wxEXPAND, 5 );
-
+ fgSizer9->Add( BufferSizeChoice, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_volumePimLabel = new wxStaticText( this, wxID_ANY, _("Volume PIM:"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_volumePimLabel->Wrap( -1 );
+
+ fgSizer9->Add( m_volumePimLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+
+ VolumePimText = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
+ #ifdef __WXGTK__
+ if ( !VolumePimText->HasFlag( wxTE_MULTILINE ) )
+ {
+ VolumePimText->SetMaxLength( 7 );
+ }
+ #else
+ VolumePimText->SetMaxLength( 7 );
+ #endif
+ fgSizer9->Add( VolumePimText, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+
+
+ bSizer154->Add( fgSizer9, 0, wxEXPAND, 5 );
+
wxStaticLine* m_staticline6;
m_staticline6 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bSizer154->Add( m_staticline6, 0, wxEXPAND | wxALL, 5 );
-
+
wxBoxSizer* bSizer156;
bSizer156 = new wxBoxSizer( wxHORIZONTAL );
-
+
BenchmarkListCtrl = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_NO_SORT_HEADER|wxLC_REPORT|wxSUNKEN_BORDER );
bSizer156->Add( BenchmarkListCtrl, 1, wxALL|wxEXPAND, 5 );
-
+
RightSizer = new wxBoxSizer( wxVERTICAL );
-
+
BenchmarkButton = new wxButton( this, wxID_OK, _("Benchmark"), wxDefaultPosition, wxDefaultSize, 0 );
BenchmarkButton->SetDefault();
RightSizer->Add( BenchmarkButton, 0, wxALL|wxEXPAND, 5 );
-
+
wxButton* CancelButton;
CancelButton = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 );
RightSizer->Add( CancelButton, 0, wxALL|wxEXPAND, 5 );
-
-
+
+
RightSizer->Add( 0, 0, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
-
+
BenchmarkNoteStaticText = new wxStaticText( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
BenchmarkNoteStaticText->Wrap( -1 );
RightSizer->Add( BenchmarkNoteStaticText, 1, wxALL|wxEXPAND, 5 );
-
-
+
+
bSizer156->Add( RightSizer, 0, wxEXPAND, 5 );
-
-
+
+
bSizer154->Add( bSizer156, 1, wxEXPAND, 5 );
-
-
+
+
bSizer153->Add( bSizer154, 1, wxEXPAND|wxALL, 5 );
-
-
+
+
this->SetSizer( bSizer153 );
this->Layout();
bSizer153->Fit( this );
-
+
// Connect Events
+ BenchmarkChoice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( BenchmarkDialogBase::OnBenchmarkChoiceSelected ), NULL, this );
BenchmarkButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BenchmarkDialogBase::OnBenchmarkButtonClick ), NULL, this );
}
BenchmarkDialogBase::~BenchmarkDialogBase()
{
// Disconnect Events
+ BenchmarkChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( BenchmarkDialogBase::OnBenchmarkChoiceSelected ), NULL, this );
BenchmarkButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BenchmarkDialogBase::OnBenchmarkButtonClick ), NULL, this );
-
+
}
ChangePasswordDialogBase::ChangePasswordDialogBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
diff --git a/src/Main/Forms/Forms.h b/src/Main/Forms/Forms.h
index bad0be0e..f28f6358 100644
--- a/src/Main/Forms/Forms.h
+++ b/src/Main/Forms/Forms.h
@@ -1,8 +1,8 @@
///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version Jun 5 2014)
+// C++ code generated with wxFormBuilder (version Jun 20 2018)
// http://www.wxformbuilder.org/
//
-// PLEASE DO "NOT" EDIT THIS FILE!
+// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __FORMS_H__
@@ -11,8 +11,6 @@
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
-class WizardPage;
-
#include "WizardPage.h"
#include <wx/string.h>
#include <wx/bitmap.h>
@@ -228,19 +226,25 @@ namespace VeraCrypt
private:
protected:
+ wxStaticText* m_staticText70;
+ wxChoice* BenchmarkChoice;
+ wxStaticText* m_bufferSizeLabel;
wxChoice* BufferSizeChoice;
+ wxStaticText* m_volumePimLabel;
+ wxTextCtrl* VolumePimText;
wxListCtrl* BenchmarkListCtrl;
wxBoxSizer* RightSizer;
wxButton* BenchmarkButton;
wxStaticText* BenchmarkNoteStaticText;
// Virtual event handlers, overide them in your derived class
+ virtual void OnBenchmarkChoiceSelected( wxCommandEvent& event ) { event.Skip(); }
virtual void OnBenchmarkButtonClick( wxCommandEvent& event ) { event.Skip(); }
public:
- BenchmarkDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("VeraCrypt - Encryption Algorithm Benchmark"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE );
+ BenchmarkDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("VeraCrypt - Algorithms Benchmark"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE );
~BenchmarkDialogBase();
};
diff --git a/src/Main/Forms/TrueCrypt.fbp b/src/Main/Forms/TrueCrypt.fbp
index 0b40c527..7509f1ef 100644
--- a/src/Main/Forms/TrueCrypt.fbp
+++ b/src/Main/Forms/TrueCrypt.fbp
@@ -4246,7 +4246,7 @@
<property name="size"></property>
<property name="style">wxDEFAULT_DIALOG_STYLE</property>
<property name="subclass"></property>
- <property name="title">VeraCrypt - Encryption Algorithm Benchmark</property>
+ <property name="title">VeraCrypt - Algorithms Benchmark</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
@@ -4305,11 +4305,190 @@
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
- <object class="wxBoxSizer" expanded="1">
+ <object class="wxFlexGridSizer" expanded="1">
+ <property name="cols">2</property>
+ <property name="flexible_direction">wxHORIZONTAL</property>
+ <property name="growablecols">1</property>
+ <property name="growablerows"></property>
+ <property name="hgap">0</property>
<property name="minimum_size"></property>
- <property name="name">bSizer155</property>
- <property name="orient">wxHORIZONTAL</property>
+ <property name="name">fgSizer9</property>
+ <property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
<property name="permission">none</property>
+ <property name="rows">3</property>
+ <property name="vgap">0</property>
+ <object class="sizeritem" expanded="1">
+ <property name="border">5</property>
+ <property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
+ <property name="proportion">0</property>
+ <object class="wxStaticText" expanded="0">
+ <property name="BottomDockable">1</property>
+ <property name="LeftDockable">1</property>
+ <property name="RightDockable">1</property>
+ <property name="TopDockable">1</property>
+ <property name="aui_layer"></property>
+ <property name="aui_name"></property>
+ <property name="aui_position"></property>
+ <property name="aui_row"></property>
+ <property name="best_size"></property>
+ <property name="bg"></property>
+ <property name="caption"></property>
+ <property name="caption_visible">1</property>
+ <property name="center_pane">0</property>
+ <property name="close_button">1</property>
+ <property name="context_help"></property>
+ <property name="context_menu">1</property>
+ <property name="default_pane">0</property>
+ <property name="dock">Dock</property>
+ <property name="dock_fixed">0</property>
+ <property name="docking">Left</property>
+ <property name="enabled">1</property>
+ <property name="fg"></property>
+ <property name="floatable">1</property>
+ <property name="font"></property>
+ <property name="gripper">0</property>
+ <property name="hidden">0</property>
+ <property name="id">wxID_ANY</property>
+ <property name="label">Benchmark:</property>
+ <property name="markup">0</property>
+ <property name="max_size"></property>
+ <property name="maximize_button">0</property>
+ <property name="maximum_size"></property>
+ <property name="min_size"></property>
+ <property name="minimize_button">0</property>
+ <property name="minimum_size"></property>
+ <property name="moveable">1</property>
+ <property name="name">m_staticText70</property>
+ <property name="pane_border">1</property>
+ <property name="pane_position"></property>
+ <property name="pane_size"></property>
+ <property name="permission">protected</property>
+ <property name="pin_button">1</property>
+ <property name="pos"></property>
+ <property name="resize">Resizable</property>
+ <property name="show">1</property>
+ <property name="size"></property>
+ <property name="style"></property>
+ <property name="subclass">; forward_declare</property>
+ <property name="toolbar_pane">0</property>
+ <property name="tooltip"></property>
+ <property name="window_extra_style"></property>
+ <property name="window_name"></property>
+ <property name="window_style"></property>
+ <property name="wrap">-1</property>
+ <event name="OnChar"></event>
+ <event name="OnEnterWindow"></event>
+ <event name="OnEraseBackground"></event>
+ <event name="OnKeyDown"></event>
+ <event name="OnKeyUp"></event>
+ <event name="OnKillFocus"></event>
+ <event name="OnLeaveWindow"></event>
+ <event name="OnLeftDClick"></event>
+ <event name="OnLeftDown"></event>
+ <event name="OnLeftUp"></event>
+ <event name="OnMiddleDClick"></event>
+ <event name="OnMiddleDown"></event>
+ <event name="OnMiddleUp"></event>
+ <event name="OnMotion"></event>
+ <event name="OnMouseEvents"></event>
+ <event name="OnMouseWheel"></event>
+ <event name="OnPaint"></event>
+ <event name="OnRightDClick"></event>
+ <event name="OnRightDown"></event>
+ <event name="OnRightUp"></event>
+ <event name="OnSetFocus"></event>
+ <event name="OnSize"></event>
+ <event name="OnUpdateUI"></event>
+ </object>
+ </object>
+ <object class="sizeritem" expanded="1">
+ <property name="border">5</property>
+ <property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
+ <property name="proportion">0</property>
+ <object class="wxChoice" expanded="1">
+ <property name="BottomDockable">1</property>
+ <property name="LeftDockable">1</property>
+ <property name="RightDockable">1</property>
+ <property name="TopDockable">1</property>
+ <property name="aui_layer"></property>
+ <property name="aui_name"></property>
+ <property name="aui_position"></property>
+ <property name="aui_row"></property>
+ <property name="best_size"></property>
+ <property name="bg"></property>
+ <property name="caption"></property>
+ <property name="caption_visible">1</property>
+ <property name="center_pane">0</property>
+ <property name="choices">&quot;Encryption Algorithm&quot; &quot;PKCS-5 PRF&quot; &quot;Hash Algorithm&quot;</property>
+ <property name="close_button">1</property>
+ <property name="context_help"></property>
+ <property name="context_menu">1</property>
+ <property name="default_pane">0</property>
+ <property name="dock">Dock</property>
+ <property name="dock_fixed">0</property>
+ <property name="docking">Left</property>
+ <property name="enabled">1</property>
+ <property name="fg"></property>
+ <property name="floatable">1</property>
+ <property name="font"></property>
+ <property name="gripper">0</property>
+ <property name="hidden">0</property>
+ <property name="id">wxID_ANY</property>
+ <property name="max_size"></property>
+ <property name="maximize_button">0</property>
+ <property name="maximum_size"></property>
+ <property name="min_size"></property>
+ <property name="minimize_button">0</property>
+ <property name="minimum_size"></property>
+ <property name="moveable">1</property>
+ <property name="name">BenchmarkChoice</property>
+ <property name="pane_border">1</property>
+ <property name="pane_position"></property>
+ <property name="pane_size"></property>
+ <property name="permission">protected</property>
+ <property name="pin_button">1</property>
+ <property name="pos"></property>
+ <property name="resize">Resizable</property>
+ <property name="selection">0</property>
+ <property name="show">1</property>
+ <property name="size"></property>
+ <property name="style"></property>
+ <property name="subclass">; forward_declare</property>
+ <property name="toolbar_pane">0</property>
+ <property name="tooltip"></property>
+ <property name="validator_data_type"></property>
+ <property name="validator_style">wxFILTER_NONE</property>
+ <property name="validator_type">wxDefaultValidator</property>
+ <property name="validator_variable"></property>
+ <property name="window_extra_style"></property>
+ <property name="window_name"></property>
+ <property name="window_style"></property>
+ <event name="OnChar"></event>
+ <event name="OnChoice">OnBenchmarkChoiceSelected</event>
+ <event name="OnEnterWindow"></event>
+ <event name="OnEraseBackground"></event>
+ <event name="OnKeyDown"></event>
+ <event name="OnKeyUp"></event>
+ <event name="OnKillFocus"></event>
+ <event name="OnLeaveWindow"></event>
+ <event name="OnLeftDClick"></event>
+ <event name="OnLeftDown"></event>
+ <event name="OnLeftUp"></event>
+ <event name="OnMiddleDClick"></event>
+ <event name="OnMiddleDown"></event>
+ <event name="OnMiddleUp"></event>
+ <event name="OnMotion"></event>
+ <event name="OnMouseEvents"></event>
+ <event name="OnMouseWheel"></event>
+ <event name="OnPaint"></event>
+ <event name="OnRightDClick"></event>
+ <event name="OnRightDown"></event>
+ <event name="OnRightUp"></event>
+ <event name="OnSetFocus"></event>
+ <event name="OnSize"></event>
+ <event name="OnUpdateUI"></event>
+ </object>
+ </object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT</property>
@@ -4350,11 +4529,11 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
- <property name="name">m_staticText54</property>
+ <property name="name">m_bufferSizeLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
- <property name="permission">none</property>
+ <property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
@@ -4481,6 +4660,181 @@
<event name="OnUpdateUI"></event>
</object>
</object>
+ <object class="sizeritem" expanded="1">
+ <property name="border">5</property>
+ <property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
+ <property name="proportion">0</property>
+ <object class="wxStaticText" expanded="1">
+ <property name="BottomDockable">1</property>
+ <property name="LeftDockable">1</property>
+ <property name="RightDockable">1</property>
+ <property name="TopDockable">1</property>
+ <property name="aui_layer"></property>
+ <property name="aui_name"></property>
+ <property name="aui_position"></property>
+ <property name="aui_row"></property>
+ <property name="best_size"></property>
+ <property name="bg"></property>
+ <property name="caption"></property>
+ <property name="caption_visible">1</property>
+ <property name="center_pane">0</property>
+ <property name="close_button">1</property>
+ <property name="context_help"></property>
+ <property name="context_menu">1</property>
+ <property name="default_pane">0</property>
+ <property name="dock">Dock</property>
+ <property name="dock_fixed">0</property>
+ <property name="docking">Left</property>
+ <property name="enabled">1</property>
+ <property name="fg"></property>
+ <property name="floatable">1</property>
+ <property name="font"></property>
+ <property name="gripper">0</property>
+ <property name="hidden">0</property>
+ <property name="id">wxID_ANY</property>
+ <property name="label">Volume PIM:</property>
+ <property name="markup">0</property>
+ <property name="max_size"></property>
+ <property name="maximize_button">0</property>
+ <property name="maximum_size"></property>
+ <property name="min_size"></property>
+ <property name="minimize_button">0</property>
+ <property name="minimum_size"></property>
+ <property name="moveable">1</property>
+ <property name="name">m_volumePimLabel</property>
+ <property name="pane_border">1</property>
+ <property name="pane_position"></property>
+ <property name="pane_size"></property>
+ <property name="permission">protected</property>
+ <property name="pin_button">1</property>
+ <property name="pos"></property>
+ <property name="resize">Resizable</property>
+ <property name="show">1</property>
+ <property name="size"></property>
+ <property name="style"></property>
+ <property name="subclass">; forward_declare</property>
+ <property name="toolbar_pane">0</property>
+ <property name="tooltip"></property>
+ <property name="window_extra_style"></property>
+ <property name="window_name"></property>
+ <property name="window_style"></property>
+ <property name="wrap">-1</property>
+ <event name="OnChar"></event>
+ <event name="OnEnterWindow"></event>
+ <event name="OnEraseBackground"></event>
+ <event name="OnKeyDown"></event>
+ <event name="OnKeyUp"></event>
+ <event name="OnKillFocus"></event>
+ <event name="OnLeaveWindow"></event>
+ <event name="OnLeftDClick"></event>
+ <event name="OnLeftDown"></event>
+ <event name="OnLeftUp"></event>
+ <event name="OnMiddleDClick"></event>
+ <event name="OnMiddleDown"></event>
+ <event name="OnMiddleUp"></event>
+ <event name="OnMotion"></event>
+ <event name="OnMouseEvents"></event>
+ <event name="OnMouseWheel"></event>
+ <event name="OnPaint"></event>
+ <event name="OnRightDClick"></event>
+ <event name="OnRightDown"></event>
+ <event name="OnRightUp"></event>
+ <event name="OnSetFocus"></event>
+ <event name="OnSize"></event>
+ <event name="OnUpdateUI"></event>
+ </object>
+ </object>
+ <object class="sizeritem" expanded="1">
+ <property name="border">5</property>
+ <property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
+ <property name="proportion">0</property>
+ <object class="wxTextCtrl" expanded="1">
+ <property name="BottomDockable">1</property>
+ <property name="LeftDockable">1</property>
+ <property name="RightDockable">1</property>
+ <property name="TopDockable">1</property>
+ <property name="aui_layer"></property>
+ <property name="aui_name"></property>
+ <property name="aui_position"></property>
+ <property name="aui_row"></property>
+ <property name="best_size"></property>
+ <property name="bg"></property>
+ <property name="caption"></property>
+ <property name="caption_visible">1</property>
+ <property name="center_pane">0</property>
+ <property name="close_button">1</property>
+ <property name="context_help"></property>
+ <property name="context_menu">1</property>
+ <property name="default_pane">0</property>
+ <property name="dock">Dock</property>
+ <property name="dock_fixed">0</property>
+ <property name="docking">Left</property>
+ <property name="enabled">1</property>
+ <property name="fg"></property>
+ <property name="floatable">1</property>
+ <property name="font"></property>
+ <property name="gripper">0</property>
+ <property name="hidden">0</property>
+ <property name="id">wxID_ANY</property>
+ <property name="max_size"></property>
+ <property name="maximize_button">0</property>
+ <property name="maximum_size"></property>
+ <property name="maxlength">7</property>
+ <property name="min_size"></property>
+ <property name="minimize_button">0</property>
+ <property name="minimum_size"></property>
+ <property name="moveable">1</property>
+ <property name="name">VolumePimText</property>
+ <property name="pane_border">1</property>
+ <property name="pane_position"></property>
+ <property name="pane_size"></property>
+ <property name="permission">protected</property>
+ <property name="pin_button">1</property>
+ <property name="pos"></property>
+ <property name="resize">Resizable</property>
+ <property name="show">1</property>
+ <property name="size"></property>
+ <property name="style"></property>
+ <property name="subclass">; forward_declare</property>
+ <property name="toolbar_pane">0</property>
+ <property name="tooltip"></property>
+ <property name="validator_data_type"></property>
+ <property name="validator_style"></property>
+ <property name="validator_type">wxDefaultValidator</property>
+ <property name="validator_variable"></property>
+ <property name="value"></property>
+ <property name="window_extra_style"></property>
+ <property name="window_name"></property>
+ <property name="window_style"></property>
+ <event name="OnChar"></event>
+ <event name="OnEnterWindow"></event>
+ <event name="OnEraseBackground"></event>
+ <event name="OnKeyDown"></event>
+ <event name="OnKeyUp"></event>
+ <event name="OnKillFocus"></event>
+ <event name="OnLeaveWindow"></event>
+ <event name="OnLeftDClick"></event>
+ <event name="OnLeftDown"></event>
+ <event name="OnLeftUp"></event>
+ <event name="OnMiddleDClick"></event>
+ <event name="OnMiddleDown"></event>
+ <event name="OnMiddleUp"></event>
+ <event name="OnMotion"></event>
+ <event name="OnMouseEvents"></event>
+ <event name="OnMouseWheel"></event>
+ <event name="OnPaint"></event>
+ <event name="OnRightDClick"></event>
+ <event name="OnRightDown"></event>
+ <event name="OnRightUp"></event>
+ <event name="OnSetFocus"></event>
+ <event name="OnSize"></event>
+ <event name="OnText"></event>
+ <event name="OnTextEnter"></event>
+ <event name="OnTextMaxLen"></event>
+ <event name="OnTextURL"></event>
+ <event name="OnUpdateUI"></event>
+ </object>
+ </object>
</object>
</object>
<object class="sizeritem" expanded="1">