1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 21:07:36 +00:00

LibCrypto: Implement HMAC

This commit is contained in:
AnotherTest 2020-04-08 01:54:50 +04:30 committed by Andreas Kling
parent 4f89a377a4
commit f2cd004d11
8 changed files with 249 additions and 3 deletions

View file

@ -26,6 +26,8 @@
#pragma once
#include <AK/String.h>
#include <AK/StringBuilder.h>
#include <LibCrypto/Cipher/Mode/Mode.h>
namespace Crypto {
@ -40,6 +42,14 @@ namespace Cipher {
{
}
virtual String class_name() const override
{
StringBuilder builder;
builder.append(this->cipher().class_name());
builder.append("_CBC");
return builder.build();
}
virtual Optional<ByteBuffer> encrypt(const ByteBuffer& in, ByteBuffer& out, Optional<ByteBuffer> ivec = {}) override
{
auto length = in.size();