aboutsummaryrefslogtreecommitdiffstats
path: root/checks/pk_bench.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-09-24 16:44:26 +0000
committerlloyd <[email protected]>2009-09-24 16:44:26 +0000
commit6cb4b06db7855fa8bec60b2965fe34fb01e5896c (patch)
tree4c99b8d613ce1551f2a27cda05e1d67988563072 /checks/pk_bench.cpp
parente06cb7dcf09e17cb0e76d42e096ca838c17a60bc (diff)
Modify the self test program to use the builtin runtime benchmarking goop.
Features dropped: RNG benchmarking, the --bench-type option. New feature: Anything the library understands can be benchmarked using --bench-algo. Use 3DES and Serpent for mode benchmarking along with AES-128.
Diffstat (limited to 'checks/pk_bench.cpp')
-rw-r--r--checks/pk_bench.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/checks/pk_bench.cpp b/checks/pk_bench.cpp
index fcc0a0f13..9a94d8474 100644
--- a/checks/pk_bench.cpp
+++ b/checks/pk_bench.cpp
@@ -53,9 +53,23 @@ using namespace Botan;
#include <fstream>
#include <string>
#include <memory>
+#include <set>
namespace {
+class Benchmark_Report
+ {
+ public:
+ void report(const std::string& name, Timer timer)
+ {
+ std::cout << name << " " << timer << std::endl;
+ data[name].insert(timer);
+ }
+
+ private:
+ std::map<std::string, std::set<Timer> > data;
+ };
+
void benchmark_enc_dec(PK_Encryptor& enc, PK_Decryptor& dec,
Timer& enc_timer, Timer& dec_timer,
RandomNumberGenerator& rng,