Browse Source

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

Michiel Visser 1 năm trước cách đây
mục cha
commit
0db6e0449e
1 tập tin đã thay đổi với 9 bổ sung0 xóa
  1. 9 0
      Userland/Libraries/LibCrypto/Hash/HashManager.h

+ 9 - 0
Userland/Libraries/LibCrypto/Hash/HashManager.h

@@ -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 {};