mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 11:08:02 -06:00
Update RIPEMD160 implementation in Windows Bootloaded to benefit from the compiler 32-bit integer
This commit is contained in:
@@ -70,7 +70,7 @@ void RMD160Update (RMD160_CTX *ctx, const unsigned char *input, unsigned __int32
|
|||||||
#ifndef TC_WINDOWS_BOOT
|
#ifndef TC_WINDOWS_BOOT
|
||||||
uint64 len = lenArg, have, need;
|
uint64 len = lenArg, have, need;
|
||||||
#else
|
#else
|
||||||
uint16 len = (uint16) lenArg, have, need;
|
uint32 len = lenArg, have, need;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Check how many bytes we already have and how many more we need. */
|
/* 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);
|
PUT_64BIT_LE(count, ctx->count);
|
||||||
#else
|
#else
|
||||||
*(uint32 *) (count + 4) = 0;
|
*(uint32 *) (count + 4) = 0;
|
||||||
*(uint16 *) (count + 2) = 0;
|
*(uint32 *) (count + 0) = ctx->count;
|
||||||
*(uint16 *) (count + 0) = ctx->count;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Pad out to 56 mod 64. */
|
/* Pad out to 56 mod 64. */
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ typedef struct RMD160Context
|
|||||||
#ifndef TC_WINDOWS_BOOT
|
#ifndef TC_WINDOWS_BOOT
|
||||||
uint64 count;
|
uint64 count;
|
||||||
#else
|
#else
|
||||||
uint16 count;
|
uint32 count;
|
||||||
#endif
|
#endif
|
||||||
unsigned char buffer[RIPEMD160_BLOCK_LENGTH];
|
unsigned char buffer[RIPEMD160_BLOCK_LENGTH];
|
||||||
} RMD160_CTX;
|
} RMD160_CTX;
|
||||||
|
|||||||
Reference in New Issue
Block a user