diff options
author | lloyd <[email protected]> | 2011-04-04 03:43:52 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2011-04-04 03:43:52 +0000 |
commit | 3b9bfbd07c3723662832caf5b1efe04de28b656d (patch) | |
tree | ee2a9324f384efead6e5bb87ac8374e7e8734c90 /doc/examples/bench.cpp | |
parent | 04db054f1ae8de572ee9c0cfe227e76f84096bd6 (diff) |
Convert most of the documentation to reStructured Text, adding
a makefile to build it with Sphinx (http://sphinx.pocoo.org/).
Previously credits.txt listed public domain code sources; instead
directly credit the authors in the relevant files and delete that
file.
Drop the draft FIPS 140 security policy; I can't imagine FIPS 140
validation will ever happen, and if it does, I don't want
anything to do with it.
Also drop the internals doc, which was so out of date (and
incomplete) as to be worthless.
Move the tutorials and InSiTo pdfs into old/ for the time being,
until anything relevant from them can be filtered out and
converted into RST.
Diffstat (limited to 'doc/examples/bench.cpp')
-rw-r--r-- | doc/examples/bench.cpp | 107 |
1 files changed, 0 insertions, 107 deletions
diff --git a/doc/examples/bench.cpp b/doc/examples/bench.cpp deleted file mode 100644 index 20e6ec40b..000000000 --- a/doc/examples/bench.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/* -* (C) 2009 Jack Lloyd -* -* Distributed under the terms of the Botan license -*/ - -#include <botan/benchmark.h> -#include <botan/init.h> -#include <botan/auto_rng.h> -#include <botan/libstate.h> - -using namespace Botan; - -#include <iostream> - -namespace { - -const std::string algos[] = { - "AES-128", - "AES-192", - "AES-256", - "Blowfish", - "CAST-128", - "CAST-256", - "DES", - "DESX", - "TripleDES", - "GOST", - "IDEA", - "KASUMI", - "Lion(SHA-256,Turing,8192)", - "Luby-Rackoff(SHA-512)", - "MARS", - "MISTY1", - "Noekeon", - "RC2", - "RC5(12)", - "RC5(16)", - "RC6", - "SAFER-SK(10)", - "SEED", - "Serpent", - "Skipjack", - "Square", - "TEA", - "Twofish", - "XTEA", - "Adler32", - "CRC32", - "GOST-34.11", - "HAS-160", - "MD2", - "MD4", - "MD5", - "RIPEMD-128", - "RIPEMD-160", - "SHA-160", - "SHA-256", - "SHA-384", - "SHA-512", - "Skein-512", - "Tiger", - "Whirlpool", - "CMAC(AES-128)", - "HMAC(SHA-1)", - "X9.19-MAC", - "", -}; - -void benchmark_algo(const std::string& algo, - RandomNumberGenerator& rng) - { - u32bit milliseconds = 3000; - Algorithm_Factory& af = global_state().algorithm_factory(); - - std::map<std::string, double> speeds = - algorithm_benchmark(algo, af, rng, milliseconds, 16*1024); - - std::cout << algo << ":"; - - for(std::map<std::string, double>::const_iterator i = speeds.begin(); - i != speeds.end(); ++i) - { - std::cout << " " << i->second << " [" << i->first << "]"; - } - std::cout << "\n"; - } - -} - -int main(int argc, char* argv[]) - { - LibraryInitializer init; - - AutoSeeded_RNG rng; - - if(argc == 1) // no args, benchmark everything - { - for(u32bit i = 0; algos[i] != ""; ++i) - benchmark_algo(algos[i], rng); - } - else - { - for(int i = 1; argv[i]; ++i) - benchmark_algo(argv[i], rng); - } - } |