diff options
author | lloyd <[email protected]> | 2008-11-11 20:37:36 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-11-11 20:37:36 +0000 |
commit | 7ffcb0d29c9b99e46498d0a8a2e4cf5e100a9d21 (patch) | |
tree | a7e09668a89ed35047691e5922eec96a1e1286a5 /src/benchmark/benchmark.h | |
parent | 966464c71c43e7c389540a795bb45ea3c3e73262 (diff) |
Add a runtime benchmarking system (for ciphers/hash/MACs)
Diffstat (limited to 'src/benchmark/benchmark.h')
-rw-r--r-- | src/benchmark/benchmark.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/benchmark/benchmark.h b/src/benchmark/benchmark.h new file mode 100644 index 000000000..176b038d9 --- /dev/null +++ b/src/benchmark/benchmark.h @@ -0,0 +1,36 @@ +/** +* Runtime benchmarking +* (C) 2008 Jack Lloyd +*/ + +#ifndef BOTAN_RUNTIME_BENCHMARK_H__ +#define BOTAN_RUNTIME_BENCHMARK_H__ + +#include <botan/algo_factory.h> +#include <botan/timers.h> +#include <botan/rng.h> +#include <map> +#include <string> + +namespace Botan { + +/** +Algorithm benchmark +@param name the name of the algorithm to test (cipher, hash, or MAC) +@param milliseconds total time for the benchmark to run +@param timer the timer to use +@param rng the rng to use to generate random inputs +@param af the algorithm factory used to create objects +@returns results a map from provider to speed in mebibytes per second +*/ +std::map<std::string, double> +algorithm_benchmark(const std::string& name, + u32bit milliseconds, + Timer& timer, + RandomNumberGenerator& rng, + Algorithm_Factory& af); + +} + + +#endif |