Botan  2.13.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 
15 
16 namespace Botan {
17 
18 /**
19 * Parallel Hashes
20 */
22  {
23  public:
24  void clear() override;
25  std::string name() const override;
26  HashFunction* clone() const override;
27  std::unique_ptr<HashFunction> copy_state() const override;
28 
29  size_t output_length() const override;
30 
31  /**
32  * @param hashes a set of hashes to compute in parallel
33  * Takes ownership of all pointers
34  */
35  explicit Parallel(std::vector<std::unique_ptr<HashFunction>>& hashes);
36 
37  Parallel(const Parallel&) = delete;
38  Parallel& operator=(const Parallel&) = delete;
39  private:
40  Parallel() = delete;
41 
42  void add_data(const uint8_t[], size_t) override;
43  void final_result(uint8_t[]) override;
44 
45  std::vector<std::unique_ptr<HashFunction>> m_hashes;
46  };
47 
48 }
49 
50 #endif
int(* final)(unsigned char *, CTX *)
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:31
virtual std::string name() const =0
virtual HashFunction * clone() const =0
Definition: alg_id.cpp:13
virtual void clear()=0
virtual std::unique_ptr< HashFunction > copy_state() const =0
#define BOTAN_FUTURE_INTERNAL_HEADER(hdr)
Definition: compiler.h:139
virtual size_t output_length() const =0