mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-12 11:28:26 -06:00
Windows: solve benchmark issue for Whirlpool which caused wrong numbers when a 1GB buffer is chosen.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user