aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-12-23 16:51:24 +0000
committerlloyd <[email protected]>2009-12-23 16:51:24 +0000
commit92a851901ea42398c221a608348d1336b5529b09 (patch)
tree22dab44199d116f1de2ede8a03b5ffc3a5bc6247 /src/engine
parent3a652cd28ec554267be414d69ed14b46956f84d7 (diff)
Add last nights project, an SSE2 implementation of IDEA. Right about 4x
faster than the scalar version on a Core2.
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/simd_engine/simd_engine.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/engine/simd_engine/simd_engine.cpp b/src/engine/simd_engine/simd_engine.cpp
index 892221f22..b8ebd6a80 100644
--- a/src/engine/simd_engine/simd_engine.cpp
+++ b/src/engine/simd_engine/simd_engine.cpp
@@ -17,6 +17,10 @@
#include <botan/xtea_simd.h>
#endif
+#if defined(BOTAN_HAS_IDEA_SSE2)
+ #include <botan/idea_sse2.h>
+#endif
+
#if defined(BOTAN_HAS_SHA1_SSE2)
#include <botan/sha1_sse2.h>
#endif
@@ -27,16 +31,18 @@ BlockCipher*
SIMD_Engine::find_block_cipher(const SCAN_Name& request,
Algorithm_Factory&) const
{
- if(!SIMD_32::enabled())
- return 0;
+#if defined(BOTAN_HAS_IDEA_SSE2)
+ if(request.algo_name() == "IDEA" && CPUID::has_sse2())
+ return new IDEA_SSE2;
+#endif
#if defined(BOTAN_HAS_SERPENT_SIMD)
- if(request.algo_name() == "Serpent")
+ if(request.algo_name() == "Serpent" && SIMD_32::enabled())
return new Serpent_SIMD;
#endif
#if defined(BOTAN_HAS_XTEA_SIMD)
- if(request.algo_name() == "XTEA")
+ if(request.algo_name() == "XTEA" && SIMD_32::enabled())
return new XTEA_SIMD;
#endif