VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Crypto/Sha2.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2017-05-22 00:41:56 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2017-05-22 00:43:29 +0200
commit7c78c4f4ac7be0116f48e2609e49a0d7d9458073 (patch)
treeb4773b0e0195aef4577014d5c46f729098e9634f /src/Crypto/Sha2.c
parente484d0caaeca39b526b2d8df99ed712782a095ab (diff)
downloadVeraCrypt-7c78c4f4ac7be0116f48e2609e49a0d7d9458073.tar.gz
VeraCrypt-7c78c4f4ac7be0116f48e2609e49a0d7d9458073.zip
Windows Driver: fix "__chkstk" link error in debug build caused by some crypto functions using too much stack space for local variables.
Diffstat (limited to 'src/Crypto/Sha2.c')
-rw-r--r--src/Crypto/Sha2.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Crypto/Sha2.c b/src/Crypto/Sha2.c
index 80758285..9dbb529f 100644
--- a/src/Crypto/Sha2.c
+++ b/src/Crypto/Sha2.c
@@ -498,11 +498,20 @@ const uint_64t k512[80] =
VOID_RETURN sha512_compile(sha512_ctx ctx[1])
{ uint_64t v[8], *p = ctx->wbuf;
uint_32t j;
+#if defined (TC_WINDOWS_DRIVER) && defined (DEBUG)
+ uint_32t i;
+#endif
memcpy(v, ctx->hash, 8 * sizeof(uint_64t));
for(j = 0; j < 80; j += 16)
{
+#if defined (TC_WINDOWS_DRIVER) && defined (DEBUG)
+ for (i = 0; i < 16; i++)
+ {
+ v_cycle( i, j);
+ }
+#else
v_cycle( 0, j); v_cycle( 1, j);
v_cycle( 2, j); v_cycle( 3, j);
v_cycle( 4, j); v_cycle( 5, j);
@@ -511,6 +520,7 @@ VOID_RETURN sha512_compile(sha512_ctx ctx[1])
v_cycle(10, j); v_cycle(11, j);
v_cycle(12, j); v_cycle(13, j);
v_cycle(14, j); v_cycle(15, j);
+#endif
}
ctx->hash[0] += v[0]; ctx->hash[1] += v[1];