diff options
Diffstat (limited to 'src/Volume/Hash.cpp')
-rw-r--r-- | src/Volume/Hash.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/Volume/Hash.cpp b/src/Volume/Hash.cpp index c1baa9a3..ea3517e5 100644 --- a/src/Volume/Hash.cpp +++ b/src/Volume/Hash.cpp @@ -15,6 +15,7 @@ #include "Crypto/Rmd160.h" #include "Crypto/Sha2.h" #include "Crypto/Whirlpool.h" +#include "Crypto/Streebog.h" namespace VeraCrypt { @@ -136,6 +137,30 @@ namespace VeraCrypt void Whirlpool::ProcessData (const ConstBufferPtr &data) { if_debug (ValidateDataParameters (data)); - WHIRLPOOL_add (data.Get(), (int) data.Size() * 8, (WHIRLPOOL_CTX *) Context.Ptr()); + WHIRLPOOL_add (data.Get(), (int) data.Size(), (WHIRLPOOL_CTX *) Context.Ptr()); + } + + // Streebog + Streebog::Streebog () + { + Context.Allocate (sizeof (STREEBOG_CTX)); + Init(); + } + + void Streebog::GetDigest (const BufferPtr &buffer) + { + if_debug (ValidateDigestParameters (buffer)); + STREEBOG_finalize ((STREEBOG_CTX *) Context.Ptr(), buffer); + } + + void Streebog::Init () + { + STREEBOG_init ((STREEBOG_CTX *) Context.Ptr()); + } + + void Streebog::ProcessData (const ConstBufferPtr &data) + { + if_debug (ValidateDataParameters (data)); + STREEBOG_add (data.Get(), (int) data.Size(), (STREEBOG_CTX *) Context.Ptr()); } } |