Files
ladybird/Libraries/LibCrypto/Hash/BLAKE2b.h
devgianlu 89061dd3c4 LibCrypto: Replace all hashes implementation with OpenSSL
This required multiple changes:
- Make hashes non-copiable because they contain a heap allocated pointer
- Reference classes via `NonnullOwnPtr` only (they are non-copiable)
- Drop all existing hashes implementations
- Use the `OpenSSLHashFunction` base class to implement the same hashes

I was not able to come up with a way to divide this commit into multiple
without increasing the amount of changes.

Nothing breaks with this commit!
2024-12-22 18:53:45 +01:00

30 lines
539 B
C++

/*
* Copyright (c) 2023, the SerenityOS developers
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/ByteString.h>
#include <LibCrypto/Hash/OpenSSLHashFunction.h>
namespace Crypto::Hash {
class BLAKE2b final : public OpenSSLHashFunction<BLAKE2b, 1024, 512> {
AK_MAKE_NONCOPYABLE(BLAKE2b);
public:
explicit BLAKE2b(EVP_MD_CTX* context)
: OpenSSLHashFunction(EVP_blake2b512(), context)
{
}
virtual ByteString class_name() const override
{
return "BLAKE2b";
}
};
};