1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:18:11 +00:00

LibCrypto: Move each subsection into its own namespace

This commit is contained in:
AnotherTest 2020-04-07 14:42:27 +04:30 committed by Andreas Kling
parent 96dd7c2996
commit 4f89a377a4
9 changed files with 3256 additions and 3228 deletions

View file

@ -31,21 +31,24 @@
#include <AK/Types.h>
namespace Crypto {
namespace Hash {
template<size_t BlockS, typename DigestT>
class HashFunction {
public:
static constexpr auto BlockSize = BlockS;
using DigestType = DigestT;
template <size_t BlockS, typename DigestT>
class HashFunction {
public:
static constexpr auto BlockSize = BlockS / 8;
static constexpr auto DigestSize = sizeof(DigestT);
static size_t block_size() { return BlockSize; };
static size_t digest_size() { return sizeof(DigestType); };
using DigestType = DigestT;
virtual void update(const u8*, size_t) = 0;
virtual void update(const ByteBuffer& buffer) = 0;
virtual void update(const StringView& string) = 0;
static size_t block_size() { return BlockSize; };
static size_t digest_size() { return DigestSize; };
virtual DigestType digest() = 0;
};
virtual void update(const u8*, size_t) = 0;
virtual void update(const ByteBuffer& buffer) = 0;
virtual void update(const StringView& string) = 0;
virtual DigestType digest() = 0;
};
}
}