aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-10-26 17:37:44 +0000
committerlloyd <[email protected]>2009-10-26 17:37:44 +0000
commit49896908c8a7893586271e353c431bb91b5215a8 (patch)
treeead9a7549b339dd2fd884bf039d1b88d0c3c9393 /src/engine
parent3b2eef9bd141e70b7dfe90fe8cc57d6561733fbc (diff)
Add a wrapper for a set of SSE2 operations with convenient syntax for 4x32
operations. Also add a pure scalar code version. Convert Serpent to use this new interface, and add an implementation of XTEA in SIMD. The wrappers plus the scalar version allow SIMD-ish code to work on all platforms. This is often a win due to better ILP being visible to the processor (as with the recent XTEA optimizations). Only real danger is register starvation, mostly an issue on x86 these days. So it may (or may not) be a win to consolidate the standard C++ versions and the SIMD versions together. Future work: - Add AltiVec/VMX version - Maybe also for ARM's NEON extension? Less pressing, I would think. - Convert SHA-1 code to use SIMD_32 - Add XTEA SIMD decryption (currently only encrypt) - Change SSE2 engine to SIMD_engine - Modify configure.py to set BOTAN_TARGET_CPU_HAS_[SSE2|ALTIVEC|NEON|XXX] macros
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/sse2_eng/eng_sse2.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/engine/sse2_eng/eng_sse2.cpp b/src/engine/sse2_eng/eng_sse2.cpp
index 07c625c7c..51b7d04e3 100644
--- a/src/engine/sse2_eng/eng_sse2.cpp
+++ b/src/engine/sse2_eng/eng_sse2.cpp
@@ -16,6 +16,10 @@
#include <botan/serp_sse2.h>
#endif
+#if defined(BOTAN_HAS_XTEA_SSE2)
+ #include <botan/xtea_sse2.h>
+#endif
+
namespace Botan {
BlockCipher*
@@ -30,6 +34,11 @@ SSE2_Assembler_Engine::find_block_cipher(const SCAN_Name& request,
return new Serpent_SSE2;
#endif
+#if defined(BOTAN_HAS_XTEA_SSE2)
+ if(request.algo_name() == "XTEA")
+ return new XTEA_SSE2;
+#endif
+
return 0;
}