Electroneum
test_check_tx_signature_aggregated_bulletproofs< a_ring_size, a_outputs, a_num_txes, extra_outs > Class Template Reference

#include <check_tx_signature.h>

Inheritance diagram for test_check_tx_signature_aggregated_bulletproofs< a_ring_size, a_outputs, a_num_txes, extra_outs >:
Collaboration diagram for test_check_tx_signature_aggregated_bulletproofs< a_ring_size, a_outputs, a_num_txes, extra_outs >:

Public Types

typedef multi_tx_test_base< a_ring_size > base_class
 

Public Member Functions

bool init ()
 
bool test ()
 

Static Public Attributes

static const size_t loop_count = a_ring_size <= 2 ? 50 : 10
 
static const size_t ring_size = a_ring_size
 
static const size_t outputs = a_outputs
 

Detailed Description

template<size_t a_ring_size, size_t a_outputs, size_t a_num_txes, size_t extra_outs = 0>
class test_check_tx_signature_aggregated_bulletproofs< a_ring_size, a_outputs, a_num_txes, extra_outs >

Definition at line 107 of file check_tx_signature.h.

Member Typedef Documentation

◆ base_class

template<size_t a_ring_size, size_t a_outputs, size_t a_num_txes, size_t extra_outs = 0>
typedef multi_tx_test_base<a_ring_size> test_check_tx_signature_aggregated_bulletproofs< a_ring_size, a_outputs, a_num_txes, extra_outs >::base_class

Definition at line 116 of file check_tx_signature.h.

Member Function Documentation

◆ init()

template<size_t a_ring_size, size_t a_outputs, size_t a_num_txes, size_t extra_outs = 0>
bool test_check_tx_signature_aggregated_bulletproofs< a_ring_size, a_outputs, a_num_txes, extra_outs >::init ( )
inline

Definition at line 118 of file check_tx_signature.h.

119  {
120  using namespace cryptonote;
121 
122  if (!base_class::init())
123  return false;
124 
125  m_alice.generate();
126 
127  std::vector<tx_destination_entry> destinations;
128  destinations.push_back(tx_destination_entry(this->m_source_amount - outputs + 1, m_alice.get_keys().m_account_address, false));
129  for (size_t n = 1; n < outputs; ++n)
130  destinations.push_back(tx_destination_entry(1, m_alice.get_keys().m_account_address, false));
131 
132  crypto::secret_key tx_key;
133  std::vector<crypto::secret_key> additional_tx_keys;
134  std::unordered_map<crypto::public_key, cryptonote::subaddress_index> subaddresses;
135  subaddresses[this->m_miners[this->real_source_idx].get_keys().m_account_address.m_spend_public_key] = {0,0};
136 
137  m_txes.resize(a_num_txes + (extra_outs > 0 ? 1 : 0));
138  for (size_t n = 0; n < a_num_txes; ++n)
139  {
140  if (!construct_tx_and_get_tx_key(this->m_miners[this->real_source_idx].get_keys(), subaddresses, this->m_sources, destinations, cryptonote::account_public_address{}, std::vector<uint8_t>(), m_txes[n], 0, tx_key, additional_tx_keys, true, {rct::RangeProofPaddedBulletproof, 2}))
141  return false;
142  }
143 
144  if (extra_outs)
145  {
146  destinations.clear();
147  destinations.push_back(tx_destination_entry(this->m_source_amount - extra_outs + 1, m_alice.get_keys().m_account_address, false));
148  for (size_t n = 1; n < extra_outs; ++n)
149  destinations.push_back(tx_destination_entry(1, m_alice.get_keys().m_account_address, false));
150 
151  if (!construct_tx_and_get_tx_key(this->m_miners[this->real_source_idx].get_keys(), subaddresses, this->m_sources, destinations, cryptonote::account_public_address{}, std::vector<uint8_t>(), m_txes.back(), 0, tx_key, additional_tx_keys, true, {rct::RangeProofMultiOutputBulletproof, 2}))
152  return false;
153  }
154 
155  return true;
156  }
cryptonote::account_base m_miners[ring_size]
static const size_t real_source_idx
const account_keys & get_keys() const
Definition: account.cpp:264
Holds cryptonote related classes and helpers.
Definition: ban.cpp:40
account_public_address m_account_address
Definition: account.h:43
std::vector< cryptonote::tx_source_entry > m_sources
bool construct_tx_and_get_tx_key(const account_keys &sender_account_keys, const std::unordered_map< crypto::public_key, subaddress_index > &subaddresses, std::vector< tx_source_entry > &sources, std::vector< tx_destination_entry > &destinations, const boost::optional< cryptonote::account_public_address > &change_addr, const std::vector< uint8_t > &extra, transaction &tx, uint64_t unlock_time, crypto::secret_key &tx_key, std::vector< crypto::secret_key > &additional_tx_keys, bool rct, const rct::RCTConfig &rct_config, rct::multisig_out *msout, const uint32_t account_major_offset, const cryptonote::network_type nettype)
Here is the call graph for this function:

◆ test()

template<size_t a_ring_size, size_t a_outputs, size_t a_num_txes, size_t extra_outs = 0>
bool test_check_tx_signature_aggregated_bulletproofs< a_ring_size, a_outputs, a_num_txes, extra_outs >::test ( )
inline

Definition at line 158 of file check_tx_signature.h.

159  {
160  std::vector<const rct::rctSig*> rvv;
161  rvv.reserve(m_txes.size());
162  for (size_t n = 0; n < m_txes.size(); ++n)
163  {
164  const rct::rctSig &rv = m_txes[n].rct_signatures;
166  return false;
167  rvv.push_back(&rv);
168  }
169  return rct::verRctSemanticsSimple(rvv);
170  }
bool verRctNonSemanticsSimple(const rctSig &rv)
Definition: rctSigs.cpp:1085
bool verRctSemanticsSimple(const std::vector< const rctSig *> &rvv)
Definition: rctSigs.cpp:975
Here is the call graph for this function:

Member Data Documentation

◆ loop_count

template<size_t a_ring_size, size_t a_outputs, size_t a_num_txes, size_t extra_outs = 0>
const size_t test_check_tx_signature_aggregated_bulletproofs< a_ring_size, a_outputs, a_num_txes, extra_outs >::loop_count = a_ring_size <= 2 ? 50 : 10
static

Definition at line 112 of file check_tx_signature.h.

◆ outputs

template<size_t a_ring_size, size_t a_outputs, size_t a_num_txes, size_t extra_outs = 0>
const size_t test_check_tx_signature_aggregated_bulletproofs< a_ring_size, a_outputs, a_num_txes, extra_outs >::outputs = a_outputs
static

Definition at line 114 of file check_tx_signature.h.

◆ ring_size

template<size_t a_ring_size, size_t a_outputs, size_t a_num_txes, size_t extra_outs = 0>
const size_t test_check_tx_signature_aggregated_bulletproofs< a_ring_size, a_outputs, a_num_txes, extra_outs >::ring_size = a_ring_size
static

Definition at line 113 of file check_tx_signature.h.


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