Botan  1.11.15
src/lib/hash/par_hash/par_hash.h
Go to the documentation of this file.
00001 /*
00002 * Parallel Hash
00003 * (C) 1999-2007 Jack Lloyd
00004 *
00005 * Botan is released under the Simplified BSD License (see license.txt)
00006 */
00007 
00008 #ifndef BOTAN_PARALLEL_HASH_H__
00009 #define BOTAN_PARALLEL_HASH_H__
00010 
00011 #include <botan/hash.h>
00012 #include <vector>
00013 
00014 namespace Botan {
00015 
00016 /**
00017 * Parallel Hashes
00018 */
00019 class BOTAN_DLL Parallel : public HashFunction
00020    {
00021    public:
00022       void clear();
00023       std::string name() const;
00024       HashFunction* clone() const;
00025 
00026       size_t output_length() const;
00027 
00028       /**
00029       * @param hashes a set of hashes to compute in parallel
00030       */
00031       Parallel(const std::vector<HashFunction*>& hashes);
00032 
00033       static Parallel* make(const Spec& spec);
00034    private:
00035       Parallel() {}
00036 
00037       void add_data(const byte[], size_t);
00038       void final_result(byte[]);
00039 
00040       std::vector<std::unique_ptr<HashFunction>> hashes;
00041    };
00042 
00043 }
00044 
00045 #endif