Botan: Botan::SIMD_Engine Class Reference

Botan 1.10.16

Public Member Functions | List of all members
Botan::SIMD_Engine Class Reference

`#include <simd_engine.h>`

Inheritance diagram for Botan::SIMD_Engine:

## Public Member Functions
BlockCipher * | find_block_cipher (const SCAN_Name &, Algorithm_Factory &) const
HashFunction * | find_hash (const SCAN_Name &request, Algorithm_Factory &) const
virtual MessageAuthenticationCode * | find_mac (const SCAN_Name &algo_spec, Algorithm_Factory &af) const
virtual PBKDF * | find_pbkdf (const SCAN_Name &algo_spec, Algorithm_Factory &af) const
virtual StreamCipher * | find_stream_cipher (const SCAN_Name &algo_spec, Algorithm_Factory &af) const
virtual Keyed_Filter * | get_cipher (const std::string &algo_spec, Cipher_Dir dir, Algorithm_Factory &af)
virtual PK_Ops::Decryption * | get_decryption_op (const Private_Key &key) const
virtual PK_Ops::Encryption * | get_encryption_op (const Public_Key &key) const
virtual PK_Ops::Key_Agreement * | get_key_agreement_op (const Private_Key &key) const
virtual PK_Ops::Signature * | get_signature_op (const Private_Key &key) const
virtual PK_Ops::Verification * | get_verify_op (const Public_Key &key) const
virtual Modular_Exponentiator * | mod_exp (const BigInt &n, Power_Mod::Usage_Hints hints) const
std::string | provider_name () const

## Detailed Description

Engine for implementations that use some kind of SIMD

Definition at line 18 of file simd_engine.h.

## Member Function Documentation

## ◆ find_block_cipher()

BlockCipher * Botan::SIMD_Engine::find_block_cipher | ( | const SCAN_Name & | algo_spec,
|  | Algorithm_Factory & | af
| ) |  | const
| virtual

Parameters

  algo_spec | the algorithm name/specification
  af | an algorithm factory object

Returns
  newly allocated object, or NULL

Reimplemented from Botan::Engine.

Definition at line 39 of file simd_engine.cpp.

References Botan::SCAN_Name::algo_name(), Botan::CPUID::has_sse2(), and Botan::CPUID::has_ssse3().

Referenced by provider_name().

41 {
42 #if defined(BOTAN_HAS_AES_SSSE3)
43 if(request.algo_name() == "AES-128" && CPUID::has_ssse3())
44 return new AES_128_SSSE3;
45 if(request.algo_name() == "AES-192" && CPUID::has_ssse3())
46 return new AES_192_SSSE3;
47 if(request.algo_name() == "AES-256" && CPUID::has_ssse3())
48 return new AES_256_SSSE3;
49 #endif
50
51 #if defined(BOTAN_HAS_IDEA_SSE2)
52 if(request.algo_name() == "IDEA" && CPUID::has_sse2())
53 return new IDEA_SSE2;
54 #endif
55
56 #if defined(BOTAN_HAS_NOEKEON_SIMD)
57 if(request.algo_name() == "Noekeon" && SIMD_32::enabled())
58 return new Noekeon_SIMD;
59 #endif
60
61 #if defined(BOTAN_HAS_SERPENT_SIMD)
62 if(request.algo_name() == "Serpent" && SIMD_32::enabled())
63 return new Serpent_SIMD;
64 #endif
65
66 #if defined(BOTAN_HAS_XTEA_SIMD)
67 if(request.algo_name() == "XTEA" && SIMD_32::enabled())
68 return new XTEA_SIMD;
69 #endif
70
71 return 0;
72 }
Botan::CPUID::has_ssse3
static bool has_ssse3()
Definition: cpuid.h:46
Botan::CPUID::has_sse2
static bool has_sse2()
Definition: cpuid.h:40

## ◆ find_hash()

HashFunction * Botan::SIMD_Engine::find_hash | ( | const SCAN_Name & | algo_spec,
|  | Algorithm_Factory & | af
| ) |  | const
| virtual

Parameters

  algo_spec | the algorithm name/specification
  af | an algorithm factory object

Returns
  newly allocated object, or NULL

Reimplemented from Botan::Engine.

Definition at line 75 of file simd_engine.cpp.

References Botan::SCAN_Name::algo_name(), and Botan::CPUID::has_sse2().

Referenced by provider_name().

77 {
78 #if defined(BOTAN_HAS_SHA1_SSE2)
79 if(request.algo_name() == "SHA-160" && CPUID::has_sse2())
80 return new SHA_160_SSE2;
81 #endif
82
83 return 0;
84 }
Botan::CPUID::has_sse2
static bool has_sse2()
Definition: cpuid.h:40

## ◆ find_mac()

MessageAuthenticationCode * Botan::Engine::find_mac | ( | const SCAN_Name & | algo_spec,
|  | Algorithm_Factory & | af
| ) |  | const
| virtualinherited

Parameters

  algo_spec | the algorithm name/specification
  af | an algorithm factory object

Returns
  newly allocated object, or NULL

Reimplemented in Botan::Core_Engine, and Botan::Dynamically_Loaded_Engine.

Definition at line 34 of file engine.cpp.

36 {
37 return 0;
38 }

## ◆ find_pbkdf()

