/usr/include/botan/benchmark.h is in libbotan1.8-dev 1.8.13-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | /**
* Runtime benchmarking
* (C) 2008 Jack Lloyd
*
* Distributed under the terms of the Botan license
*/
#ifndef BOTAN_RUNTIME_BENCHMARK_H__
#define BOTAN_RUNTIME_BENCHMARK_H__
#include <botan/algo_factory.h>
#include <botan/timer.h>
#include <botan/rng.h>
#include <map>
#include <string>
/**
* Choose some sort of default timer implementation to use, since some
* (like hardware tick counters and current Win32 timer) are not
* reliable for benchmarking.
*/
#if defined(BOTAN_HAS_TIMER_POSIX)
#include <botan/tm_posix.h>
#elif defined(BOTAN_HAS_TIMER_UNIX)
#include <botan/tm_unix.h>
#endif
namespace Botan {
#if defined(BOTAN_HAS_TIMER_POSIX)
typedef POSIX_Timer Default_Benchmark_Timer;
#elif defined(BOTAN_HAS_TIMER_UNIX)
typedef Unix_Timer Default_Benchmark_Timer;
#else
/* I have not had good success using clock(), the results seem
* pretty bogus, but as a last resort it works.
*/
typedef ANSI_Clock_Timer Default_Benchmark_Timer;
#endif
/**
* Algorithm benchmark
* @deprecated Use the version that doesn't take a timer for
* compatability with future releases.
* @param name the name of the algorithm to test (cipher, hash, or MAC)
* @param milliseconds total time for the benchmark to run
* @param timer the timer to use
* @param rng the rng to use to generate random inputs
* @param af the algorithm factory used to create objects
* @return results a map from provider to speed in mebibytes per second
*/
std::map<std::string, double>
BOTAN_DLL algorithm_benchmark(const std::string& name,
u32bit milliseconds,
Timer& timer,
RandomNumberGenerator& rng,
Algorithm_Factory& af);
/**
* Algorithm benchmark
* @param name the name of the algorithm to test (cipher, hash, or MAC)
* @param af the algorithm factory used to create objects
* @param rng the rng to use to generate random inputs
* @param milliseconds total time for the benchmark to run
* @param buf_size size of buffer to benchmark against, in KiB
* @return results a map from provider to speed in mebibytes per second
*/
std::map<std::string, double>
BOTAN_DLL algorithm_benchmark(const std::string& name,
Algorithm_Factory& af,
RandomNumberGenerator& rng,
u32bit milliseconds,
u32bit buf_size);
}
#endif
|