Monero
Loading...
Searching...
No Matches
benchmark.cpp File Reference
#include "tests/benchmark.h"
#include <boost/fusion/adapted/std_tuple.hpp>
#include <boost/fusion/algorithm/iteration/fold.hpp>
#include <boost/preprocessor/seq/enum.hpp>
#include <boost/preprocessor/seq/for_each.hpp>
#include <boost/preprocessor/seq/seq.hpp>
#include <boost/preprocessor/seq.hpp>
#include <boost/preprocessor/stringize.hpp>
#include <boost/spirit/include/karma_char.hpp>
#include <boost/spirit/include/karma_format.hpp>
#include <boost/spirit/include/karma_repeat.hpp>
#include <boost/spirit/include/karma_right_alignment.hpp>
#include <boost/spirit/include/karma_sequence.hpp>
#include <boost/spirit/include/karma_string.hpp>
#include <boost/spirit/include/karma_uint.hpp>
#include <boost/spirit/include/qi_char.hpp>
#include <boost/spirit/include/qi_list.hpp>
#include <boost/spirit/include/qi_parse.hpp>
#include <boost/spirit/include/qi_uint.hpp>
#include <chrono>
#include <cstring>
#include <functional>
#include <iostream>
#include <stdexcept>
#include <string>
#include <tuple>
#include <type_traits>
#include <utility>
#include <vector>
#include "crypto/crypto.h"
#include "cryptonote_basic/cryptonote_basic.h"
#include "monero/crypto/amd64-64-24k.h"
#include "monero/crypto/amd64-51-30k.h"
Include dependency graph for benchmark.cpp:

Macros

#define CHECK(...)
#define FORWARD_FUNCTION(func)
 Define function that forwards arguments to crypto::func.
#define CRYPTO_FUNCTION(library, func)
#define CRYPTO_BENCHMARK(r, _, library)

Functions

int main (int argc, char **argv)

Macro Definition Documentation

◆ CHECK

#define CHECK ( ...)
Value:
if(!( __VA_ARGS__ )) \
throw std::runtime_error{ \
"TEST FAILED (line " \
BOOST_PP_STRINGIZE( __LINE__ ) \
"): " \
BOOST_PP_STRINGIZE( __VA_ARGS__ ) \
}

◆ CRYPTO_BENCHMARK

#define CRYPTO_BENCHMARK ( r,
_,
library )
Value:
struct library \
{ \
static constexpr const char* name() noexcept { return BOOST_PP_STRINGIZE(library); } \
static bool generate_key_derivation(const ::crypto::public_key &tx_pub, const ::crypto::secret_key &view_sec, ::crypto::key_derivation &out) \
{ \
return CRYPTO_FUNCTION(library, _generate_key_derivation) (out.data, tx_pub.data, view_sec.data) == 0; \
} \
static bool derive_subaddress_public_key(const ::crypto::public_key &spend_pub, const ::crypto::key_derivation &d, std::size_t index, ::crypto::public_key &out) \
{ \
::crypto::derivation_to_scalar(d, index, scalar); \
return CRYPTO_FUNCTION(library, _generate_subaddress_public_key) (out.data, spend_pub.data, scalar.data) == 0; \
} \
};
bool derive_subaddress_public_key(const public_key &out_key, const key_derivation &derivation, std::size_t output_index, public_key &result)
Definition crypto.h:246
POD_CLASS key_derivation
Definition crypto.h:91
POD_CLASS public_key
Definition crypto.h:64
POD_CLASS ec_scalar
Definition crypto.h:59
@ out
Definition message_store.h:75
const char * name
Definition options.c:30
#define CRYPTO_FUNCTION(library, func)
Definition benchmark.cpp:83

◆ CRYPTO_FUNCTION

#define CRYPTO_FUNCTION ( library,
func )
Value:
BOOST_PP_CAT(BOOST_PP_CAT(monero_crypto_, library), func)

◆ FORWARD_FUNCTION

#define FORWARD_FUNCTION ( func)
Value:
template<typename... T> \
static bool func (T&&... args) \
{ \
return ::crypto:: func (std::forward<T>(args)...); \
}
#define T(x)

Define function that forwards arguments to crypto::func.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )