Linux/MacOSX/FreeBSD: Implement benchmarking for Hash and PKCS-5 PRF algorithms.

This commit is contained in:
Mounir IDRASSI 2018-08-09 19:18:18 +02:00
parent 1b59879411
commit c84bcd4b47
No known key found for this signature in database
GPG Key ID: DD0C382D5FCFB8FC
5 changed files with 733 additions and 130 deletions

View File

@ -38,38 +38,125 @@ namespace VeraCrypt
BufferSizeChoice->Append (Gui->SizeToString (size), (void *) size); BufferSizeChoice->Append (Gui->SizeToString (size), (void *) size);
} }
BenchmarkChoice->Select (0);
BufferSizeChoice->Select (1); BufferSizeChoice->Select (1);
list <int> colPermilles; UpdateBenchmarkList ();
BenchmarkListCtrl->InsertColumn (ColumnAlgorithm, LangString["ALGORITHM"], wxLIST_FORMAT_LEFT, 1);
colPermilles.push_back (322);
BenchmarkListCtrl->InsertColumn (ColumnEncryption, LangString["ENCRYPTION"], wxLIST_FORMAT_RIGHT, 1); wxTextValidator validator (wxFILTER_INCLUDE_CHAR_LIST); // wxFILTER_NUMERIC does not exclude - . , etc.
colPermilles.push_back (226); 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));
BenchmarkListCtrl->InsertColumn (ColumnDecryption, LangString["DECRYPTION"], wxLIST_FORMAT_RIGHT, 1); VolumePimText->SetValidator (validator);
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);
Layout(); Layout();
Fit(); Fit();
Center(); 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) void BenchmarkDialog::OnBenchmarkButtonClick (wxCommandEvent& event)
{ {
list <BenchmarkResult> results; list <BenchmarkResult> results;
wxBusyCursor busy; 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));
BenchmarkThreadRoutine routine(this, results, buffer); 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, opIndex);
Gui->ExecuteWaitThreadRoutine (this, &routine); Gui->ExecuteWaitThreadRoutine (this, &routine);
BenchmarkListCtrl->DeleteAllItems(); BenchmarkListCtrl->DeleteAllItems();
@ -79,9 +166,21 @@ namespace VeraCrypt
vector <wstring> fields (BenchmarkListCtrl->GetColumnCount()); vector <wstring> fields (BenchmarkListCtrl->GetColumnCount());
fields[ColumnAlgorithm] = result.AlgorithmName; fields[ColumnAlgorithm] = result.AlgorithmName;
fields[ColumnEncryption] = Gui->SpeedToString (result.EncryptionSpeed); if (opIndex == 0)
fields[ColumnDecryption] = Gui->SpeedToString (result.DecryptionSpeed); {
fields[ColumnMean] = Gui->SpeedToString (result.MeanSpeed); 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); Gui->AppendToListCtrl (BenchmarkListCtrl, fields);
} }
@ -94,78 +193,184 @@ namespace VeraCrypt
Fit(); Fit();
} }
void BenchmarkDialog::DoBenchmark (list<BenchmarkResult>& results, Buffer& buffer) void BenchmarkDialog::DoBenchmark (list<BenchmarkResult>& results, Buffer& buffer, int opIndex)
{ {
try try
{ {
EncryptionAlgorithmList encryptionAlgorithms = EncryptionAlgorithm::GetAvailableAlgorithms(); if (opIndex == 0)
foreach (shared_ptr <EncryptionAlgorithm> ea, encryptionAlgorithms)
{ {
if (!ea->IsDeprecated()) EncryptionAlgorithmList encryptionAlgorithms = EncryptionAlgorithm::GetAvailableAlgorithms();
foreach (shared_ptr <EncryptionAlgorithm> ea, encryptionAlgorithms)
{ {
BenchmarkResult result; if (!ea->IsDeprecated())
result.AlgorithmName = ea->GetName(true);
Buffer key (ea->GetKeySize());
ea->SetKey (key);
shared_ptr <EncryptionMode> xts (new EncryptionModeXTS);
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).
do
{ {
ea->EncryptSectors (buffer, 0, buffer.Size() / ENCRYPTION_DATA_UNIT_SIZE, ENCRYPTION_DATA_UNIT_SIZE); BenchmarkResult result;
} result.AlgorithmName = ea->GetName(true);
while (wxGetLocalTimeMillis().GetValue() - startTime.GetValue() < 20);
uint64 size = 0; Buffer key (ea->GetKeySize());
uint64 time; ea->SetKey (key);
startTime = wxGetLocalTimeMillis();
do shared_ptr <EncryptionMode> xts (new EncryptionModeXTS);
{ xts->SetKey (key);
ea->EncryptSectors (buffer, 0, buffer.Size() / ENCRYPTION_DATA_UNIT_SIZE, ENCRYPTION_DATA_UNIT_SIZE); ea->SetMode (xts);
size += buffer.Size();
time = (uint64) (wxGetLocalTimeMillis().GetValue() - startTime.GetValue());
}
while (time < 100);
result.EncryptionSpeed = size * 1000 / time; wxLongLong startTime = wxGetLocalTimeMillis();
startTime = wxGetLocalTimeMillis(); // CPU "warm up" (an attempt to prevent skewed results on systems where CPU frequency gradually changes depending on CPU load).
size = 0; do
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); ea->EncryptSectors (buffer, 0, buffer.Size() / ENCRYPTION_DATA_UNIT_SIZE, ENCRYPTION_DATA_UNIT_SIZE);
inserted = true;
break;
} }
} while (wxGetLocalTimeMillis().GetValue() - startTime.GetValue() < 20);
if (!inserted) uint64 size = 0;
results.push_back (result); 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);
result.EncryptionSpeed = size * 1000 / time;
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;
}
}
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())
{
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());
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;
}
}
if (!inserted)
results.push_back (result);
}
}
}
else
{
Buffer digest (1024);
HashList hashAlgorithms = Hash::GetAvailableAlgorithms ();
foreach (shared_ptr <Hash> hash, hashAlgorithms)
{
if (!hash->IsDeprecated())
{
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
{
hash->Init ();
hash->ProcessData (digest);
hash->GetDigest (digest);
}
while (wxGetLocalTimeMillis().GetValue() - startTime.GetValue() < 100);
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) catch (exception &e)
{ {

View File

@ -29,7 +29,10 @@ namespace VeraCrypt
ColumnAlgorithm = 0, ColumnAlgorithm = 0,
ColumnEncryption, ColumnEncryption,
ColumnDecryption, ColumnDecryption,
ColumnMean ColumnMean,
ColumnTime = 1,
ColumnIterations = 2,
ColumnHashMean = 1
}; };
struct BenchmarkResult struct BenchmarkResult
@ -38,9 +41,13 @@ namespace VeraCrypt
uint64 EncryptionSpeed; uint64 EncryptionSpeed;
uint64 DecryptionSpeed; uint64 DecryptionSpeed;
uint64 MeanSpeed; 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); void OnBenchmarkButtonClick (wxCommandEvent& event);
class BenchmarkThreadRoutine : public WaitThreadRoutine class BenchmarkThreadRoutine : public WaitThreadRoutine
@ -49,10 +56,11 @@ namespace VeraCrypt
BenchmarkDialog* m_pDlg; BenchmarkDialog* m_pDlg;
list<BenchmarkResult>& m_results; list<BenchmarkResult>& m_results;
Buffer& m_buffer; Buffer& m_buffer;
BenchmarkThreadRoutine(BenchmarkDialog* pDlg, list<BenchmarkResult>& results, Buffer& buffer) int m_opIndex;
: m_pDlg(pDlg), m_results(results), m_buffer(buffer) { } 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 ~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); }
}; };
}; };
} }

