mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-08-31 21:29:05 +00:00
wolfCrypt as crypto backend for VeraCrypt (#1227)
* wolfCrypt as crypto backend for VeraCrypt * Refactor to use EncryptionModeWolfCryptXTS class
This commit is contained in:
@@ -12,6 +12,9 @@
|
||||
|
||||
#include "Volume/EncryptionTest.h"
|
||||
#include "Volume/EncryptionModeXTS.h"
|
||||
#ifdef WOLFCRYPT_BACKEND
|
||||
#include "Volume/EncryptionModeWolfCryptXTS.h"
|
||||
#endif
|
||||
#include "Core.h"
|
||||
|
||||
#ifdef TC_UNIX
|
||||
@@ -360,8 +363,13 @@ namespace VeraCrypt
|
||||
|
||||
// Data area keys
|
||||
options->EA->SetKey (MasterKey.GetRange (0, options->EA->GetKeySize()));
|
||||
shared_ptr <EncryptionMode> mode (new EncryptionModeXTS ());
|
||||
mode->SetKey (MasterKey.GetRange (options->EA->GetKeySize(), options->EA->GetKeySize()));
|
||||
#ifdef WOLFCRYPT_BACKEND
|
||||
shared_ptr <EncryptionMode> mode (new EncryptionModeWolfCryptXTS ());
|
||||
options->EA->SetKeyXTS (MasterKey.GetRange (options->EA->GetKeySize(), options->EA->GetKeySize()));
|
||||
#else
|
||||
shared_ptr <EncryptionMode> mode (new EncryptionModeXTS ());
|
||||
#endif
|
||||
mode->SetKey (MasterKey.GetRange (options->EA->GetKeySize(), options->EA->GetKeySize()));
|
||||
options->EA->SetMode (mode);
|
||||
|
||||
Options = options;
|
||||
|
||||
Reference in New Issue
Block a user