[Progress:] Completely re-done Block class to not use bitsets, and provide custom operators.

This commit is contained in:
Leonetienne
2022-05-24 01:02:06 +02:00
parent ed45b69342
commit 939df4731b
11 changed files with 619 additions and 191 deletions

View File

@@ -52,14 +52,14 @@ namespace Leonetienne::GCrypt {
// Slurp up the rest of the current block
std::stringstream ss;
const std::size_t bitsLeft = BLOCK_SIZE - nextBit;
ss << hasher.GetHashsum().to_string().substr(nextBit, bitsLeft);
ss << hasher.GetHashsum().ToString().substr(nextBit, bitsLeft);
// Now we have to advance to the next block
AdvanceBlock();
// Now, grab the remaining bits
const std::size_t remainingBits = BLOCK_SIZE - bitsLeft;
ss << hasher.GetHashsum().to_string().substr(0, remainingBits);
ss << hasher.GetHashsum().ToString().substr(0, remainingBits);
// Assert that we have the correct number of bits
assert(ss.str().length() == BLOCK_SIZE);