aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/hash
diff options
context:
space:
mode:
authorlloyd <[email protected]>2015-02-04 04:03:38 +0000
committerlloyd <[email protected]>2015-02-04 04:03:38 +0000
commit0dd060fed07b0060f94e3bae62e125a85c1bb877 (patch)
treeed4bc7a961e2b30f17ed5e80769c84b0c313c8b7 /src/lib/hash
parentf9a7c85b74be0f4a7273e8e0591703af83036e81 (diff)
Remove algo factory, engines, global RNG, global state, etc.
Convert all uses of Algorithm_Factory and the engines to using Algo_Registry The shared pool of entropy sources remains but is moved to EntropySource. With that and few remaining initializations (default OIDs and aliases) moved elsewhere, the global state is empty and init and shutdown are no-ops. Remove almost all of the headers and code for handling the global state, except LibraryInitializer which remains as a compatability stub. Update seeding for blinding so only one hacky almost-global RNG instance needs to be setup instead of across all pubkey uses (it uses either the system RNG or an AutoSeeded_RNG if the system RNG is not available).
Diffstat (limited to 'src/lib/hash')
-rw-r--r--src/lib/hash/hash_utils.h10
-rw-r--r--src/lib/hash/info.txt4
-rw-r--r--src/lib/hash/par_hash/par_hash.cpp2
-rw-r--r--src/lib/hash/sha1_sse2/info.txt1
-rw-r--r--src/lib/hash/sha1_sse2/sha1_sse2.cpp2
-rw-r--r--src/lib/hash/sha1_x86_64/info.txt1
6 files changed, 7 insertions, 13 deletions
diff --git a/src/lib/hash/hash_utils.h b/src/lib/hash/hash_utils.h
index 00eabe820..3286b0087 100644
--- a/src/lib/hash/hash_utils.h
+++ b/src/lib/hash/hash_utils.h
@@ -5,11 +5,11 @@
* Botan is released under the Simplified BSD License (see license.txt)
*/
-#ifndef BOTAN_HASH_UTIL_H__
-#define BOTAN_HASH_UTIL_H__
+#ifndef BOTAN_HASH_UTILS_H__
+#define BOTAN_HASH_UTILS_H__
#include <botan/hash.h>
-#include <botan/algo_registry.h>
+#include <botan/internal/algo_registry.h>
#include <botan/loadstor.h>
#include <botan/rotate.h>
@@ -25,8 +25,8 @@ namespace Botan {
#define BOTAN_REGISTER_HASH_NAMED_1LEN(type, name, def) \
BOTAN_REGISTER_NAMED_T(HashFunction, name, type, (make_new_T_1len<type,def>))
-#define BOTAN_REGISTER_HASH_NOARGS_IF(cond, type, name, provider) \
- BOTAN_COND_REGISTER_NAMED_T_NOARGS(cond, HashFunction, type, name, provider)
+#define BOTAN_REGISTER_HASH_NOARGS_IF(cond, type, name, provider, pref) \
+ BOTAN_COND_REGISTER_NAMED_T_NOARGS(cond, HashFunction, type, name, provider, pref)
}
diff --git a/src/lib/hash/info.txt b/src/lib/hash/info.txt
index 58ff1b99f..481b39b67 100644
--- a/src/lib/hash/info.txt
+++ b/src/lib/hash/info.txt
@@ -1,7 +1,3 @@
-<requires>
-algo_base
-</requires>
-
<header:internal>
hash_utils.h
</header:internal>
diff --git a/src/lib/hash/par_hash/par_hash.cpp b/src/lib/hash/par_hash/par_hash.cpp
index c58b01e72..d3c641a95 100644
--- a/src/lib/hash/par_hash/par_hash.cpp
+++ b/src/lib/hash/par_hash/par_hash.cpp
@@ -8,7 +8,7 @@
#include <botan/internal/hash_utils.h>
#include <botan/par_hash.h>
#include <botan/parsing.h>
-#include <botan/algo_registry.h>
+#include <botan/internal/algo_registry.h>
namespace Botan {
diff --git a/src/lib/hash/sha1_sse2/info.txt b/src/lib/hash/sha1_sse2/info.txt
index 8d4926e63..78f5540e7 100644
--- a/src/lib/hash/sha1_sse2/info.txt
+++ b/src/lib/hash/sha1_sse2/info.txt
@@ -4,5 +4,4 @@ need_isa sse2
<requires>
sha1
-simd_engine
</requires>
diff --git a/src/lib/hash/sha1_sse2/sha1_sse2.cpp b/src/lib/hash/sha1_sse2/sha1_sse2.cpp
index 13cd22eeb..1fc62d957 100644
--- a/src/lib/hash/sha1_sse2/sha1_sse2.cpp
+++ b/src/lib/hash/sha1_sse2/sha1_sse2.cpp
@@ -14,7 +14,7 @@
namespace Botan {
-BOTAN_REGISTER_HASH_NOARGS_IF(CPUID::has_sse2(), SHA_160_SSE2, "SHA-160", "sse2");
+BOTAN_REGISTER_HASH_NOARGS_IF(CPUID::has_sse2(), SHA_160_SSE2, "SHA-160", "sse2", 64);
namespace SHA1_SSE2_F {
diff --git a/src/lib/hash/sha1_x86_64/info.txt b/src/lib/hash/sha1_x86_64/info.txt
index 54d5eefff..db7cdcb92 100644
--- a/src/lib/hash/sha1_x86_64/info.txt
+++ b/src/lib/hash/sha1_x86_64/info.txt
@@ -7,7 +7,6 @@ x86_64
</arch>
<requires>
-asm_engine
asm_x86_64
sha1
</requires>