diff options
author | lloyd <[email protected]> | 2010-04-17 17:41:33 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-04-17 17:41:33 +0000 |
commit | 941a184703fbdb979965d4ef9328a99535e692ae (patch) | |
tree | bb45a74039fb67bcdc4eb9e2a97af1370544d622 /src/engine | |
parent | e79090be74f21ab3663c1fe2662a8e8bd51606a4 (diff) |
Add Comb4P hash combiner, as described in Anja Lehmann's thesis.
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/def_engine/lookup_hash.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/engine/def_engine/lookup_hash.cpp b/src/engine/def_engine/lookup_hash.cpp index 4ce7915d4..1d96d4f3f 100644 --- a/src/engine/def_engine/lookup_hash.cpp +++ b/src/engine/def_engine/lookup_hash.cpp @@ -83,6 +83,10 @@ #include <botan/par_hash.h> #endif +#if defined(BOTAN_HAS_COMB4P) + #include <botan/comb4p.h> +#endif + namespace Botan { /* @@ -185,6 +189,17 @@ Default_Engine::find_hash(const SCAN_Name& request, return new Whirlpool; #endif +#if defined(BOTAN_HAS_COMB4P) + if(request.algo_name() == "Comb4P" && request.arg_count() == 2) + { + const HashFunction* h1 = af.prototype_hash_function(request.arg(0)); + const HashFunction* h2 = af.prototype_hash_function(request.arg(1)); + + if(h1 && h2) + return new Comb4P(h1->clone(), h2->clone()); + } +#endif + #if defined(BOTAN_HAS_PARALLEL_HASH) if(request.algo_name() == "Parallel") |