wolfCrypt as crypto backend for VeraCrypt (#1227)

* wolfCrypt as crypto backend for VeraCrypt

* Refactor to use EncryptionModeWolfCryptXTS class
This commit is contained in:
lealem47
2023-11-12 16:51:31 -07:00
committed by GitHub
parent 458be85f84
commit 9247ce1bb9
36 changed files with 1104 additions and 220 deletions

View File

@@ -12,6 +12,9 @@
#include "System.h"
#include "Volume/EncryptionModeXTS.h"
#ifdef WOLFCRYPT_BACKEND
#include "Volume/EncryptionModeWolfCryptXTS.h"
#endif
#include "Volume/EncryptionTest.h"
#include "Main/GraphicUserInterface.h"
#include "EncryptionTestDialog.h"
@@ -94,8 +97,13 @@ namespace VeraCrypt
throw StringConversionFailed (SRC_POS);
}
#ifdef WOLFCRYPT_BACKEND
shared_ptr <EncryptionMode> xts (new EncryptionModeWolfCryptXTS);
ea->SetKeyXTS (secondaryKey);
#else
shared_ptr <EncryptionMode> xts (new EncryptionModeXTS);
xts->SetKey (secondaryKey);
#endif
xts->SetKey (secondaryKey);
ea->SetMode (xts);
Buffer sector (ENCRYPTION_DATA_UNIT_SIZE);