LibCrypto: Add method to copy Crypto::Hash::Manager

This commit is contained in:
Michiel Visser 2023-11-25 00:23:02 +01:00 committed by Ali Mohammad Pur
parent f34da6396f
commit 0db6e0449e
Notes: sideshowbarker 2024-07-17 09:49:33 +09:00

View File

@ -215,6 +215,15 @@ public:
return m_kind == kind;
}
inline Manager copy() const
{
Manager result;
result.m_algorithm = m_algorithm;
result.m_kind = m_kind;
result.m_pre_init_buffer = m_pre_init_buffer;
return result;
}
private:
using AlgorithmVariant = Variant<Empty, BLAKE2b, MD5, SHA1, SHA256, SHA384, SHA512>;
AlgorithmVariant m_algorithm {};