aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/hash/blake2
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/hash/blake2')
-rw-r--r--src/lib/hash/blake2/blake2b.cpp5
-rw-r--r--src/lib/hash/blake2/blake2b.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/hash/blake2/blake2b.cpp b/src/lib/hash/blake2/blake2b.cpp
index b478af106..85171b16b 100644
--- a/src/lib/hash/blake2/blake2b.cpp
+++ b/src/lib/hash/blake2/blake2b.cpp
@@ -208,6 +208,11 @@ HashFunction* Blake2b::clone() const
return new Blake2b(m_output_bits);
}
+std::unique_ptr<HashFunction> Blake2b::copy_state() const
+ {
+ return std::unique_ptr<HashFunction>(new Blake2b(*this));
+ }
+
void Blake2b::clear()
{
zeroise(m_H);
diff --git a/src/lib/hash/blake2/blake2b.h b/src/lib/hash/blake2/blake2b.h
index 473352174..c7ceac01e 100644
--- a/src/lib/hash/blake2/blake2b.h
+++ b/src/lib/hash/blake2/blake2b.h
@@ -38,6 +38,8 @@ class BOTAN_DLL Blake2b final : public HashFunction
std::string name() const override;
void clear() override;
+ std::unique_ptr<HashFunction> copy_state() const override;
+
private:
void add_data(const uint8_t input[], size_t length) override;
void final_result(uint8_t out[]) override;