VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Volume/Hash.cpp
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-08-09 14:25:52 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-08-15 01:09:11 +0200
commite90e24b30b379752bf6531c663085de1d2a653d7 (patch)
tree6ff3a18a2e9dedb9e506d67f2c560e1c8f657e47 /src/Volume/Hash.cpp
parent0b2c8b09c6eb3ddce22fa88c34a640881f8f2177 (diff)
downloadVeraCrypt-e90e24b30b379752bf6531c663085de1d2a653d7.tar.gz
VeraCrypt-e90e24b30b379752bf6531c663085de1d2a653d7.zip
Windows: Add support for Streebog (hash) and kuznyechik (encryption)
Diffstat (limited to 'src/Volume/Hash.cpp')
-rw-r--r--src/Volume/Hash.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/Volume/Hash.cpp b/src/Volume/Hash.cpp
index 225176a8..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
{
@@ -138,4 +139,28 @@ namespace VeraCrypt
if_debug (ValidateDataParameters (data));
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());
+ }
}