VeraCrypt
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2017-07-02 10:24:06 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2017-07-02 12:08:04 +0200
commitd76107690343a5d85a8a90de050911db3eb1736e (patch)
treed13cbc6f5444ac35d46f6917b3fd7d2614baa7f4
parent235b52027badd768151173856ac4748478483ce8 (diff)
downloadVeraCrypt-d76107690343a5d85a8a90de050911db3eb1736e.tar.gz
VeraCrypt-d76107690343a5d85a8a90de050911db3eb1736e.zip
Linux/MacOSX: use aligned memory for allocating hash context to avoid issues on some platforms especially for Streebog.
-rw-r--r--src/Volume/Hash.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Volume/Hash.cpp b/src/Volume/Hash.cpp
index 965e634c..5e64b3ff 100644
--- a/src/Volume/Hash.cpp
+++ b/src/Volume/Hash.cpp
@@ -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();
}