fix to match other implementations

This commit is contained in:
CrackedPixel 2024-10-16 17:24:11 -05:00
parent 872795cd90
commit 31d6c193ae

View File

@ -2770,7 +2770,7 @@ unsigned int *ComputeSHA1(unsigned char *data, int dataSize) {
msg[dataSize] = 128; // Write the '1' bit msg[dataSize] = 128; // Write the '1' bit
unsigned int bitsLen = 8*dataSize; unsigned int bitsLen = 8*dataSize;
memcpy(msg + newDataSize, &bitsLen, 4); // Append the len in bits at the end of the buffer msg[newDataSize-1] = bitsLen;
// Process the message in successive 512-bit chunks // Process the message in successive 512-bit chunks
for (int offset = 0; offset < newDataSize; offset += (512/8)) for (int offset = 0; offset < newDataSize; offset += (512/8))