View File

@ -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/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO *NOT* EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#include "System.h" #include "System.h"
@ -774,21 +774,51 @@ BenchmarkDialogBase::BenchmarkDialogBase( wxWindow* parent, wxWindowID id, const
wxBoxSizer* bSizer154; wxBoxSizer* bSizer154;
bSizer154 = new wxBoxSizer( wxVERTICAL ); bSizer154 = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizer155; wxFlexGridSizer* fgSizer9;
bSizer155 = new wxBoxSizer( wxHORIZONTAL ); fgSizer9 = new wxFlexGridSizer( 3, 2, 0, 0 );
fgSizer9->AddGrowableCol( 1 );
fgSizer9->SetFlexibleDirection( wxHORIZONTAL );
fgSizer9->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
wxStaticText* m_staticText54; m_staticText70 = new wxStaticText( this, wxID_ANY, _("Benchmark:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText54 = new wxStaticText( this, wxID_ANY, _("Buffer Size:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText70->Wrap( -1 );
m_staticText54->Wrap( -1 );
bSizer155->Add( m_staticText54, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); 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; wxArrayString BufferSizeChoiceChoices;
BufferSizeChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, BufferSizeChoiceChoices, 0 ); BufferSizeChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, BufferSizeChoiceChoices, 0 );
BufferSizeChoice->SetSelection( 0 ); BufferSizeChoice->SetSelection( 0 );
bSizer155->Add( BufferSizeChoice, 0, wxALL|wxALIGN_CENTER_VERTICAL, 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( bSizer155, 0, wxEXPAND, 5 ); bSizer154->Add( fgSizer9, 0, wxEXPAND, 5 );
wxStaticLine* m_staticline6; wxStaticLine* m_staticline6;
m_staticline6 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); m_staticline6 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
@ -832,12 +862,14 @@ BenchmarkDialogBase::BenchmarkDialogBase( wxWindow* parent, wxWindowID id, const
bSizer153->Fit( this ); bSizer153->Fit( this );
// Connect Events // Connect Events
BenchmarkChoice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( BenchmarkDialogBase::OnBenchmarkChoiceSelected ), NULL, this );
BenchmarkButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BenchmarkDialogBase::OnBenchmarkButtonClick ), NULL, this ); BenchmarkButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BenchmarkDialogBase::OnBenchmarkButtonClick ), NULL, this );
} }
BenchmarkDialogBase::~BenchmarkDialogBase() BenchmarkDialogBase::~BenchmarkDialogBase()
{ {
// Disconnect Events // Disconnect Events
BenchmarkChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( BenchmarkDialogBase::OnBenchmarkChoiceSelected ), NULL, this );
BenchmarkButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BenchmarkDialogBase::OnBenchmarkButtonClick ), NULL, this ); BenchmarkButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BenchmarkDialogBase::OnBenchmarkButtonClick ), NULL, this );
} }

