diff options
Diffstat (limited to 'checks/check.cpp')
-rw-r--r-- | checks/check.cpp | 39 |
1 files changed, 5 insertions, 34 deletions
diff --git a/checks/check.cpp b/checks/check.cpp index 678cf4b09..b460d34f7 100644 --- a/checks/check.cpp +++ b/checks/check.cpp @@ -94,7 +94,7 @@ int main(int argc, char* argv[]) { try { - OptionParser opts("help|html|test|validate|" + OptionParser opts("help|test|validate|" "benchmark|bench-type=|bench-algo=|seconds="); opts.parse(argv); @@ -111,9 +111,6 @@ int main(int argc, char* argv[]) << "Options:\n" << " --test || --validate: Run tests (do this at least once)\n" << " --benchmark: Benchmark everything\n" - << " --bench-type={block,mode,stream,hash,mac,rng,pk}:\n" - << " Benchmark only algorithms of a particular type\n" - << " --html: Produce HTML output for benchmarks\n" << " --seconds=n: Benchmark for n seconds\n" << " --init=<str>: Pass <str> to the library\n" << " --help: Print this message\n"; @@ -128,7 +125,7 @@ int main(int argc, char* argv[]) opts.is_set("benchmark") || opts.is_set("bench-type")) { - double seconds = 5; + double seconds = 2; if(opts.is_set("seconds")) { @@ -140,11 +137,9 @@ int main(int argc, char* argv[]) } } - const bool html = opts.is_set("html"); - if(opts.is_set("benchmark")) { - benchmark("All", rng, html, seconds); + benchmark(rng, seconds); } else if(opts.is_set("bench-algo")) { @@ -154,34 +149,10 @@ int main(int argc, char* argv[]) for(u32bit j = 0; j != algs.size(); j++) { const std::string alg = algs[j]; - u32bit found = bench_algo(alg, rng, seconds); - if(!found) // maybe it's a PK algorithm - bench_pk(rng, alg, html, seconds); + if(!bench_algo(alg, rng, seconds)) // maybe it's a PK algorithm + bench_pk(rng, alg, seconds); } } - else if(opts.is_set("bench-type")) - { - const std::string type = opts.value("bench-type"); - - if(type == "all") - benchmark("All", rng, html, seconds); - else if(type == "block") - benchmark("Block Cipher", rng, html, seconds); - else if(type == "stream") - benchmark("Stream Cipher", rng, html, seconds); - else if(type == "hash") - benchmark("Hash", rng, html, seconds); - else if(type == "mode") - benchmark("Cipher Mode", rng, html, seconds); - else if(type == "mac") - benchmark("MAC", rng, html, seconds); - else if(type == "rng") - benchmark("RNG", rng, html, seconds); - else if(type == "pk") - bench_pk(rng, "All", html, seconds); - else - std::cerr << "Unknown --bench-type " << type << "\n"; - } } } catch(std::exception& e) |