Botan  2.1.0
Crypto and TLS for C++11
par_hash.h
Go to the documentation of this file.
1 /*
2 * Parallel Hash
3 * (C) 1999-2007 Jack Lloyd
4 *
5 * Botan is released under the Simplified BSD License (see license.txt)
6 */
7 
8 #ifndef BOTAN_PARALLEL_HASH_H__
9 #define BOTAN_PARALLEL_HASH_H__
10 
11 #include <botan/hash.h>
12 #include <vector>
13 
14 namespace Botan {
15 
16 /**
17 * Parallel Hashes
18 */
19 class BOTAN_DLL Parallel final : public HashFunction
20  {
21  public:
22  void clear() override;
23  std::string name() const override;
24  HashFunction* clone() const override;
25 
26  size_t output_length() const override;
27 
28  /**
29  * @param hashes a set of hashes to compute in parallel
30  * Takes ownership of all pointers
31  */
32  explicit Parallel(std::vector<std::unique_ptr<HashFunction>>& hashes);
33 
34  Parallel(const Parallel&) = delete;
35  Parallel& operator=(const Parallel&) = delete;
36  private:
37  Parallel() = delete;
38 
39  void add_data(const uint8_t[], size_t) override;
40  void final_result(uint8_t[]) override;
41 
42  std::vector<std::unique_ptr<HashFunction>> m_hashes;
43  };
44 
45 }
46 
47 #endif
Definition: alg_id.cpp:13