Electroneum
test_signature< verify > Class Template Reference

#include <signature.h>

Inheritance diagram for test_signature< verify >:
Collaboration diagram for test_signature< verify >:

Public Member Functions

bool init ()
 
bool test ()
 
- Public Member Functions inherited from single_tx_test_base
bool init ()
 

Static Public Attributes

static const size_t loop_count = 10000
 

Additional Inherited Members

- Protected Attributes inherited from single_tx_test_base
cryptonote::account_base m_bob
 
cryptonote::transaction m_tx
 
crypto::public_key m_tx_pub_key
 
std::vector< crypto::public_keym_additional_tx_pub_keys
 

Detailed Description

template<bool verify>
class test_signature< verify >

Definition at line 39 of file signature.h.

Member Function Documentation

◆ init()

template<bool verify>
bool test_signature< verify >::init ( )
inline

Definition at line 44 of file signature.h.

45  {
47  return false;
48 
49  message = crypto::rand<crypto::hash>();
51  crypto::generate_signature(message, keys.pub, keys.sec, m_signature);
52 
53  return true;
54  }
void generate_signature(const hash &prefix_hash, const public_key &pub, const secret_key &sec, signature &sig)
Definition: crypto.h:292
device & get_device(const std::string &device_descriptor)
Definition: device.cpp:95
static keypair generate(hw::device &hwdev)
Here is the call graph for this function:

◆ test()

template<bool verify>
bool test_signature< verify >::test ( )
inline

Definition at line 56 of file signature.h.

57  {
58  if (verify)
59  return crypto::check_signature(message, keys.pub, m_signature);
60  crypto::generate_signature(message, keys.pub, keys.sec, m_signature);
61  return true;
62  }
crypto::public_key pub
crypto::secret_key sec
void generate_signature(const hash &prefix_hash, const public_key &pub, const secret_key &sec, signature &sig)
Definition: crypto.h:292
bool check_signature(const hash &prefix_hash, const public_key &pub, const signature &sig)
Definition: crypto.h:295
Here is the call graph for this function:

Member Data Documentation

◆ loop_count

template<bool verify>
const size_t test_signature< verify >::loop_count = 10000
static

Definition at line 42 of file signature.h.


The documentation for this class was generated from the following file: