From d76107690343a5d85a8a90de050911db3eb1736e Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sun, 2 Jul 2017 10:24:06 +0200 Subject: Linux/MacOSX: use aligned memory for allocating hash context to avoid issues on some platforms especially for Streebog. --- src/Volume/Hash.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Volume') 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(); } -- cgit v1.2.3