VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Crypto
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2013-06-25 03:48:35 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2014-11-08 22:18:44 (GMT)
commit593d1a3edcf3ece6fb25d6ea7f582b0fbd3d7ae8 (patch)
tree7d87b8c9656d31a02aa7bac8de9b180421720844 /src/Crypto
parent0f70b56942a305bf0f7954c0e06b601517989156 (diff)
downloadVeraCrypt-593d1a3edcf3ece6fb25d6ea7f582b0fbd3d7ae8.zip
VeraCrypt-593d1a3edcf3ece6fb25d6ea7f582b0fbd3d7ae8.tar.gz
Update RIPEMD160 implementation in Windows Bootloaded to benefit from the compiler 32-bit integer
Diffstat (limited to 'src/Crypto')
-rw-r--r--src/Crypto/Rmd160.c5
-rw-r--r--src/Crypto/Rmd160.h2
2 files changed, 3 insertions, 4 deletions
diff --git a/src/Crypto/Rmd160.c b/src/Crypto/Rmd160.c
index a441da3..cd21566 100644
--- a/src/Crypto/Rmd160.c
+++ b/src/Crypto/Rmd160.c
@@ -70,7 +70,7 @@ void RMD160Update (RMD160_CTX *ctx, const unsigned char *input, unsigned __int32
#ifndef TC_WINDOWS_BOOT
uint64 len = lenArg, have, need;
#else
- uint16 len = (uint16) lenArg, have, need;
+ uint32 len = lenArg, have, need;
#endif
/* Check how many bytes we already have and how many more we need. */
@@ -117,8 +117,7 @@ static void RMD160Pad(RMD160_CTX *ctx)
PUT_64BIT_LE(count, ctx->count);
#else
*(uint32 *) (count + 4) = 0;
- *(uint16 *) (count + 2) = 0;
- *(uint16 *) (count + 0) = ctx->count;
+ *(uint32 *) (count + 0) = ctx->count;
#endif
/* Pad out to 56 mod 64. */
diff --git a/src/Crypto/Rmd160.h b/src/Crypto/Rmd160.h
index 4bdd794..4dfa38f 100644
--- a/src/Crypto/Rmd160.h
+++ b/src/Crypto/Rmd160.h
@@ -16,7 +16,7 @@ typedef struct RMD160Context
#ifndef TC_WINDOWS_BOOT
uint64 count;
#else
- uint16 count;
+ uint32 count;
#endif
unsigned char buffer[RIPEMD160_BLOCK_LENGTH];
} RMD160_CTX;