mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
LibCrypto: Move each subsection into its own namespace
This commit is contained in:
parent
96dd7c2996
commit
4f89a377a4
Notes:
sideshowbarker
2024-07-19 07:06:21 +09:00
Author: https://github.com/alimpfard
Commit: 4f89a377a4
Pull-request: https://github.com/SerenityOS/serenity/pull/1661
Reviewed-by: https://github.com/Dexesttp
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/itamar8910
9 changed files with 3256 additions and 3228 deletions
|
@ -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;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue