From c84bcd4b474b994cd7aec29ee3a8412d564ce4b2 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Thu, 9 Aug 2018 19:18:18 +0200 Subject: Linux/MacOSX/FreeBSD: Implement benchmarking for Hash and PKCS-5 PRF algorithms. --- src/Main/Forms/BenchmarkDialog.cpp | 345 +++++++++++++++++++++++++++------- src/Main/Forms/BenchmarkDialog.h | 18 +- src/Main/Forms/Forms.cpp | 104 +++++++---- src/Main/Forms/Forms.h | 14 +- src/Main/Forms/TrueCrypt.fbp | 366 ++++++++++++++++++++++++++++++++++++- 5 files changed, 725 insertions(+), 122 deletions(-) (limited to 'src/Main/Forms') 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 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 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 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 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 results; wxBusyCursor busy; - Buffer buffer ((size_t) Gui->GetSelectedData (BufferSizeChoice)); + int opIndex = BenchmarkChoice->GetSelection (); + Buffer buffer ((opIndex == 1)? sizeof (unsigned long) : (size_t) Gui->GetSelectedData (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 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& results, Buffer& buffer) + void BenchmarkDialog::DoBenchmark (list& results, Buffer& buffer, int opIndex) { try { - EncryptionAlgorithmList encryptionAlgorithms = EncryptionAlgorithm::GetAvailableAlgorithms(); - foreach (shared_ptr ea, encryptionAlgorithms) + if (opIndex == 0) { - if (!ea->IsDeprecated()) + EncryptionAlgorithmList encryptionAlgorithms = EncryptionAlgorithm::GetAvailableAlgorithms(); + foreach (shared_ptr 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 xts (new EncryptionModeXTS); - xts->SetKey (key); - ea->SetMode (xts); + shared_ptr 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 ::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 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 ::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 ::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, 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 ::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& results, Buffer& buffer); + void UpdateBenchmarkList (); + void DoBenchmark (list& 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& m_results; Buffer& m_buffer; - BenchmarkThreadRoutine(BenchmarkDialog* pDlg, list& results, Buffer& buffer) - : m_pDlg(pDlg), m_results(results), m_buffer(buffer) { } + int m_opIndex; + BenchmarkThreadRoutine(BenchmarkDialog* pDlg, list& 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 #include #include -class WizardPage; - #include "WizardPage.h" #include #include @@ -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 @@ wxDEFAULT_DIALOG_STYLE - VeraCrypt - Encryption Algorithm Benchmark + VeraCrypt - Algorithms Benchmark @@ -4305,11 +4305,190 @@ 5 wxEXPAND 0 - + + 2 + wxHORIZONTAL + 1 + + 0 - bSizer155 - wxHORIZONTAL + fgSizer9 + wxFLEX_GROWMODE_SPECIFIED none + 3 + 0 + + 5 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Benchmark: + 0 + + 0 + + + 0 + + 1 + m_staticText70 + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Encryption Algorithm" "PKCS-5 PRF" "Hash Algorithm" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + BenchmarkChoice + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + OnBenchmarkChoiceSelected + + + + + + + + + + + + + + + + + + + + + + + + 5 wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT @@ -4350,11 +4529,11 @@ 0 1 - m_staticText54 + m_bufferSizeLabel 1 - none + protected 1 Resizable @@ -4481,6 +4660,181 @@ + + 5 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Volume PIM: + 0 + + 0 + + + 0 + + 1 + m_volumePimLabel + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 7 + + 0 + + 1 + VolumePimText + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3