summaryrefslogtreecommitdiff
path: root/bench.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2017-02-21 02:03:29 -0500
committerJeffrey Walton <noloader@gmail.com>2017-02-21 02:03:29 -0500
commit73836e58a5f5c11cd7bf7db76e9d02013975fc9a (patch)
treeccaae953fed07fdce85a98da7c8c8a7a47a94518 /bench.h
parent11f0186fd0c74feddc2b55cbb8083860fc88c663 (diff)
downloadcryptopp-git-73836e58a5f5c11cd7bf7db76e9d02013975fc9a.tar.gz
Add Test namespace within CryptoPP namespace (Issue 379)
Diffstat (limited to 'bench.h')
-rw-r--r--bench.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/bench.h b/bench.h
index 5f7f3ea7..f393cfde 100644
--- a/bench.h
+++ b/bench.h
@@ -1,13 +1,33 @@
// bench.h - originally written and placed in the public domain by Wei Dai
+// CryptoPP::Test namespace added by JW in February 2017
#ifndef CRYPTOPP_BENCH_H
#define CRYPTOPP_BENCH_H
#include "cryptlib.h"
-extern const double CLOCK_TICKS_PER_SECOND;
+NAMESPACE_BEGIN(CryptoPP)
+NAMESPACE_BEGIN(Test)
+
+ANONYMOUS_NAMESPACE_BEGIN
+#ifdef CLOCKS_PER_SEC
+const double CLOCK_TICKS_PER_SECOND = (double)CLOCKS_PER_SEC;
+#elif defined(CLK_TCK)
+const double CLOCK_TICKS_PER_SECOND = (double)CLK_TCK;
+#else
+const double CLOCK_TICKS_PER_SECOND = 1000000.0;
+#endif
+
+static const byte defaultKey[] = "0123456789" // 168 + NULL
+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ "00000000000000000000000000000000000000000000000000000"
+ "00000000000000000000000000000000000000000000000000000";
+NAMESPACE_END
void BenchmarkAll(double t, double hertz);
void BenchmarkAll2(double t, double hertz);
+NAMESPACE_END // Test
+NAMESPACE_END // CryptoPP
+
#endif