Botan: src/engine/asm_engine/asm_engine.cpp Source File

Botan 1.10.16

asm_engine.cpp
Go to the documentation of this file.
1 /*
2 * Assembly Implementation Engine
3 * (C) 1999-2010 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
6 */
7
8 #include <botan/internal/asm_engine.h>
9
10 #if defined(BOTAN_HAS_SERPENT_X86_32)
11 #include <botan/serp_x86_32.h>
12 #endif
13
14 #if defined(BOTAN_HAS_MD4_X86_32)
15 #include <botan/md4_x86_32.h>
16 #endif
17
18 #if defined(BOTAN_HAS_MD5_X86_32)
19 #include <botan/md5_x86_32.h>
20 #endif
21
22 #if defined(BOTAN_HAS_SHA1_X86_64)
23 #include <botan/sha1_x86_64.h>
24 #endif
25
26 #if defined(BOTAN_HAS_SHA1_X86_32)
27 #include <botan/sha1_x86_32.h>
28 #endif
29
30 namespace Botan {
31
32 BlockCipher*
33 Assembler_Engine::find_block_cipher(const SCAN_Name& request,
34 Algorithm_Factory&) const
35 {
36 if(request.algo_name() == "Serpent")
37 {
38 #if defined(BOTAN_HAS_SERPENT_X86_32)
39 return new Serpent_X86_32;
40 #endif
41 }
42
43 return 0;
44 }
45
46 HashFunction*
47 Assembler_Engine::find_hash(const SCAN_Name& request,
48 Algorithm_Factory&) const
49 {
50 #if defined(BOTAN_HAS_MD4_X86_32)
51 if(request.algo_name() == "MD4")
52 return new MD4_X86_32;
53 #endif
54
55 #if defined(BOTAN_HAS_MD5_X86_32)
56 if(request.algo_name() == "MD5")
57 return new MD5_X86_32;
58 #endif
59
60 if(request.algo_name() == "SHA-160")
61 {
62 #if defined(BOTAN_HAS_SHA1_X86_64)
63 return new SHA_160_X86_64;
64 #elif defined(BOTAN_HAS_SHA1_X86_32)
65 return new SHA_160_X86_32;
66 #endif
67 }
68
69 return 0;
70 }
71
72 }
Botan::Algorithm_Factory
Definition: algo_factory.h:34
Botan::Assembler_Engine::find_block_cipher
BlockCipher * find_block_cipher(const SCAN_Name &, Algorithm_Factory &) const
Definition: asm_engine.cpp:33
Botan::MD5_X86_32
Definition: md5_x86_32.h:18
Botan::Serpent_X86_32
Definition: serp_x86_32.h:18
Botan::Assembler_Engine::find_hash
HashFunction * find_hash(const SCAN_Name &request, Algorithm_Factory &) const
Definition: asm_engine.cpp:47
Botan::SHA_160_X86_64
Definition: sha1_x86_64.h:18
Botan
Definition: algo_base.h:14
Botan::SHA_160_X86_32
Definition: sha1_x86_32.h:18
Botan::SCAN_Name
Definition: scan_name.h:21
Botan::HashFunction
Definition: hash.h:20
Botan::MD4_X86_32
Definition: md4_x86_32.h:18
Botan::SCAN_Name::algo_name
std::string algo_name() const
Definition: scan_name.h:37