Electroneum
Loading...
Searching...
No Matches
test_multiexp< algorithm, npoints, c > Class Template Reference

#include <multiexp.h>

Public Member Functions

bool init ()
bool test ()

Static Public Attributes

static const size_t loop_count = npoints >= 1024 ? 10 : npoints < 256 ? 1000 : 100

Detailed Description

template<test_multiexp_algorithm algorithm, size_t npoints, size_t c = 0>
class test_multiexp< algorithm, npoints, c >

Definition at line 47 of file multiexp.h.

Member Function Documentation

◆ init()

template<test_multiexp_algorithm algorithm, size_t npoints, size_t c = 0>
bool test_multiexp< algorithm, npoints, c >::init ( )
inline

Definition at line 52 of file multiexp.h.

53 {
54 data.resize(npoints);
55 res = rct::identity();
56 for (size_t n = 0; n < npoints; ++n)
57 {
58 data[n].scalar = rct::skGen();
60 if (ge_frombytes_vartime(&data[n].point, point.bytes))
61 return false;
63 res = rct::addKeys(res, kn);
64 }
65 straus_cache = rct::straus_init_cache(data);
66 pippenger_cache = rct::pippenger_init_cache(data);
67 return true;
68 }
int ge_frombytes_vartime(ge_p3 *, const unsigned char *)
void scalarmultBase(key &aG, const key &a)
Definition rctOps.cpp:350
key skGen()
Definition rctOps.cpp:258
std::shared_ptr< pippenger_cached_data > pippenger_init_cache(const std::vector< MultiexpData > &data, size_t start_offset=0, size_t N=0)
void scalarmultKey(key &aP, const key &P, const key &a)
Definition rctOps.cpp:368
void addKeys(key &AB, const key &A, const key &B)
Definition rctOps.cpp:420
std::shared_ptr< straus_cached_data > straus_init_cache(const std::vector< MultiexpData > &data, size_t N=0)
key identity()
Definition rctOps.h:73
Here is the call graph for this function:

◆ test()

template<test_multiexp_algorithm algorithm, size_t npoints, size_t c = 0>
bool test_multiexp< algorithm, npoints, c >::test ( )
inline

Definition at line 70 of file multiexp.h.

71 {
72 switch (algorithm)
73 {
75 return res == bos_coster_heap_conv_robust(data);
76 case multiexp_straus:
77 return res == straus(data);
79 return res == straus(data, straus_cache);
81 return res == pippenger(data, NULL, 0, c);
83 return res == pippenger(data, pippenger_cache, 0, c);
84 default:
85 return false;
86 }
87 }

Member Data Documentation

◆ loop_count

template<test_multiexp_algorithm algorithm, size_t npoints, size_t c = 0>
const size_t test_multiexp< algorithm, npoints, c >::loop_count = npoints >= 1024 ? 10 : npoints < 256 ? 1000 : 100
static

Definition at line 50 of file multiexp.h.


The documentation for this class was generated from the following file:
  • /home/abuild/rpmbuild/BUILD/electroneum-5.1.3.1-build/electroneum-5.1.3.1/tests/performance_tests/multiexp.h