diff options
author | lloyd <[email protected]> | 2010-01-11 22:07:34 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-01-11 22:07:34 +0000 |
commit | f5fd85b0ea6a5a6975d595130e029f94fddae9a4 (patch) | |
tree | 3e1de8daf0e513096a8a98f6a087015e85081340 /src/engine | |
parent | 3c3ca9050f2ffbb9bb3417e2d71142e9550936df (diff) |
Add block cipher cascade
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/def_engine/lookup_block.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/engine/def_engine/lookup_block.cpp b/src/engine/def_engine/lookup_block.cpp index cdad76c46..097a471b7 100644 --- a/src/engine/def_engine/lookup_block.cpp +++ b/src/engine/def_engine/lookup_block.cpp @@ -22,6 +22,10 @@ #include <botan/cast256.h> #endif +#if defined(BOTAN_HAS_CASCADE) + #include <botan/cascade.h> +#endif + #if defined(BOTAN_HAS_DES) #include <botan/des.h> #include <botan/desx.h> @@ -240,6 +244,17 @@ Default_Engine::find_block_cipher(const SCAN_Name& request, } #endif +#if defined(BOTAN_HAS_CASCADE) + if(request.algo_name() == "Cascade" && request.arg_count() == 2) + { + const BlockCipher* c1 = af.prototype_block_cipher(request.arg(0)); + const BlockCipher* c2 = af.prototype_block_cipher(request.arg(1)); + + if(c1 && c2) + return new Cascade_Cipher(c1->clone(), c2->clone()); + } +#endif + #if defined(BOTAN_HAS_LION) if(request.algo_name() == "Lion" && request.arg_count_between(2, 3)) { |