Botan  1.10.9
aes_isa_engine.cpp
Go to the documentation of this file.
1 /*
2 * Engine for AES instructions
3 * (C) 2009 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
6 */
7 
8 #include <botan/internal/aes_isa_engine.h>
9 #include <botan/cpuid.h>
10 
11 #if defined(BOTAN_HAS_AES_NI)
12  #include <botan/aes_ni.h>
13 #endif
14 
15 namespace Botan {
16 
17 BlockCipher*
19  Algorithm_Factory&) const
20  {
21 #if defined(BOTAN_HAS_AES_NI)
22  if(CPUID::has_aes_ni())
23  {
24  if(request.algo_name() == "AES-128")
25  return new AES_128_NI;
26  if(request.algo_name() == "AES-192")
27  return new AES_192_NI;
28  if(request.algo_name() == "AES-256")
29  return new AES_256_NI;
30  }
31 #endif
32 
33  return 0;
34  }
35 
36 }
std::string algo_name() const
Definition: scan_name.h:37
BlockCipher * find_block_cipher(const SCAN_Name &, Algorithm_Factory &) const
static bool has_aes_ni()
Definition: cpuid.h:70