diff options
author | AnotherTest <ali.mpfard@gmail.com> | 2020-04-08 01:54:50 +0430 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-05-02 12:24:10 +0200 |
commit | f2cd004d11ba976faf309b79ddf86e69140974cf (patch) | |
tree | d05317d2a0a23ad03912eedee949120dc4dab6e4 /Libraries/LibCrypto/Hash | |
parent | 4f89a377a4b271b7abbba42c2e1ceddb61a68d07 (diff) | |
download | serenity-f2cd004d11ba976faf309b79ddf86e69140974cf.zip |
LibCrypto: Implement HMAC
Diffstat (limited to 'Libraries/LibCrypto/Hash')
-rw-r--r-- | Libraries/LibCrypto/Hash/HashFunction.h | 1 | ||||
-rw-r--r-- | Libraries/LibCrypto/Hash/MD5.h | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/Libraries/LibCrypto/Hash/HashFunction.h b/Libraries/LibCrypto/Hash/HashFunction.h index a7e3a8ae25..bdb132543c 100644 --- a/Libraries/LibCrypto/Hash/HashFunction.h +++ b/Libraries/LibCrypto/Hash/HashFunction.h @@ -49,6 +49,7 @@ namespace Hash { virtual void update(const StringView& string) = 0; virtual DigestType digest() = 0; + virtual String class_name() const = 0; }; } } diff --git a/Libraries/LibCrypto/Hash/MD5.h b/Libraries/LibCrypto/Hash/MD5.h index 89da2629dd..61700c75ad 100644 --- a/Libraries/LibCrypto/Hash/MD5.h +++ b/Libraries/LibCrypto/Hash/MD5.h @@ -26,6 +26,7 @@ #pragma once +#include <AK/String.h> #include <AK/Types.h> #include <LibCrypto/Hash/HashFunction.h> @@ -79,6 +80,8 @@ namespace Hash { virtual void update(const StringView& string) override { update((const u8*)string.characters_without_null_termination(), string.length()); }; virtual DigestType digest() override; + virtual String class_name() const override { return "MD5"; } + inline static DigestType hash(const u8* data, size_t length) { MD5 md5; |