diff options
author | lloyd <[email protected]> | 2015-02-04 04:03:38 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2015-02-04 04:03:38 +0000 |
commit | 0dd060fed07b0060f94e3bae62e125a85c1bb877 (patch) | |
tree | ed4bc7a961e2b30f17ed5e80769c84b0c313c8b7 /src/cmd/speed.cpp | |
parent | f9a7c85b74be0f4a7273e8e0591703af83036e81 (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/cmd/speed.cpp')
-rw-r--r-- | src/cmd/speed.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/cmd/speed.cpp b/src/cmd/speed.cpp index 4558c4250..7e8dbd412 100644 --- a/src/cmd/speed.cpp +++ b/src/cmd/speed.cpp @@ -12,10 +12,6 @@ #include <botan/benchmark.h> #include <botan/aead.h> #include <botan/auto_rng.h> -#include <botan/libstate.h> -#include <botan/pipe.h> -#include <botan/filters.h> -#include <botan/engine.h> #include <botan/parsing.h> #include <botan/symkey.h> #include <botan/hex.h> @@ -163,7 +159,7 @@ void time_transform(std::unique_ptr<Transform> tf, void time_transform(const std::string& algo, RandomNumberGenerator& rng) { std::unique_ptr<Transform> tf; - tf.reset(get_aead(algo, ENCRYPTION)); + tf.reset(get_cipher_mode(algo, ENCRYPTION)); if(Keyed_Transform* keyed = dynamic_cast<Keyed_Transform*>(tf.get())) keyed->set_key(rng.random_vec(keyed->key_spec().maximum_keylength())); @@ -176,12 +172,10 @@ void bench_algo(const std::string& algo, double seconds, size_t buf_size) { - Algorithm_Factory& af = global_state().algorithm_factory(); - std::chrono::milliseconds ms( static_cast<std::chrono::milliseconds::rep>(seconds * 1000)); - std::map<std::string, double> speeds = algorithm_benchmark(algo, af, rng, ms, buf_size); + std::map<std::string, double> speeds = algorithm_benchmark(algo, rng, ms, buf_size); report_results(algo, speeds); |