VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Crypto
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-07-25 08:16:38 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-07-25 08:26:09 +0200
commit3aaf5c70453d2bc4b2f1efe224e0adf0ff8a0ec2 (patch)
tree1df9050b6110c7565dedee1a146de2cba5d4d5d9 /src/Crypto
parent73703095b22fef40575d91397029acc703faa157 (diff)
downloadVeraCrypt-3aaf5c70453d2bc4b2f1efe224e0adf0ff8a0ec2.tar.gz
VeraCrypt-3aaf5c70453d2bc4b2f1efe224e0adf0ff8a0ec2.zip
Windows: solve benchmark issue for Whirlpool which caused wrong numbers when a 1GB buffer is chosen.
Diffstat (limited to 'src/Crypto')
-rw-r--r--src/Crypto/Whirlpool.c4
-rw-r--r--src/Crypto/Whirlpool.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/Crypto/Whirlpool.c b/src/Crypto/Whirlpool.c
index 00f08eb7..19cfad2a 100644
--- a/src/Crypto/Whirlpool.c
+++ b/src/Crypto/Whirlpool.c
@@ -898,11 +898,11 @@ void WHIRLPOOL_init(WHIRLPOOL_CTX * const ctx) {
* This method maintains the invariant: bufferBits < DIGESTBITS
*/
void WHIRLPOOL_add(const unsigned char * input,
- unsigned __int32 sourceBits,
+ unsigned __int32 sourceBytes,
WHIRLPOOL_CTX * const ctx)
{
uint64 num, oldCountLo = ctx->countLo, oldCountHi = ctx->countHi;
- uint64 len = sourceBits >> 3;
+ uint64 len = sourceBytes;
if ((ctx->countLo = oldCountLo + (uint64)len) < oldCountLo)
ctx->countHi++; // carry from low to high
diff --git a/src/Crypto/Whirlpool.h b/src/Crypto/Whirlpool.h
index 9e771935..fe618a9b 100644
--- a/src/Crypto/Whirlpool.h
+++ b/src/Crypto/Whirlpool.h
@@ -16,7 +16,7 @@ typedef struct WHIRLPOOL_CTX {
extern "C" {
#endif
-void WHIRLPOOL_add(const unsigned char * source, unsigned __int32 sourceBits, WHIRLPOOL_CTX * const ctx);
+void WHIRLPOOL_add(const unsigned char * source, unsigned __int32 sourceBytes, WHIRLPOOL_CTX * const ctx);
void WHIRLPOOL_finalize(WHIRLPOOL_CTX* const ctx, unsigned char * result);
void WHIRLPOOL_init(WHIRLPOOL_CTX* const ctx);