diff options
author | lloyd <[email protected]> | 2008-11-12 18:11:50 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-11-12 18:11:50 +0000 |
commit | ff1e835d888a2783e59efc30fa125bfaf7d150fe (patch) | |
tree | f69008ec6cfc733bd993a584e7298c1d48afc89d /src/benchmark | |
parent | e99e232ac74cb2761468e2edad4881fc26033df3 (diff) |
Remove support for provider identifiers from SCAN_Name - it turns out this
was not the right place to keep track of this information. Also modify
all Algorithm_Factory constructor functions to take instead of a SCAN_Name
a pair of std::strings - the SCAN name and an optional provider name. If
a provider is specified, either that provider will be used or the request
will fail. Otherwise, the library will attempt best effort, based on
user-set algorithm implementation settings (combine with benchmark.h for
choosing the fastest implementation at runtime) or if not set, a static
ordering (preset in static_provider_weight in prov_weight.cpp, though it
would be nice to make this easier to toggle).
Diffstat (limited to 'src/benchmark')
-rw-r--r-- | src/benchmark/benchmark.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/benchmark/benchmark.cpp b/src/benchmark/benchmark.cpp index 41e41bfcc..fe6cf0a41 100644 --- a/src/benchmark/benchmark.cpp +++ b/src/benchmark/benchmark.cpp @@ -137,32 +137,33 @@ algorithm_benchmark(const std::string& name, { const std::string provider = providers[i]; - SCAN_Name request(name, provider); - std::pair<u32bit, u64bit> results = std::make_pair(0, 0); - if(const BlockCipher* proto = af.prototype_block_cipher(request)) + if(const BlockCipher* proto = + af.prototype_block_cipher(name, provider)) { std::auto_ptr<BlockCipher> block_cipher(proto->clone()); results = bench_block_cipher(block_cipher.get(), timer, ns_per_provider, &buf[0], buf.size()); } - else if(const StreamCipher* proto = af.prototype_stream_cipher(request)) + else if(const StreamCipher* proto = + af.prototype_stream_cipher(name, provider)) { std::auto_ptr<StreamCipher> stream_cipher(proto->clone()); results = bench_stream_cipher(stream_cipher.get(), timer, ns_per_provider, &buf[0], buf.size()); } - else if(const HashFunction* proto = af.prototype_hash_function(request)) + else if(const HashFunction* proto = + af.prototype_hash_function(name, provider)) { std::auto_ptr<HashFunction> hash(proto->clone()); results = bench_hash(hash.get(), timer, ns_per_provider, &buf[0], buf.size()); } else if(const MessageAuthenticationCode* proto = - af.prototype_mac(request)) + af.prototype_mac(name, provider)) { std::auto_ptr<MessageAuthenticationCode> mac(proto->clone()); results = bench_mac(mac.get(), timer, ns_per_provider, |