1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 11:08:02 -06:00

Windows: Add support for Streebog (hash) and kuznyechik (encryption)

This commit is contained in:
Mounir IDRASSI
2016-08-09 14:25:52 +02:00
parent 0b2c8b09c6
commit e90e24b30b
28 changed files with 5597 additions and 14 deletions

View File

@@ -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());
}
}