Cipher now using new block class

This commit is contained in:
Leonetienne
2022-05-25 13:05:25 +02:00
parent b5369a3c32
commit edbf36eb6d
4 changed files with 41 additions and 61 deletions

View File

@@ -8,7 +8,7 @@ namespace Leonetienne::GCrypt {
constexpr std::size_t BLOCK_SIZE = 512;
// MUST BE > 2
constexpr std::size_t N_ROUNDS = 10;
constexpr std::size_t N_ROUNDS = 6;
}
#endif

View File

@@ -18,6 +18,17 @@ namespace Leonetienne::GCrypt {
return (denominator + (numerator % denominator)) % denominator;
}
inline Block Shiftl(const Block& bits, const std::size_t amount) {
std::stringstream ss;
const std::string bitss = bits.ToString();
for (std::size_t i = 0; i < bitss.size(); i++) {
ss << bitss[Mod((int)(i + amount), (int)bitss.size())];
}
return Block(ss.str());
}
//! Will perform a wrapping left-bitshift on a bitset
template <std::size_t T>
inline SecureBitset<T> Shiftl(const SecureBitset<T>& bits, const std::size_t amount) {

View File

@@ -1,7 +1,7 @@
#ifndef GCRYPT_VERSION_H
#define GCRYPT_VERSION_H
#define GCRYPT_VERSION 0.232
#define GCRYPT_VERSION 0.233
#endif