8 #include <botan/par_hash.h>
15 void Parallel::add_data(
const byte input[],
size_t length)
17 for(
size_t i = 0; i != hashes.size(); ++i)
18 hashes[i]->
update(input, length);
24 void Parallel::final_result(
byte hash[])
27 for(
size_t i = 0; i != hashes.size(); ++i)
29 hashes[i]->final(hash + offset);
30 offset += hashes[i]->output_length();
40 for(
size_t i = 0; i != hashes.size(); ++i)
50 std::string hash_names;
51 for(
size_t i = 0; i != hashes.size(); ++i)
55 hash_names += hashes[i]->name();
57 return "Parallel(" + hash_names +
")";
65 std::vector<HashFunction*> hash_copies;
66 for(
size_t i = 0; i != hashes.size(); ++i)
67 hash_copies.push_back(hashes[i]->clone());
76 for(
size_t i = 0; i != hashes.size(); ++i)
93 for(
size_t i = 0; i != hashes.size(); ++i)
HashFunction * clone() const
size_t output_length() const
Parallel(const std::vector< HashFunction * > &hashes)
void update(const byte in[], size_t length)