aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-09-25 11:51:58 +0000
committerlloyd <[email protected]>2009-09-25 11:51:58 +0000
commit2c817e542ab946c8d1b38f0ebb52c624a8076169 (patch)
treef272fb6f5639fd43064ef92e6a7f26f062b790ff /src/engine
parent6cb4b06db7855fa8bec60b2965fe34fb01e5896c (diff)
parent03f41b6ceb6e9dcfbe4b134239431de43afd7e6b (diff)
merge of '1efb42e84eca9e01edd7b7f1335af7011eab994c'
and 'bb55abb64b64ca63aeb361db40c6bc4692d4ce48'
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/sse2_eng/eng_sse2.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/engine/sse2_eng/eng_sse2.cpp b/src/engine/sse2_eng/eng_sse2.cpp
index 9f68a070e..07c625c7c 100644
--- a/src/engine/sse2_eng/eng_sse2.cpp
+++ b/src/engine/sse2_eng/eng_sse2.cpp
@@ -6,6 +6,7 @@
*/
#include <botan/eng_sse2.h>
+#include <botan/cpuid.h>
#if defined(BOTAN_HAS_SHA1_SSE2)
#include <botan/sha1_sse2.h>
@@ -21,6 +22,9 @@ BlockCipher*
SSE2_Assembler_Engine::find_block_cipher(const SCAN_Name& request,
Algorithm_Factory&) const
{
+ if(!CPUID::has_sse2())
+ return 0;
+
#if defined(BOTAN_HAS_SERPENT_SSE2)
if(request.algo_name() == "Serpent")
return new Serpent_SSE2;
@@ -33,6 +37,9 @@ HashFunction*
SSE2_Assembler_Engine::find_hash(const SCAN_Name& request,
Algorithm_Factory&) const
{
+ if(!CPUID::has_sse2())
+ return 0;
+
#if defined(BOTAN_HAS_SHA1_SSE2)
if(request.algo_name() == "SHA-160")
return new SHA_160_SSE2;