Преглед изворни кода

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

Michiel Visser пре 1 година
родитељ
комит
0db6e0449e
1 измењених фајлова са 9 додато и 0 уклоњено
  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;
         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:
 private:
     using AlgorithmVariant = Variant<Empty, BLAKE2b, MD5, SHA1, SHA256, SHA384, SHA512>;
     using AlgorithmVariant = Variant<Empty, BLAKE2b, MD5, SHA1, SHA256, SHA384, SHA512>;
     AlgorithmVariant m_algorithm {};
     AlgorithmVariant m_algorithm {};