aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/block
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/block
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/block')
-rw-r--r--src/lib/block/aes_ni/aes_ni.cpp6
-rw-r--r--src/lib/block/aes_ni/info.txt4
-rw-r--r--src/lib/block/aes_ssse3/aes_ssse3.cpp6
-rw-r--r--src/lib/block/aes_ssse3/info.txt4
-rw-r--r--src/lib/block/block_utils.h10
-rw-r--r--src/lib/block/idea_sse2/idea_sse2.cpp2
-rw-r--r--src/lib/block/info.txt4
-rw-r--r--src/lib/block/noekeon_simd/info.txt1
-rw-r--r--src/lib/block/noekeon_simd/noekeon_simd.cpp2
-rw-r--r--src/lib/block/serpent_simd/info.txt1
-rw-r--r--src/lib/block/serpent_simd/serp_simd.cpp2
-rw-r--r--src/lib/block/threefish_avx2/threefish_avx2.cpp2
-rw-r--r--src/lib/block/xtea_simd/info.txt1
-rw-r--r--src/lib/block/xtea_simd/xtea_simd.cpp2
14 files changed, 16 insertions, 31 deletions
diff --git a/src/lib/block/aes_ni/aes_ni.cpp b/src/lib/block/aes_ni/aes_ni.cpp
index 256895148..96a629d06 100644
--- a/src/lib/block/aes_ni/aes_ni.cpp
+++ b/src/lib/block/aes_ni/aes_ni.cpp
@@ -12,9 +12,9 @@
namespace Botan {
-BOTAN_REGISTER_BLOCK_CIPHER_NOARGS_IF(CPUID::has_aes_ni(), AES_128_NI, "AES-128", "aes_ni");
-BOTAN_REGISTER_BLOCK_CIPHER_NOARGS_IF(CPUID::has_aes_ni(), AES_192_NI, "AES-192", "aes_ni");
-BOTAN_REGISTER_BLOCK_CIPHER_NOARGS_IF(CPUID::has_aes_ni(), AES_256_NI, "AES-256", "aes_ni");
+BOTAN_REGISTER_BLOCK_CIPHER_NOARGS_IF(CPUID::has_aes_ni(), AES_128_NI, "AES-128", "aes_ni", 16);
+BOTAN_REGISTER_BLOCK_CIPHER_NOARGS_IF(CPUID::has_aes_ni(), AES_192_NI, "AES-192", "aes_ni", 16);
+BOTAN_REGISTER_BLOCK_CIPHER_NOARGS_IF(CPUID::has_aes_ni(), AES_256_NI, "AES-256", "aes_ni", 16);
namespace {
diff --git a/src/lib/block/aes_ni/info.txt b/src/lib/block/aes_ni/info.txt
index 270b00d9d..11bf90390 100644
--- a/src/lib/block/aes_ni/info.txt
+++ b/src/lib/block/aes_ni/info.txt
@@ -3,7 +3,3 @@ define AES_NI 20131128
load_on auto
need_isa aesni
-
-<requires>
-aes_isa_eng
-</requires>
diff --git a/src/lib/block/aes_ssse3/aes_ssse3.cpp b/src/lib/block/aes_ssse3/aes_ssse3.cpp
index 6a8fb3ed8..b9731d010 100644
--- a/src/lib/block/aes_ssse3/aes_ssse3.cpp
+++ b/src/lib/block/aes_ssse3/aes_ssse3.cpp
@@ -17,9 +17,9 @@
namespace Botan {
-BOTAN_REGISTER_BLOCK_CIPHER_NOARGS_IF(CPUID::has_ssse3(), AES_128_SSSE3, "AES-128", "ssse3");
-BOTAN_REGISTER_BLOCK_CIPHER_NOARGS_IF(CPUID::has_ssse3(), AES_192_SSSE3, "AES-192", "ssse3");
-BOTAN_REGISTER_BLOCK_CIPHER_NOARGS_IF(CPUID::has_ssse3(), AES_256_SSSE3, "AES-256", "ssse3");
+BOTAN_REGISTER_BLOCK_CIPHER_NOARGS_IF(CPUID::has_ssse3(), AES_128_SSSE3, "AES-128", "ssse3", 64);
+BOTAN_REGISTER_BLOCK_CIPHER_NOARGS_IF(CPUID::has_ssse3(), AES_192_SSSE3, "AES-192", "ssse3", 64);
+BOTAN_REGISTER_BLOCK_CIPHER_NOARGS_IF(CPUID::has_ssse3(), AES_256_SSSE3, "AES-256", "ssse3", 64);
namespace {
diff --git a/src/lib/block/aes_ssse3/info.txt b/src/lib/block/aes_ssse3/info.txt
index 4b1aec535..9e27801e6 100644
--- a/src/lib/block/aes_ssse3/info.txt
+++ b/src/lib/block/aes_ssse3/info.txt
@@ -4,10 +4,6 @@ load_on auto
need_isa ssse3
-<requires>
-simd_engine
-</requires>
-
# Intel C++ can't deal with syntax for defining constants :(
<cc>
gcc
diff --git a/src/lib/block/block_utils.h b/src/lib/block/block_utils.h
index c1a1e34f8..ebf6354e0 100644
--- a/src/lib/block/block_utils.h
+++ b/src/lib/block/block_utils.h
@@ -5,10 +5,10 @@
* Botan is released under the Simplified BSD License (see license.txt)
*/
-#ifndef BOTAN_BLOCK_CIPHER_UTIL_H__
-#define BOTAN_BLOCK_CIPHER_UTIL_H__
+#ifndef BOTAN_BLOCK_CIPHER_UTILS_H__
+#define BOTAN_BLOCK_CIPHER_UTILS_H__
-#include <botan/algo_registry.h>
+#include <botan/internal/algo_registry.h>
#include <botan/loadstor.h>
#include <botan/rotate.h>
#include <botan/internal/xor_buf.h>
@@ -28,8 +28,8 @@ namespace Botan {
#define BOTAN_REGISTER_BLOCK_CIPHER_NAMED_1STR(type, name, def) \
BOTAN_REGISTER_NAMED_T(BlockCipher, name, type, std::bind(make_new_T_1str<type>, std::placeholders::_1, def));
-#define BOTAN_REGISTER_BLOCK_CIPHER_NOARGS_IF(cond, type, name, provider) \
- BOTAN_COND_REGISTER_NAMED_T_NOARGS(cond, BlockCipher, type, name, provider)
+#define BOTAN_REGISTER_BLOCK_CIPHER_NOARGS_IF(cond, type, name, provider, pref) \
+ BOTAN_COND_REGISTER_NAMED_T_NOARGS(cond, BlockCipher, type, name, provider, pref)
}
diff --git a/src/lib/block/idea_sse2/idea_sse2.cpp b/src/lib/block/idea_sse2/idea_sse2.cpp
index 3dfd26860..af7e2182d 100644
--- a/src/lib/block/idea_sse2/idea_sse2.cpp
+++ b/src/lib/block/idea_sse2/idea_sse2.cpp
@@ -12,7 +12,7 @@
namespace Botan {
-BOTAN_REGISTER_BLOCK_CIPHER_NOARGS_IF(CPUID::has_sse2(), IDEA_SSE2, "IDEA", "sse2");
+BOTAN_REGISTER_BLOCK_CIPHER_NOARGS_IF(CPUID::has_sse2(), IDEA_SSE2, "IDEA", "sse2", 64);
namespace {
diff --git a/src/lib/block/info.txt b/src/lib/block/info.txt
index f10acaa86..e1aa52d85 100644
--- a/src/lib/block/info.txt
+++ b/src/lib/block/info.txt
@@ -1,9 +1,5 @@
define BLOCK_CIPHER 20131128
-<requires>
-algo_base
-</requires>
-
<header:public>
block_cipher.h
</header:public>
diff --git a/src/lib/block/noekeon_simd/info.txt b/src/lib/block/noekeon_simd/info.txt
index 78b9d5f12..3b92eb206 100644
--- a/src/lib/block/noekeon_simd/info.txt
+++ b/src/lib/block/noekeon_simd/info.txt
@@ -3,5 +3,4 @@ define NOEKEON_SIMD 20131128
<requires>
noekeon
simd
-simd_engine
</requires>
diff --git a/src/lib/block/noekeon_simd/noekeon_simd.cpp b/src/lib/block/noekeon_simd/noekeon_simd.cpp
index d5995ee1d..a5d757d3c 100644
--- a/src/lib/block/noekeon_simd/noekeon_simd.cpp
+++ b/src/lib/block/noekeon_simd/noekeon_simd.cpp
@@ -11,7 +11,7 @@
namespace Botan {
-BOTAN_REGISTER_BLOCK_CIPHER_NOARGS_IF(SIMD_32::enabled(), Noekeon_SIMD, "Noekeon", "simd32");
+BOTAN_REGISTER_BLOCK_CIPHER_NOARGS_IF(SIMD_32::enabled(), Noekeon_SIMD, "Noekeon", "simd32", 64);
/*
* Noekeon's Theta Operation
diff --git a/src/lib/block/serpent_simd/info.txt b/src/lib/block/serpent_simd/info.txt
index f33548823..acb0b76d8 100644
--- a/src/lib/block/serpent_simd/info.txt
+++ b/src/lib/block/serpent_simd/info.txt
@@ -3,7 +3,6 @@ define SERPENT_SIMD 20131128
<requires>
serpent
simd
-simd_engine
</requires>
<source>
diff --git a/src/lib/block/serpent_simd/serp_simd.cpp b/src/lib/block/serpent_simd/serp_simd.cpp
index fa7f419fe..7b957598f 100644
--- a/src/lib/block/serpent_simd/serp_simd.cpp
+++ b/src/lib/block/serpent_simd/serp_simd.cpp
@@ -12,7 +12,7 @@
namespace Botan {
-BOTAN_REGISTER_BLOCK_CIPHER_NOARGS_IF(SIMD_32::enabled(), Serpent_SIMD, "Serpent", "simd32");
+BOTAN_REGISTER_BLOCK_CIPHER_NOARGS_IF(SIMD_32::enabled(), Serpent_SIMD, "Serpent", "simd32", 64);
namespace {
diff --git a/src/lib/block/threefish_avx2/threefish_avx2.cpp b/src/lib/block/threefish_avx2/threefish_avx2.cpp
index 432059585..e17146162 100644
--- a/src/lib/block/threefish_avx2/threefish_avx2.cpp
+++ b/src/lib/block/threefish_avx2/threefish_avx2.cpp
@@ -12,7 +12,7 @@
namespace Botan {
-BOTAN_REGISTER_BLOCK_CIPHER_NOARGS_IF(CPUID::has_avx2(), Threefish_512_AVX2, "Threefish-512", "avx2");
+BOTAN_REGISTER_BLOCK_CIPHER_NOARGS_IF(CPUID::has_avx2(), Threefish_512_AVX2, "Threefish-512", "avx2", 64);
namespace {
diff --git a/src/lib/block/xtea_simd/info.txt b/src/lib/block/xtea_simd/info.txt
index 7e7d001ac..01fb4110d 100644
--- a/src/lib/block/xtea_simd/info.txt
+++ b/src/lib/block/xtea_simd/info.txt
@@ -3,5 +3,4 @@ define XTEA_SIMD 20131128
<requires>
xtea
simd
-simd_engine
</requires>
diff --git a/src/lib/block/xtea_simd/xtea_simd.cpp b/src/lib/block/xtea_simd/xtea_simd.cpp
index 6fd2f94c7..ffd2eb560 100644
--- a/src/lib/block/xtea_simd/xtea_simd.cpp
+++ b/src/lib/block/xtea_simd/xtea_simd.cpp
@@ -11,7 +11,7 @@
namespace Botan {
-BOTAN_REGISTER_BLOCK_CIPHER_NOARGS_IF(SIMD_32::enabled(), XTEA_SIMD, "XTEA", "simd32");
+BOTAN_REGISTER_BLOCK_CIPHER_NOARGS_IF(SIMD_32::enabled(), XTEA_SIMD, "XTEA", "simd32", 64);
namespace {