Suppress last compiler warnings in sha1.cpp

* Immediate '0x80' is unsigned.
* Assign only the first 32bits to int block.
This commit is contained in:
Kawe Mazidjatari 2023-02-12 18:14:03 +01:00
parent f21202611c
commit 7f16717d5d

View File

@ -68,7 +68,7 @@ std::string SHA1::final()
uint64 total_bits = (transforms*BLOCK_BYTES + buffer.size()) * 8;
/* Padding */
buffer += 0x80;
buffer += (unsigned char)0x80;
size_t orig_size = buffer.size();
while (buffer.size() < BLOCK_BYTES)
{
@ -88,7 +88,7 @@ std::string SHA1::final()
}
/* Append total_bits, split this uint64 into two uint32 */
block[BLOCK_INTS - 1] = total_bits;
block[BLOCK_INTS - 1] = total_bits & UINT_MAX;
block[BLOCK_INTS - 2] = (total_bits >> 32);
transform(block);