LibTLS+LibCrypto: More ByteBuffer -> Span conversion

This commit is contained in:
Andreas Kling 2020-12-19 15:56:15 +01:00
commit f82b0a78ef
Notes: sideshowbarker 2024-07-19 00:44:34 +09:00
13 changed files with 45 additions and 40 deletions

View file

@ -96,6 +96,8 @@ struct SHA2Digest {
// FIXME: I want template<size_t BlockSize> but the compiler gets confused
class SHA256 final : public HashFunction<512, SHA2Digest<256 / 8>> {
public:
using HashFunction::update;
SHA256()
{
reset();
@ -103,9 +105,6 @@ public:
virtual void update(const u8*, size_t) override;
virtual void update(const ByteBuffer& buffer) override { update(buffer.data(), buffer.size()); };
virtual void update(const StringView& string) override { update((const u8*)string.characters_without_null_termination(), string.length()); };
virtual DigestType digest() override;
virtual DigestType peek() override;
@ -149,6 +148,8 @@ private:
class SHA512 final : public HashFunction<1024, SHA2Digest<512 / 8>> {
public:
using HashFunction::update;
SHA512()
{
reset();
@ -156,9 +157,6 @@ public:
virtual void update(const u8*, size_t) override;
virtual void update(const ByteBuffer& buffer) override { update(buffer.data(), buffer.size()); };
virtual void update(const StringView& string) override { update((const u8*)string.characters_without_null_termination(), string.length()); };
virtual DigestType digest() override;
virtual DigestType peek() override;