mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:07:45 +00:00
LibCrypto: Implement HMAC
This commit is contained in:
parent
4f89a377a4
commit
f2cd004d11
8 changed files with 249 additions and 3 deletions
|
@ -49,6 +49,7 @@ namespace Hash {
|
|||
virtual void update(const StringView& string) = 0;
|
||||
|
||||
virtual DigestType digest() = 0;
|
||||
virtual String class_name() const = 0;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue