Mark all Block::Decryptor<> methods const.
All checks were successful
Chaos Ci / test-and-benchmark (push) Successful in 1m42s
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:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -541,7 +541,7 @@ TEST(DesCryptTests, EncryptUInt64BlockThroughBaseTest)
|
||||
}
|
||||
|
||||
template<typename Impl, typename InputIt>
|
||||
static std::vector<uint8_t> DecryptThroughBase(Decryptor<Impl> & dec,
|
||||
static std::vector<uint8_t> DecryptThroughBase(const Decryptor<Impl> & dec,
|
||||
InputIt begin, InputIt end)
|
||||
{
|
||||
std::vector<uint8_t> result;
|
||||
@@ -565,7 +565,7 @@ TEST(DesCryptTests, DecryptThroughBaseTest)
|
||||
}
|
||||
|
||||
template<typename Impl>
|
||||
static uint64_t DecryptUInt64BlockThroughBase(Decryptor<Impl> & dec, uint64_t block)
|
||||
static uint64_t DecryptUInt64BlockThroughBase(const Decryptor<Impl> & dec, uint64_t block)
|
||||
{
|
||||
return dec.DecryptBlock(block);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user