Crypto++  5.6.5
Free C++ class library of cryptographic schemes
bench.h
1 // bench.h - originally written and placed in the public domain by Wei Dai
2 // CryptoPP::Test namespace added by JW in February 2017
3 
4 #ifndef CRYPTOPP_BENCH_H
5 #define CRYPTOPP_BENCH_H
6 
7 #include "cryptlib.h"
8 
9 #include <iostream>
10 #include <iomanip>
11 #include <cmath>
12 #include <ctime>
13 
14 NAMESPACE_BEGIN(CryptoPP)
15 NAMESPACE_BEGIN(Test)
16 
17 enum TestClass {Unkeyed=1,SharedKey=2,PublicKey=4, All=Unkeyed|SharedKey|PublicKey};
18 
19 extern const double CLOCK_TICKS_PER_SECOND;
20 extern double g_allocatedTime;
21 extern double g_hertz;
22 extern double g_logTotal;
23 extern unsigned int g_logCount;
24 extern const byte defaultKey[];
25 
26 // Test book keeping
27 extern time_t g_testBegin;
28 extern time_t g_testEnd;
29 
30 // Top level, prints preamble and postamble
31 void Benchmark(Test::TestClass suites, double t, double hertz);
32 // Unkeyed systems
33 void Benchmark1(double t, double hertz);
34 // Shared key systems
35 void Benchmark2(double t, double hertz);
36 // Public key systems
37 void Benchmark3(double t, double hertz);
38 
39 void OutputResultBytes(const char *name, double length, double timeTaken);
40 void OutputResultOperations(const char *name, const char *operation, bool pc, unsigned long iterations, double timeTaken);
41 
42 NAMESPACE_END // Test
43 NAMESPACE_END // CryptoPP
44 
45 #endif
Abstract base classes that provide a uniform interface to this library.
Interface for public keys.
Definition: cryptlib.h:2162
Crypto++ library namespace.