diff options
Diffstat (limited to 'src/libstate/engine')
-rw-r--r-- | src/libstate/engine/amd64_eng/eng_amd64.cpp | 25 | ||||
-rw-r--r-- | src/libstate/engine/amd64_eng/eng_amd64.h | 24 | ||||
-rw-r--r-- | src/libstate/engine/amd64_eng/info.txt | 14 | ||||
-rw-r--r-- | src/libstate/engine/asm_engine/asm_engine.h | 27 | ||||
-rw-r--r-- | src/libstate/engine/asm_engine/info.txt | 10 | ||||
-rw-r--r-- | src/libstate/engine/ia32_eng/eng_ia32.cpp (renamed from src/libstate/engine/asm_engine/asm_engine.cpp) | 33 | ||||
-rw-r--r-- | src/libstate/engine/ia32_eng/eng_ia32.h | 27 | ||||
-rw-r--r-- | src/libstate/engine/ia32_eng/info.txt | 14 | ||||
-rw-r--r-- | src/libstate/engine/sse2_eng/eng_sse2.cpp | 25 | ||||
-rw-r--r-- | src/libstate/engine/sse2_eng/eng_sse2.h | 24 | ||||
-rw-r--r-- | src/libstate/engine/sse2_eng/info.txt | 15 |
11 files changed, 175 insertions, 63 deletions
diff --git a/src/libstate/engine/amd64_eng/eng_amd64.cpp b/src/libstate/engine/amd64_eng/eng_amd64.cpp new file mode 100644 index 000000000..bdc73fdd6 --- /dev/null +++ b/src/libstate/engine/amd64_eng/eng_amd64.cpp @@ -0,0 +1,25 @@ +/** +* AMD64 Assembly Implementation Engine +* (C) 1999-2008 Jack Lloyd +*/ + +#include <botan/eng_amd64.h> + +#if defined(BOTAN_HAS_SHA1_AMD64) + #include <botan/sha1_amd64.h> +#endif + +namespace Botan { + +HashFunction* AMD64_Assembler_Engine::find_hash(const SCAN_Name& request, + Algorithm_Factory&) const + { +#if defined(BOTAN_HAS_SHA1_AMD64) + if(request.algo_name() == "SHA-160") + return new SHA_160_AMD64; +#endif + + return 0; + } + +} diff --git a/src/libstate/engine/amd64_eng/eng_amd64.h b/src/libstate/engine/amd64_eng/eng_amd64.h new file mode 100644 index 000000000..efd8c2b76 --- /dev/null +++ b/src/libstate/engine/amd64_eng/eng_amd64.h @@ -0,0 +1,24 @@ +/** +* x86-64 Assembly Implementation Engines +* (C) 1999-2008 Jack Lloyd +*/ + +#ifndef BOTAN_AMD64_ASM_ENGINE_H__ +#define BOTAN_AMD64_ASM_ENGINE_H__ + +#include <botan/engine.h> + +namespace Botan { + +class BOTAN_DLL AMD64_Assembler_Engine : public Engine + { + public: + std::string provider_name() const { return "amd64"; } + private: + HashFunction* find_hash(const SCAN_Name& reqeust, + Algorithm_Factory&) const; + }; + +} + +#endif diff --git a/src/libstate/engine/amd64_eng/info.txt b/src/libstate/engine/amd64_eng/info.txt new file mode 100644 index 000000000..1d0283ad6 --- /dev/null +++ b/src/libstate/engine/amd64_eng/info.txt @@ -0,0 +1,14 @@ +realname "AMD64 Assembler Engine" + +define ENGINE_AMD64_ASSEMBLER + +load_on auto + +<add> +eng_amd64.cpp +eng_amd64.h +</add> + +<arch> +amd64 +</arch> diff --git a/src/libstate/engine/asm_engine/asm_engine.h b/src/libstate/engine/asm_engine/asm_engine.h deleted file mode 100644 index 6a4188617..000000000 --- a/src/libstate/engine/asm_engine/asm_engine.h +++ /dev/null @@ -1,27 +0,0 @@ -/************************************************* -* Assembly Implementation Engine Header File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ - -#ifndef BOTAN_ASM_ENGINE_H__ -#define BOTAN_ASM_ENGINE_H__ - -#include <botan/engine.h> - -namespace Botan { - -class BOTAN_DLL Assembler_Engine : public Engine - { - public: - std::string provider_name() const { return "asm"; } - private: - BlockCipher* find_block_cipher(const SCAN_Name&, - Algorithm_Factory&) const; - - HashFunction* find_hash(const SCAN_Name& reqeust, - Algorithm_Factory&) const; - }; - -} - -#endif diff --git a/src/libstate/engine/asm_engine/info.txt b/src/libstate/engine/asm_engine/info.txt deleted file mode 100644 index 406b07412..000000000 --- a/src/libstate/engine/asm_engine/info.txt +++ /dev/null @@ -1,10 +0,0 @@ -realname "Assembler Engine" - -define ENGINE_ASSEMBLER - -load_on auto - -<add> -asm_engine.cpp -asm_engine.h -</add> diff --git a/src/libstate/engine/asm_engine/asm_engine.cpp b/src/libstate/engine/ia32_eng/eng_ia32.cpp index 9f113b1ce..0378c094e 100644 --- a/src/libstate/engine/asm_engine/asm_engine.cpp +++ b/src/libstate/engine/ia32_eng/eng_ia32.cpp @@ -3,8 +3,7 @@ * (C) 1999-2007 Jack Lloyd * *************************************************/ -#include <botan/asm_engine.h> -#include <botan/hash.h> +#include <botan/eng_ia32.h> #if defined(BOTAN_HAS_SERPENT_IA32) #include <botan/serp_ia32.h> @@ -22,19 +21,11 @@ #include <botan/sha1_ia32.h> #endif -#if defined(BOTAN_HAS_SHA1_SSE2) - #include <botan/sha1_sse2.h> -#endif - -#if defined(BOTAN_HAS_SHA1_AMD64) - #include <botan/sha1_amd64.h> -#endif - namespace Botan { BlockCipher* -Assembler_Engine::find_block_cipher(const SCAN_Name& request, - Algorithm_Factory&) const +IA32_Assembler_Engine::find_block_cipher(const SCAN_Name& request, + Algorithm_Factory&) const { #if defined(BOTAN_HAS_SERPENT_IA32) if(request.algo_name() == "Serpent") @@ -44,8 +35,9 @@ Assembler_Engine::find_block_cipher(const SCAN_Name& request, return 0; } -HashFunction* Assembler_Engine::find_hash(const SCAN_Name& request, - Algorithm_Factory&) const +HashFunction* +IA32_Assembler_Engine::find_hash(const SCAN_Name& request, + Algorithm_Factory&) const { #if defined(BOTAN_HAS_MD4_IA32) if(request.algo_name() == "MD4") @@ -57,21 +49,10 @@ HashFunction* Assembler_Engine::find_hash(const SCAN_Name& request, return new MD5_IA32; #endif -#if defined(BOTAN_HAS_SHA1_SSE2) || \ - defined(BOTAN_HAS_SHA1_AMD64) || \ - defined(BOTAN_HAS_SHA1_IA32) - +#if defined(BOTAN_HAS_SHA1_IA32) if(request.algo_name() == "SHA-160") - { -#if defined(BOTAN_HAS_SHA1_SSE2) - return new SHA_160_SSE2; -#elif defined(BOTAN_HAS_SHA1_AMD64) - return new SHA_160_AMD64; -#elif defined(BOTAN_HAS_SHA1_IA32) return new SHA_160_IA32; #endif - } -#endif return 0; } diff --git a/src/libstate/engine/ia32_eng/eng_ia32.h b/src/libstate/engine/ia32_eng/eng_ia32.h new file mode 100644 index 000000000..587728f2f --- /dev/null +++ b/src/libstate/engine/ia32_eng/eng_ia32.h @@ -0,0 +1,27 @@ +/** +* IA-32 Assembly Implementation Engines +* (C) 1999-2008 Jack Lloyd +*/ + +#ifndef BOTAN_IA32_ASM_ENGINE_H__ +#define BOTAN_IA32_ASM_ENGINE_H__ + +#include <botan/engine.h> + +namespace Botan { + +class BOTAN_DLL IA32_Assembler_Engine : public Engine + { + public: + std::string provider_name() const { return "ia32"; } + private: + BlockCipher* find_block_cipher(const SCAN_Name&, + Algorithm_Factory&) const; + + HashFunction* find_hash(const SCAN_Name& reqeust, + Algorithm_Factory&) const; + }; + +} + +#endif diff --git a/src/libstate/engine/ia32_eng/info.txt b/src/libstate/engine/ia32_eng/info.txt new file mode 100644 index 000000000..b9e3bddd5 --- /dev/null +++ b/src/libstate/engine/ia32_eng/info.txt @@ -0,0 +1,14 @@ +realname "IA32 Assembler Engine" + +define ENGINE_IA32_ASSEMBLER + +load_on auto + +<add> +eng_ia32.cpp +eng_ia32.h +</add> + +<arch> +ia32 +</arch> diff --git a/src/libstate/engine/sse2_eng/eng_sse2.cpp b/src/libstate/engine/sse2_eng/eng_sse2.cpp new file mode 100644 index 000000000..cf5a65114 --- /dev/null +++ b/src/libstate/engine/sse2_eng/eng_sse2.cpp @@ -0,0 +1,25 @@ +/** +* SSE2 Assembly Engine +* (C) 1999-2008 Jack Lloyd +*/ + +#include <botan/eng_sse2.h> + +#if defined(BOTAN_HAS_SHA1_SSE2) + #include <botan/sha1_sse2.h> +#endif + +namespace Botan { + +HashFunction* SSE2_Assembler_Engine::find_hash(const SCAN_Name& request, + Algorithm_Factory&) const + { +#if defined(BOTAN_HAS_SHA1_SSE2) + if(request.algo_name() == "SHA-160") + return new SHA_160_SSE2; +#endif + + return 0; + } + +} diff --git a/src/libstate/engine/sse2_eng/eng_sse2.h b/src/libstate/engine/sse2_eng/eng_sse2.h new file mode 100644 index 000000000..affbaff2e --- /dev/null +++ b/src/libstate/engine/sse2_eng/eng_sse2.h @@ -0,0 +1,24 @@ +/** +* SSE2 Assembly Engine +* (C) 1999-2008 Jack Lloyd +*/ + +#ifndef BOTAN_SSE2_ASM_ENGINE_H__ +#define BOTAN_SSE2_ASM_ENGINE_H__ + +#include <botan/engine.h> + +namespace Botan { + +class BOTAN_DLL SSE2_Assembler_Engine : public Engine + { + public: + std::string provider_name() const { return "sse2"; } + private: + HashFunction* find_hash(const SCAN_Name& reqeust, + Algorithm_Factory&) const; + }; + +} + +#endif diff --git a/src/libstate/engine/sse2_eng/info.txt b/src/libstate/engine/sse2_eng/info.txt new file mode 100644 index 000000000..c44180ca4 --- /dev/null +++ b/src/libstate/engine/sse2_eng/info.txt @@ -0,0 +1,15 @@ +realname "SSE2 Assembler Engine" + +define ENGINE_SSE2_ASSEMBLER + +load_on auto + +<add> +eng_sse2.cpp +eng_sse2.h +</add> + +<arch> +ia32 +amd64 +</arch> |