Mark all Block::Decryptor<> methods const.
All checks were successful
Chaos Ci / test-and-benchmark (push) Successful in 1m42s

This allows for convenient usage of const Decryptor<Impl> &.
This commit is contained in:
hashlag
2026-02-01 00:24:50 +03:00
parent cdcab2f4f7
commit d194fef1af
3 changed files with 8 additions and 8 deletions

View File

@@ -9,18 +9,18 @@ class Decryptor
{
public:
template<typename OutputIt, typename InputIt>
void DecryptBlock(OutputIt out, InputIt inBegin, InputIt inEnd)
void DecryptBlock(OutputIt out, InputIt inBegin, InputIt inEnd) const
{
Impl().DecryptBlock(out, inBegin, inEnd);
}
template<typename Block>
auto DecryptBlock(Block block)
auto DecryptBlock(Block block) const
{
return Impl().DecryptBlock(block);
}
auto GetBlockSize()
auto GetBlockSize() const
{
return Impl().GetBlockSize();
}

View File

@@ -279,7 +279,7 @@ public:
{ }
template<typename OutputIt, typename InputIt>
void DecryptBlock(OutputIt out, InputIt inBegin, InputIt inEnd)
void DecryptBlock(OutputIt out, InputIt inBegin, InputIt inEnd) const
{
RawBlockArray block;
@@ -297,12 +297,12 @@ public:
Inner_::Bitwise::CrunchUInt64(out, decrypted);
}
Block DecryptBlock(Block block)
Block DecryptBlock(Block block) const
{
return DesCrypt::ProcessBlock(block, Schedule_);
}
constexpr size_t GetBlockSize()
constexpr size_t GetBlockSize() const
{
return BlockSize;
}