LibCrypto: Add a Hash::Manager that can act as any one of the hashes

This commit is contained in:
AnotherTest 2020-04-25 05:06:33 +04:30 committed by Andreas Kling
commit 43a49f5fff
Notes: sideshowbarker 2024-07-19 07:04:25 +09:00
6 changed files with 338 additions and 17 deletions

View file

@ -48,6 +48,10 @@ constexpr static u32 RoundConstants[4] {
template<size_t Bytes>
struct SHA1Digest {
u8 data[Bytes];
constexpr static size_t Size = Bytes;
const u8* immutable_data() const { return data; }
size_t data_length() { return Bytes; }
};
class SHA1 final : public HashFunction<512, SHA1Digest<160 / 8>> {