diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2019-10-17 14:59:24 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2019-10-17 15:00:37 +0200 |
commit | 4119521f9e7e11f6bae29963605b9acb2960fa8c (patch) | |
tree | 2b44e9b8778442b52e80a9a1cd676c2e69e81a62 /src | |
parent | 3bb661244c7899c068030558c50b266e0078e28f (diff) | |
download | VeraCrypt-4119521f9e7e11f6bae29963605b9acb2960fa8c.tar.gz VeraCrypt-4119521f9e7e11f6bae29963605b9acb2960fa8c.zip |
Linux: Workaround for gcc 4.4.7 bug under CentOS 6 that causes VeraCrypt built under CentOS 6 to crash when Whirlpool hash is used.
Diffstat (limited to 'src')
-rw-r--r-- | src/Crypto/Whirlpool.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Crypto/Whirlpool.c b/src/Crypto/Whirlpool.c index 35188c63..9452951e 100644 --- a/src/Crypto/Whirlpool.c +++ b/src/Crypto/Whirlpool.c @@ -643,6 +643,20 @@ static const uint64 Whirlpool_C[8*256+R] = { void WhirlpoolTransform(uint64 *digest, const uint64 *block) { #if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE +#if defined(__GNUC__) && (CRYPTOPP_GCC_VERSION <= 40407) + /* workaround for gcc 4.4.7 bug under CentOS which causes crash + * in inline assembly. + * This dummy check that is always false since "block" is aligned. + */ + uint64 lb = (uint64) block; + if (lb % 16) + { + TC_THROW_FATAL_EXCEPTION; + } +#endif +#endif + +#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE if (HasISSE()) { #ifdef __GNUC__ |