aboutsummaryrefslogtreecommitdiffstats
path: root/doc/examples/hash_quickly.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-03-03 02:02:48 +0000
committerlloyd <[email protected]>2010-03-03 02:02:48 +0000
commit82ab6d27cc2b434b4b7ffa528396d67fe6993222 (patch)
tree6be9207091acf15df1936ab072a2562c7f111ff9 /doc/examples/hash_quickly.cpp
parenta0d6ce4ce5ccb0108cdd155c7abd830432dc6991 (diff)
Fix minor errors and warnings in the examples. Remove boost dependency from
rng_test example.
Diffstat (limited to 'doc/examples/hash_quickly.cpp')
-rw-r--r--doc/examples/hash_quickly.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/doc/examples/hash_quickly.cpp b/doc/examples/hash_quickly.cpp
index a5236b381..1af0e8f45 100644
--- a/doc/examples/hash_quickly.cpp
+++ b/doc/examples/hash_quickly.cpp
@@ -4,16 +4,6 @@
* Distributed under the terms of the Botan license
*/
-#include <botan/botan.h>
-#include <botan/benchmark.h>
-#include <botan/filters.h>
-
-#include <iostream>
-#include <fstream>
-#include <string>
-#include <map>
-#include <cstdlib>
-
/*
Try to find the fastest SHA-1 implementation and use it to hash
files. In most programs this isn't worth the bother and
@@ -25,6 +15,18 @@ Of course you could also just do this once and save it as an
application config, which is probably the smart thing to do.
*/
+#include <botan/botan.h>
+#include <botan/benchmark.h>
+#include <botan/filters.h>
+
+#include <iostream>
+#include <fstream>
+#include <string>
+#include <map>
+#include <cstdlib>
+
+namespace {
+
void set_fastest_implementation(const std::string& algo,
Botan::RandomNumberGenerator& rng,
double ms = 30)
@@ -54,6 +56,8 @@ void set_fastest_implementation(const std::string& algo,
af.set_preferred_provider(algo, fastest_provider);
}
+}
+
int main(int argc, char* argv[])
{
if(argc <= 1)