diff options
author | lealem47 <60322859+lealem47@users.noreply.github.com> | 2023-11-12 16:51:31 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-13 00:51:31 +0100 |
commit | 9247ce1bb90c44d19a0069fadb12c0c480ac9b4f (patch) | |
tree | 66fb4728d502759271d03eba59d51c1a129b2ffb /src/Volume/Hash.cpp | |
parent | 458be85f84a097aa829658c50ce41d82791fb6a8 (diff) | |
download | VeraCrypt-9247ce1bb90c44d19a0069fadb12c0c480ac9b4f.tar.gz VeraCrypt-9247ce1bb90c44d19a0069fadb12c0c480ac9b4f.zip |
wolfCrypt as crypto backend for VeraCrypt (#1227)
* wolfCrypt as crypto backend for VeraCrypt
* Refactor to use EncryptionModeWolfCryptXTS class
Diffstat (limited to 'src/Volume/Hash.cpp')
-rw-r--r-- | src/Volume/Hash.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/Volume/Hash.cpp b/src/Volume/Hash.cpp index aad900c1..d2e3e649 100644 --- a/src/Volume/Hash.cpp +++ b/src/Volume/Hash.cpp @@ -24,11 +24,12 @@ namespace VeraCrypt HashList l; l.push_back (shared_ptr <Hash> (new Sha512 ())); - l.push_back (shared_ptr <Hash> (new Whirlpool ())); - l.push_back (shared_ptr <Hash> (new Blake2s ())); l.push_back (shared_ptr <Hash> (new Sha256 ())); + #ifndef WOLFCRYPT_BACKEND + l.push_back (shared_ptr <Hash> (new Blake2s ())); + l.push_back (shared_ptr <Hash> (new Whirlpool ())); l.push_back (shared_ptr <Hash> (new Streebog ())); - + #endif return l; } @@ -44,6 +45,7 @@ namespace VeraCrypt throw ParameterIncorrect (SRC_POS); } + #ifndef WOLFCRYPT_BACKEND // RIPEMD-160 Blake2s::Blake2s () { @@ -67,6 +69,7 @@ namespace VeraCrypt if_debug (ValidateDataParameters (data)); blake2s_update ((blake2s_state *) Context.Ptr(), data.Get(), data.Size()); } + #endif // SHA-256 Sha256::Sha256 () @@ -116,6 +119,7 @@ namespace VeraCrypt sha512_hash (data.Get(), (int) data.Size(), (sha512_ctx *) Context.Ptr()); } + #ifndef WOLFCRYPT_BACKEND // Whirlpool Whirlpool::Whirlpool () { @@ -163,4 +167,5 @@ namespace VeraCrypt if_debug (ValidateDataParameters (data)); STREEBOG_add ((STREEBOG_CTX *) Context.Ptr(), data.Get(), (int) data.Size()); } + #endif } |