View File

@ -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/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO *NOT* EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#ifndef __FORMS_H__ #ifndef __FORMS_H__
@ -11,8 +11,6 @@
#include <wx/artprov.h> #include <wx/artprov.h>
#include <wx/xrc/xmlres.h> #include <wx/xrc/xmlres.h>
#include <wx/intl.h> #include <wx/intl.h>
class WizardPage;
#include "WizardPage.h" #include "WizardPage.h"
#include <wx/string.h> #include <wx/string.h>
#include <wx/bitmap.h> #include <wx/bitmap.h>
@ -228,19 +226,25 @@ namespace VeraCrypt
private: private:
protected: protected:
wxStaticText* m_staticText70;
wxChoice* BenchmarkChoice;
wxStaticText* m_bufferSizeLabel;
wxChoice* BufferSizeChoice; wxChoice* BufferSizeChoice;
wxStaticText* m_volumePimLabel;
wxTextCtrl* VolumePimText;
wxListCtrl* BenchmarkListCtrl; wxListCtrl* BenchmarkListCtrl;
wxBoxSizer* RightSizer; wxBoxSizer* RightSizer;
wxButton* BenchmarkButton; wxButton* BenchmarkButton;
wxStaticText* BenchmarkNoteStaticText; wxStaticText* BenchmarkNoteStaticText;
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
virtual void OnBenchmarkChoiceSelected( wxCommandEvent& event ) { event.Skip(); }
virtual void OnBenchmarkButtonClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnBenchmarkButtonClick( wxCommandEvent& event ) { event.Skip(); }
public: 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(); ~BenchmarkDialogBase();
}; };

View File

@ -4246,7 +4246,7 @@
<property name="size"></property> <property name="size"></property>
<property name="style">wxDEFAULT_DIALOG_STYLE</property> <property name="style">wxDEFAULT_DIALOG_STYLE</property>
<property name="subclass"></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="tooltip"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
@ -4305,11 +4305,190 @@
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxEXPAND</property>
<property name="proportion">0</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="minimum_size"></property>
<property name="name">bSizer155</property> <property name="name">fgSizer9</property>
<property name="orient">wxHORIZONTAL</property> <property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
<property name="permission">none</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"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT</property>
@ -4350,11 +4529,11 @@
<property name="minimize_button">0</property> <property name="minimize_button">0</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="moveable">1</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_border">1</property>
<property name="pane_position"></property> <property name="pane_position"></property>
<property name="pane_size"></property> <property name="pane_size"></property>
<property name="permission">none</property> <property name="permission">protected</property>
<property name="pin_button">1</property> <property name="pin_button">1</property>
<property name="pos"></property> <property name="pos"></property>
<property name="resize">Resizable</property> <property name="resize">Resizable</property>
@ -4481,6 +4660,181 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</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> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">