diff options
author | lloyd <[email protected]> | 2010-06-16 03:16:47 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-06-16 03:16:47 +0000 |
commit | a2b1e1b197cb6f722cc41c6c960d673aec726adf (patch) | |
tree | 173c99dfb21f1dabaadec1c4639ee3144a60cc54 /src/engine/engine.h | |
parent | ecb574d32f4382326e94ad19e9d5baecc84a3c29 (diff) |
Move the implemention of the functions in the Engine base class into a
source file. Otherwise we ran into a conflict between Doxygen
comments, which require us to name the params, and GCC's
-Wunused-parameters, which will warn about parameters which aren't
being used.
Diffstat (limited to 'src/engine/engine.h')
-rw-r--r-- | src/engine/engine.h | 48 |
1 files changed, 15 insertions, 33 deletions
diff --git a/src/engine/engine.h b/src/engine/engine.h index 6e8133692..c9bcd6126 100644 --- a/src/engine/engine.h +++ b/src/engine/engine.h @@ -27,7 +27,10 @@ class Algorithm_Factory; class Keyed_Filter; /** -* Engine Base Class +* Base class for all engines. All non-pure virtual functions simply +* return NULL, indicating the algorithm in question is not +* supported. Subclasses can reimplement whichever function(s) +* they want to hook in a particular type. */ class BOTAN_DLL Engine { @@ -46,8 +49,7 @@ class BOTAN_DLL Engine */ virtual BlockCipher* find_block_cipher(const SCAN_Name& algo_spec, - Algorithm_Factory& af) const - { return 0; } + Algorithm_Factory& af) const; /** * @param algo_spec the algorithm name/specification @@ -56,8 +58,7 @@ class BOTAN_DLL Engine */ virtual StreamCipher* find_stream_cipher(const SCAN_Name& algo_spec, - Algorithm_Factory& af) const - { return 0; } + Algorithm_Factory& af) const; /** * @param algo_spec the algorithm name/specification @@ -66,8 +67,7 @@ class BOTAN_DLL Engine */ virtual HashFunction* find_hash(const SCAN_Name& algo_spec, - Algorithm_Factory& af) const - { return 0; } + Algorithm_Factory& af) const; /** * @param algo_spec the algorithm name/specification @@ -76,8 +76,7 @@ class BOTAN_DLL Engine */ virtual MessageAuthenticationCode* find_mac(const SCAN_Name& algo_spec, - Algorithm_Factory& af) const - { return 0; } + Algorithm_Factory& af) const; /** * @param n the modulus @@ -86,8 +85,7 @@ class BOTAN_DLL Engine */ virtual Modular_Exponentiator* mod_exp(const BigInt& n, - Power_Mod::Usage_Hints hints) const - { return 0; } + Power_Mod::Usage_Hints hints) const; /** * Return a new cipher object @@ -98,8 +96,7 @@ class BOTAN_DLL Engine */ virtual Keyed_Filter* get_cipher(const std::string& algo_spec, Cipher_Dir dir, - Algorithm_Factory& af) - { return 0; } + Algorithm_Factory& af); /** * Return a new operator object for this key, if possible @@ -107,10 +104,7 @@ class BOTAN_DLL Engine * @return newly allocated operator object, or NULL */ virtual PK_Ops::Key_Agreement* - get_key_agreement_op(const Private_Key& key) const - { - return 0; - } + get_key_agreement_op(const Private_Key& key) const; /** * Return a new operator object for this key, if possible @@ -118,10 +112,7 @@ class BOTAN_DLL Engine * @return newly allocated operator object, or NULL */ virtual PK_Ops::Signature* - get_signature_op(const Private_Key& key) const - { - return 0; - } + get_signature_op(const Private_Key& key) const; /** * Return a new operator object for this key, if possible @@ -129,10 +120,7 @@ class BOTAN_DLL Engine * @return newly allocated operator object, or NULL */ virtual PK_Ops::Verification* - get_verify_op(const Public_Key& key) const - { - return 0; - } + get_verify_op(const Public_Key& key) const; /** * Return a new operator object for this key, if possible @@ -140,10 +128,7 @@ class BOTAN_DLL Engine * @return newly allocated operator object, or NULL */ virtual PK_Ops::Encryption* - get_encryption_op(const Public_Key& key) const - { - return 0; - } + get_encryption_op(const Public_Key& key) const; /** * Return a new operator object for this key, if possible @@ -151,10 +136,7 @@ class BOTAN_DLL Engine * @return newly allocated operator object, or NULL */ virtual PK_Ops::Decryption* - get_decryption_op(const Private_Key& key) const - { - return 0; - } + get_decryption_op(const Private_Key& key) const; }; } |