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

Linux/MacOSX: use aligned memory for allocating hash context to avoid issues on some platforms especially for Streebog.

This commit is contained in:
Mounir IDRASSI
2017-07-02 10:24:06 +02:00
parent 235b52027b
commit d761076903

View File

@@ -48,7 +48,7 @@ namespace VeraCrypt
Ripemd160::Ripemd160 ()
{
Deprecated = true; // Mark RIPEMD-160 as deprecated like on Windows.
Context.Allocate (sizeof (RMD160_CTX));
Context.Allocate (sizeof (RMD160_CTX), 32);
Init();
}
@@ -72,7 +72,7 @@ namespace VeraCrypt
// SHA-256
Sha256::Sha256 ()
{
Context.Allocate (sizeof (sha256_ctx));
Context.Allocate (sizeof (sha256_ctx), 32);
Init();
}
@@ -96,7 +96,7 @@ namespace VeraCrypt
// SHA-512
Sha512::Sha512 ()
{
Context.Allocate (sizeof (sha512_ctx));
Context.Allocate (sizeof (sha512_ctx), 32);
Init();
}
@@ -120,7 +120,7 @@ namespace VeraCrypt
// Whirlpool
Whirlpool::Whirlpool ()
{
Context.Allocate (sizeof (WHIRLPOOL_CTX));
Context.Allocate (sizeof (WHIRLPOOL_CTX), 32);
Init();
}
@@ -144,7 +144,7 @@ namespace VeraCrypt
// Streebog
Streebog::Streebog ()
{
Context.Allocate (sizeof (STREEBOG_CTX));
Context.Allocate (sizeof (STREEBOG_CTX), 32);
Init();
}