PBKDF * Botan::Engine::find_pbkdf | ( | const SCAN_Name & | algo_spec,
|  | Algorithm_Factory & | af
| ) |  | const
| virtualinherited

Parameters

  algo_spec | the algorithm name/specification
  af | an algorithm factory object

Returns
  newly allocated object, or NULL

Reimplemented in Botan::Dynamically_Loaded_Engine, and Botan::Core_Engine.

Definition at line 41 of file engine.cpp.

43 {
44 return 0;
45 }

## ◆ find_stream_cipher()

StreamCipher * Botan::Engine::find_stream_cipher | ( | const SCAN_Name & | algo_spec,
|  | Algorithm_Factory & | af
| ) |  | const
| virtualinherited

Parameters

  algo_spec | the algorithm name/specification
  af | an algorithm factory object

Returns
  newly allocated object, or NULL

Reimplemented in Botan::Core_Engine, Botan::OpenSSL_Engine, and Botan::Dynamically_Loaded_Engine.

Definition at line 20 of file engine.cpp.

22 {
23 return 0;
24 }

## ◆ get_cipher()

Keyed_Filter * Botan::Engine::get_cipher | ( | const std::string & | algo_spec,
|  | Cipher_Dir | dir,
|  | Algorithm_Factory & | af
| ) |  |
| virtualinherited

Return a new cipher object

Parameters

  algo_spec | the algorithm name/specification
  dir | specifies if encryption or decryption is desired
  af | an algorithm factory object

Returns
  newly allocated object, or NULL

Reimplemented in Botan::Dynamically_Loaded_Engine, and Botan::Core_Engine.

Definition at line 54 of file engine.cpp.

57 {
58 return 0;
59 }

## ◆ get_decryption_op()

PK_Ops::Decryption * Botan::Engine::get_decryption_op | ( | const Private_Key & | key | ) | const
| virtualinherited

Return a new operator object for this key, if possible

Parameters

  key | the key we want an operator for

Returns
  newly allocated operator object, or NULL

Reimplemented in Botan::Dynamically_Loaded_Engine, Botan::GMP_Engine, Botan::OpenSSL_Engine, and Botan::Core_Engine.

Definition at line 86 of file engine.cpp.

87 {
88 return 0;
89 }

## ◆ get_encryption_op()

PK_Ops::Encryption * Botan::Engine::get_encryption_op | ( | const Public_Key & | key | ) | const
| virtualinherited

Return a new operator object for this key, if possible

Parameters

  key | the key we want an operator for

Returns
  newly allocated operator object, or NULL

Reimplemented in Botan::Dynamically_Loaded_Engine, Botan::GMP_Engine, Botan::OpenSSL_Engine, and Botan::Core_Engine.

Definition at line 80 of file engine.cpp.

81 {
82 return 0;
83 }

## ◆ get_key_agreement_op()

PK_Ops::Key_Agreement * Botan::Engine::get_key_agreement_op | ( | const Private_Key & | key | ) | const
| virtualinherited

Return a new operator object for this key, if possible

Parameters

  key | the key we want an operator for

Returns
  newly allocated operator object, or NULL

Reimplemented in Botan::Dynamically_Loaded_Engine, Botan::GMP_Engine, Botan::OpenSSL_Engine, and Botan::Core_Engine.

Definition at line 62 of file engine.cpp.

63 {
64 return 0;
65 }

## ◆ get_signature_op()

PK_Ops::Signature * Botan::Engine::get_signature_op | ( | const Private_Key & | key | ) | const
| virtualinherited

Return a new operator object for this key, if possible

Parameters

  key | the key we want an operator for

Returns
  newly allocated operator object, or NULL

Reimplemented in Botan::Dynamically_Loaded_Engine, Botan::GMP_Engine, Botan::OpenSSL_Engine, and Botan::Core_Engine.

Definition at line 68 of file engine.cpp.

69 {
70 return 0;
71 }

## ◆ get_verify_op()

PK_Ops::Verification * Botan::Engine::get_verify_op | ( | const Public_Key & | key | ) | const
| virtualinherited

Return a new operator object for this key, if possible

Parameters

  key | the key we want an operator for

Returns
  newly allocated operator object, or NULL

Reimplemented in Botan::Dynamically_Loaded_Engine, Botan::GMP_Engine, Botan::OpenSSL_Engine, and Botan::Core_Engine.

Definition at line 74 of file engine.cpp.

75 {
76 return 0;
77 }

## ◆ mod_exp()

Modular_Exponentiator * Botan::Engine::mod_exp | ( | const BigInt & | n,
|  | Power_Mod::Usage_Hints | hints
| ) |  | const
| virtualinherited

Parameters

  n | the modulus
  hints | any use hints

Returns
  newly allocated object, or NULL

Reimplemented in Botan::Dynamically_Loaded_Engine, Botan::GMP_Engine, Botan::OpenSSL_Engine, and Botan::Core_Engine.

Definition at line 48 of file engine.cpp.

50 {
51 return 0;
52 }

## ◆ provider_name()

std::string Botan::SIMD_Engine::provider_name | ( |  | ) | const
| inlinevirtual

Returns
  name of this engine

Implements Botan::Engine.

Definition at line 21 of file simd_engine.h.

References find_block_cipher(), and find_hash().

21 { return "simd"; }

The documentation for this class was generated from the following files:

- src/engine/simd_engine/simd_engine.h
- src/engine/simd_engine/simd_engine.cpp