Cipher now using new block class
This commit is contained in:
@@ -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
|
||||
|
@@ -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) {
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#ifndef GCRYPT_VERSION_H
|
||||
#define GCRYPT_VERSION_H
|
||||
|
||||
#define GCRYPT_VERSION 0.232
|
||||
#define GCRYPT_VERSION 0.233
|
||||
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user