aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/block
diff options
context:
space:
mode:
authorlloyd <[email protected]>2015-01-28 06:20:39 +0000
committerlloyd <[email protected]>2015-01-28 06:20:39 +0000
commit710229be83cdbc061949c61942896b5af9e134d8 (patch)
tree5a28c6d2cd456a5a686a332b7466ed9f326cc5f8 /src/lib/block
parent7b56f1bd570dc684ffd7c945dee0d9b5480354ff (diff)
Use Algo_Registry also for hashes.
Diffstat (limited to 'src/lib/block')
-rw-r--r--src/lib/block/cascade/cascade.cpp9
-rw-r--r--src/lib/block/cascade/cascade.h2
-rw-r--r--src/lib/block/serpent_x86_32/serp_x86_32.cpp2
3 files changed, 5 insertions, 8 deletions
diff --git a/src/lib/block/cascade/cascade.cpp b/src/lib/block/cascade/cascade.cpp
index 6c0458265..c80bfbc68 100644
--- a/src/lib/block/cascade/cascade.cpp
+++ b/src/lib/block/cascade/cascade.cpp
@@ -6,14 +6,13 @@
*/
#include <botan/internal/block_utils.h>
-#include <botan/algo_registry.h>
#include <botan/cascade.h>
namespace Botan {
-namespace {
+BOTAN_REGISTER_NAMED_T(BlockCipher, "Cascade", Cascade_Cipher, Cascade_Cipher::make);
-Cascade_Cipher* make_cascade(const BlockCipher::Spec& spec)
+Cascade_Cipher* Cascade_Cipher::make(const BlockCipher::Spec& spec)
{
auto& block_cipher = Algo_Registry<BlockCipher>::global_registry();
std::unique_ptr<BlockCipher> c1(block_cipher.make(spec.arg(0)));
@@ -24,10 +23,6 @@ Cascade_Cipher* make_cascade(const BlockCipher::Spec& spec)
return nullptr;
}
-}
-
-BOTAN_REGISTER_NAMED_T(BlockCipher, "Cascade", Cascade_Cipher, make_cascade);
-
void Cascade_Cipher::encrypt_n(const byte in[], byte out[],
size_t blocks) const
{
diff --git a/src/lib/block/cascade/cascade.h b/src/lib/block/cascade/cascade.h
index 440f5c8f4..e96c34549 100644
--- a/src/lib/block/cascade/cascade.h
+++ b/src/lib/block/cascade/cascade.h
@@ -33,6 +33,8 @@ class BOTAN_DLL Cascade_Cipher : public BlockCipher
std::string name() const;
BlockCipher* clone() const;
+ static Cascade_Cipher* make(const Spec& spec);
+
/**
* Create a cascade of two block ciphers
* @param cipher1 the first cipher
diff --git a/src/lib/block/serpent_x86_32/serp_x86_32.cpp b/src/lib/block/serpent_x86_32/serp_x86_32.cpp
index 3c326d084..7e52a5118 100644
--- a/src/lib/block/serpent_x86_32/serp_x86_32.cpp
+++ b/src/lib/block/serpent_x86_32/serp_x86_32.cpp
@@ -10,7 +10,7 @@
namespace Botan {
-BOTAN_REGISTER_BLOCK_CIPHER_NOARGS(Serpent_X86_32, "Serpent", "x86-32");
+BOTAN_REGISTER_NAMED_T_NOARGS(BlockCipher, Serpent_X86_32, "Serpent", "x86-32");
extern "C" {