Electroneum
bulletproofs.cpp
Go to the documentation of this file.
1 // Copyright (c) 2014-2019, The Monero Project
2 //
3 // All rights reserved.
4 //
5 // Redistribution and use in source and binary forms, with or without modification, are
6 // permitted provided that the following conditions are met:
7 //
8 // 1. Redistributions of source code must retain the above copyright notice, this list of
9 // conditions and the following disclaimer.
10 //
11 // 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 // of conditions and the following disclaimer in the documentation and/or other
13 // materials provided with the distribution.
14 //
15 // 3. Neither the name of the copyright holder nor the names of its contributors may be
16 // used to endorse or promote products derived from this software without specific
17 // prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
20 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
22 // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
27 // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 //
29 // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
30 
31 #include "ringct/rctSigs.h"
32 #include "ringct/bulletproofs.h"
33 #include "chaingen.h"
34 #include "bulletproofs.h"
35 #include "device/device.hpp"
36 
37 using namespace epee;
38 using namespace crypto;
39 using namespace cryptonote;
40 
41 //----------------------------------------------------------------------------------------------------------------------
42 // Tests
43 
44 bool gen_bp_tx_validation_base::generate_with(std::vector<test_event_entry>& events,
45  size_t mixin, size_t n_txes, const uint64_t *amounts_paid, bool valid, const rct::RCTConfig *rct_config,
46  const std::function<bool(std::vector<tx_source_entry> &sources, std::vector<tx_destination_entry> &destinations, size_t tx_idx)> &pre_tx,
47  const std::function<bool(transaction &tx, size_t tx_idx)> &post_tx) const
48 {
49  uint64_t ts_start = 1338224400;
50 
51  GENERATE_ACCOUNT(miner_account);
52  MAKE_GENESIS_BLOCK(events, blk_0, miner_account, ts_start);
53 
54  // create 12 miner accounts, and have them mine the next 12 blocks
55  cryptonote::account_base miner_accounts[12];
56  const cryptonote::block *prev_block = &blk_0;
58  for (size_t n = 0; n < 12; ++n) {
59  miner_accounts[n].generate();
60  CHECK_AND_ASSERT_MES(generator.construct_block_manually(blocks[n], *prev_block, miner_accounts[n],
62  2, 2, prev_block->timestamp + DIFFICULTY_BLOCKS_ESTIMATE_TIMESPAN * 2, // v2 has blocks twice as long
63  crypto::hash(), 0, transaction(), std::vector<crypto::hash>(), 0, 0, 2),
64  false, "Failed to generate block");
65  events.push_back(blocks[n]);
66  prev_block = blocks + n;
67  LOG_PRINT_L0("Initial miner tx " << n << ": " << obj_to_json_str(blocks[n].miner_tx));
68  }
69 
70  // rewind
71  cryptonote::block blk_r, blk_last;
72  {
73  blk_last = blocks[11];
74  for (size_t i = 0; i < CRYPTONOTE_MINED_ETN_UNLOCK_WINDOW; ++i)
75  {
76  CHECK_AND_ASSERT_MES(generator.construct_block_manually(blocks[12+i], blk_last, miner_account,
78  2, 2, blk_last.timestamp + DIFFICULTY_BLOCKS_ESTIMATE_TIMESPAN * 2, // v2 has blocks twice as long
79  crypto::hash(), 0, transaction(), std::vector<crypto::hash>(), 0, 0, 2),
80  false, "Failed to generate block");
81  events.push_back(blocks[12+i]);
82  blk_last = blocks[12+i];
83  }
84  blk_r = blk_last;
85  }
86 
87  // create 4 txes from these miners in another block, to generate some rct outputs
88  std::vector<transaction> rct_txes;
89  cryptonote::block blk_txes;
90  std::vector<crypto::hash> starting_rct_tx_hashes;
91  static const uint64_t input_amounts_available[] = {5000000000000, 30000000000000, 100000000000, 80000000000};
92  for (size_t n = 0; n < n_txes; ++n)
93  {
94  std::vector<tx_source_entry> sources;
95 
96  sources.resize(1);
97  tx_source_entry& src = sources.back();
98 
99  const uint64_t needed_amount = input_amounts_available[n];
100  src.amount = input_amounts_available[n];
101  size_t real_index_in_tx = 0;
102  for (size_t m = 0; m <= mixin; ++m) {
103  size_t index_in_tx = 0;
104  for (size_t i = 0; i < blocks[m].miner_tx.vout.size(); ++i)
105  if (blocks[m].miner_tx.vout[i].amount == needed_amount)
106  index_in_tx = i;
107  CHECK_AND_ASSERT_MES(blocks[m].miner_tx.vout[index_in_tx].amount == needed_amount, false, "Expected amount not found");
108  src.push_output(m, boost::get<txout_to_key>(blocks[m].miner_tx.vout[index_in_tx].target).key, src.amount);
109  if (m == n)
110  real_index_in_tx = index_in_tx;
111  }
113  src.real_output = n;
114  src.real_output_in_tx_index = real_index_in_tx;
115  src.mask = rct::identity();
116  src.rct = false;
117 
118  //fill outputs entry
120  td.addr = miner_accounts[n].get_keys().m_account_address;
121  std::vector<tx_destination_entry> destinations;
122  for (int o = 0; amounts_paid[o] != (uint64_t)-1; ++o)
123  {
124  td.amount = amounts_paid[o];
125  destinations.push_back(td);
126  }
127 
128  if (pre_tx && !pre_tx(sources, destinations, n))
129  {
130  MDEBUG("pre_tx returned failure");
131  return false;
132  }
133 
134  crypto::secret_key tx_key;
135  std::vector<crypto::secret_key> additional_tx_keys;
136  std::unordered_map<crypto::public_key, cryptonote::subaddress_index> subaddresses;
137  subaddresses[miner_accounts[n].get_keys().m_account_address.m_spend_public_key] = {0,0};
138  rct_txes.resize(rct_txes.size() + 1);
139  bool r = construct_tx_and_get_tx_key(miner_accounts[n].get_keys(), subaddresses, sources, destinations, cryptonote::account_public_address{}, std::vector<uint8_t>(), rct_txes.back(), 0, tx_key, additional_tx_keys, true, rct_config[n]);
140  CHECK_AND_ASSERT_MES(r, false, "failed to construct transaction");
141 
142  if (post_tx && !post_tx(rct_txes.back(), n))
143  {
144  MDEBUG("post_tx returned failure");
145  return false;
146  }
147 
148  //events.push_back(rct_txes.back());
149  starting_rct_tx_hashes.push_back(get_transaction_hash(rct_txes.back()));
150  LOG_PRINT_L0("Test tx: " << obj_to_json_str(rct_txes.back()));
151 
152  for (int o = 0; amounts_paid[o] != (uint64_t)-1; ++o)
153  {
154  crypto::key_derivation derivation;
155  bool r = crypto::generate_key_derivation(destinations[o].addr.m_view_public_key, tx_key, derivation);
156  CHECK_AND_ASSERT_MES(r, false, "Failed to generate key derivation");
157  crypto::secret_key amount_key;
158  crypto::derivation_to_scalar(derivation, o, amount_key);
159  rct::key rct_tx_mask;
160  const uint8_t type = rct_txes.back().rct_signatures.type;
161  if (type == rct::RCTTypeSimple || type == rct::RCTTypeBulletproof || type == rct::RCTTypeBulletproof2)
162  rct::decodeRctSimple(rct_txes.back().rct_signatures, rct::sk2rct(amount_key), o, rct_tx_mask, hw::get_device("default"));
163  else
164  rct::decodeRct(rct_txes.back().rct_signatures, rct::sk2rct(amount_key), o, rct_tx_mask, hw::get_device("default"));
165  }
166 
167  while (amounts_paid[0] != (size_t)-1)
168  ++amounts_paid;
169  ++amounts_paid;
170  }
171  if (!valid)
172  DO_CALLBACK(events, "mark_invalid_tx");
173  events.push_back(rct_txes);
174 
175  CHECK_AND_ASSERT_MES(generator.construct_block_manually(blk_txes, blk_last, miner_account,
177  10, 10, blk_last.timestamp + DIFFICULTY_BLOCKS_ESTIMATE_TIMESPAN * 2, // v2 has blocks twice as long
178  crypto::hash(), 0, transaction(), starting_rct_tx_hashes, 0, 6, 10),
179  false, "Failed to generate block");
180  if (!valid)
181  DO_CALLBACK(events, "mark_invalid_block");
182  events.push_back(blk_txes);
183  blk_last = blk_txes;
184 
185  return true;
186 }
187 
188 bool gen_bp_tx_validation_base::check_bp(const cryptonote::transaction &tx, size_t tx_idx, const size_t *sizes, const char *context) const
189 {
191  CHECK_TEST_CONDITION(tx.version >= 4);
193  size_t n_sizes = 0, n_amounts = 0;
194  for (size_t n = 0; n < tx_idx; ++n)
195  {
196  while (sizes[0] != (size_t)-1)
197  ++sizes;
198  ++sizes;
199  }
200  while (sizes[n_sizes] != (size_t)-1)
201  n_amounts += sizes[n_sizes++];
202  CHECK_TEST_CONDITION(tx.rct_signatures.p.bulletproofs.size() == n_sizes);
204  for (size_t n = 0; n < n_sizes; ++n)
206  return true;
207 }
208 
209 bool gen_bp_tx_valid_1::generate(std::vector<test_event_entry>& events) const
210 {
211  const size_t mixin = 10;
212  const uint64_t amounts_paid[] = {10000, (uint64_t)-1};
213  const size_t bp_sizes[] = {1, (size_t)-1};
214  const rct::RCTConfig rct_config[] = { { rct::RangeProofPaddedBulletproof, 0 } };
215  return generate_with(events, mixin, 1, amounts_paid, true, rct_config, NULL, [&](const cryptonote::transaction &tx, size_t tx_idx){ return check_bp(tx, tx_idx, bp_sizes, "gen_bp_tx_valid_1"); });
216 }
217 
218 bool gen_bp_tx_invalid_1_1::generate(std::vector<test_event_entry>& events) const
219 {
220  const size_t mixin = 10;
221  const uint64_t amounts_paid[] = {5000, 5000, (uint64_t)-1};
222  const rct::RCTConfig rct_config[] = { { rct::RangeProofBulletproof , 0 } };
223  return generate_with(events, mixin, 1, amounts_paid, false, rct_config, NULL, NULL);
224 }
225 
226 bool gen_bp_tx_valid_2::generate(std::vector<test_event_entry>& events) const
227 {
228  const size_t mixin = 10;
229  const uint64_t amounts_paid[] = {5000, 5000, (uint64_t)-1};
230  const size_t bp_sizes[] = {2, (size_t)-1};
231  const rct::RCTConfig rct_config[] = { { rct::RangeProofPaddedBulletproof, 0 } };
232  return generate_with(events, mixin, 1, amounts_paid, true, rct_config, NULL, [&](const cryptonote::transaction &tx, size_t tx_idx){ return check_bp(tx, tx_idx, bp_sizes, "gen_bp_tx_valid_2"); });
233 }
234 
235 bool gen_bp_tx_valid_3::generate(std::vector<test_event_entry>& events) const
236 {
237  const size_t mixin = 10;
238  const uint64_t amounts_paid[] = {5000, 5000, 5000, (uint64_t)-1};
239  const size_t bp_sizes[] = {4, (size_t)-1};
240  const rct::RCTConfig rct_config[] = { { rct::RangeProofPaddedBulletproof , 0 } };
241  return generate_with(events, mixin, 1, amounts_paid, true, rct_config, NULL, [&](const cryptonote::transaction &tx, size_t tx_idx){ return check_bp(tx, tx_idx, bp_sizes, "gen_bp_tx_valid_3"); });
242 }
243 
244 bool gen_bp_tx_valid_16::generate(std::vector<test_event_entry>& events) const
245 {
246  const size_t mixin = 10;
247  const uint64_t amounts_paid[] = {500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, (uint64_t)-1};
248  const size_t bp_sizes[] = {16, (size_t)-1};
249  const rct::RCTConfig rct_config[] = { { rct::RangeProofPaddedBulletproof , 0 } };
250  return generate_with(events, mixin, 1, amounts_paid, true, rct_config, NULL, [&](const cryptonote::transaction &tx, size_t tx_idx){ return check_bp(tx, tx_idx, bp_sizes, "gen_bp_tx_valid_16"); });
251 }
252 
253 bool gen_bp_tx_invalid_4_2_1::generate(std::vector<test_event_entry>& events) const
254 {
255  const size_t mixin = 10;
256  const uint64_t amounts_paid[] = {1000, 1000, 1000, 1000, 1000, 1000, 1000, (uint64_t)-1};
257  const rct::RCTConfig rct_config[] = { { rct::RangeProofMultiOutputBulletproof , 0 } };
258  return generate_with(events, mixin, 1, amounts_paid, false, rct_config, NULL, NULL);
259 }
260 
261 bool gen_bp_tx_invalid_16_16::generate(std::vector<test_event_entry>& events) const
262 {
263  const size_t mixin = 10;
264  const uint64_t amounts_paid[] = {1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, (uint64_t)-1};
265  const rct::RCTConfig rct_config[] = { { rct::RangeProofMultiOutputBulletproof , 0 } };
266  return generate_with(events, mixin, 1, amounts_paid, false, rct_config, NULL, NULL);
267 }
268 
269 bool gen_bp_txs_valid_2_and_2::generate(std::vector<test_event_entry>& events) const
270 {
271  const size_t mixin = 10;
272  const uint64_t amounts_paid[] = {1000, 1000, (size_t)-1, 1000, 1000, (uint64_t)-1};
273  const size_t bp_sizes[] = {2, (size_t)-1, 2, (size_t)-1};
275  return generate_with(events, mixin, 2, amounts_paid, true, rct_config, NULL, [&](const cryptonote::transaction &tx, size_t tx_idx){ return check_bp(tx, tx_idx, bp_sizes, "gen_bp_txs_valid_2_and_2"); });
276 }
277 
278 bool gen_bp_txs_invalid_2_and_8_2_and_16_16_1::generate(std::vector<test_event_entry>& events) const
279 {
280  const size_t mixin = 10;
281  const uint64_t amounts_paid[] = {1000, 1000, (uint64_t)-1, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, (uint64_t)-1, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, (uint64_t)-1};
283  return generate_with(events, mixin, 3, amounts_paid, false, rct_config, NULL, NULL);
284 }
285 
286 bool gen_bp_txs_valid_2_and_3_and_2_and_4::generate(std::vector<test_event_entry>& events) const
287 {
288  const size_t mixin = 10;
289  const uint64_t amounts_paid[] = {11111115000, 11111115000, (uint64_t)-1, 11111115000, 11111115000, 11111115001, (uint64_t)-1, 11111115000, 11111115002, (uint64_t)-1, 11111115000, 11111115000, 11111115000, 11111115003, (uint64_t)-1};
291  const size_t bp_sizes[] = {2, (size_t)-1, 4, (size_t)-1, 2, (size_t)-1, 4, (size_t)-1};
292  return generate_with(events, mixin, 4, amounts_paid, true, rct_config, NULL, [&](const cryptonote::transaction &tx, size_t tx_idx) { return check_bp(tx, tx_idx, bp_sizes, "gen_bp_txs_valid_2_and_3_and_2_and_4"); });
293 }
294 
295 bool gen_bp_tx_invalid_not_enough_proofs::generate(std::vector<test_event_entry>& events) const
296 {
297  DEFINE_TESTS_ERROR_CONTEXT("gen_bp_tx_invalid_not_enough_proofs");
298  const size_t mixin = 10;
299  const uint64_t amounts_paid[] = {5000, 5000, (uint64_t)-1};
300  const rct::RCTConfig rct_config[] = { { rct::RangeProofBulletproof, 0 } };
301  return generate_with(events, mixin, 1, amounts_paid, false, rct_config, NULL, [&](cryptonote::transaction &tx, size_t idx){
304  tx.rct_signatures.p.bulletproofs.pop_back();
306  return true;
307  });
308 }
309 
310 bool gen_bp_tx_invalid_empty_proofs::generate(std::vector<test_event_entry>& events) const
311 {
312  DEFINE_TESTS_ERROR_CONTEXT("gen_bp_tx_invalid_empty_proofs");
313  const size_t mixin = 10;
314  const uint64_t amounts_paid[] = {50000, 50000, (uint64_t)-1};
315  const rct::RCTConfig rct_config[] = { { rct::RangeProofBulletproof, 0 } };
316  return generate_with(events, mixin, 1, amounts_paid, false, rct_config, NULL, [&](cryptonote::transaction &tx, size_t idx){
318  tx.rct_signatures.p.bulletproofs.clear();
319  return true;
320  });
321 }
322 
323 bool gen_bp_tx_invalid_too_many_proofs::generate(std::vector<test_event_entry>& events) const
324 {
325  DEFINE_TESTS_ERROR_CONTEXT("gen_bp_tx_invalid_too_many_proofs");
326  const size_t mixin = 10;
327  const uint64_t amounts_paid[] = {10000, (uint64_t)-1};
328  const rct::RCTConfig rct_config[] = { { rct::RangeProofBulletproof, 0 } };
329  return generate_with(events, mixin, 1, amounts_paid, false, rct_config, NULL, [&](cryptonote::transaction &tx, size_t idx){
332  tx.rct_signatures.p.bulletproofs.push_back(tx.rct_signatures.p.bulletproofs.back());
333  return true;
334  });
335 }
336 
337 bool gen_bp_tx_invalid_wrong_amount::generate(std::vector<test_event_entry>& events) const
338 {
339  DEFINE_TESTS_ERROR_CONTEXT("gen_bp_tx_invalid_wrong_amount");
340  const size_t mixin = 10;
341  const uint64_t amounts_paid[] = {10000, (uint64_t)-1};
342  const rct::RCTConfig rct_config[] = { { rct::RangeProofBulletproof, 0 } };
343  return generate_with(events, mixin, 1, amounts_paid, false, rct_config, NULL, [&](cryptonote::transaction &tx, size_t idx){
347  return true;
348  });
349 }
350 
351 bool gen_bp_tx_invalid_borromean_type::generate(std::vector<test_event_entry>& events) const
352 {
353  DEFINE_TESTS_ERROR_CONTEXT("gen_bp_tx_invalid_borromean_type");
354  const size_t mixin = 10;
355  const uint64_t amounts_paid[] = {5000, 5000, (uint64_t)-1};
356  const rct::RCTConfig rct_config[] = { { rct::RangeProofBorromean, 0 } };
357  return generate_with(events, mixin, 1, amounts_paid, false, rct_config, NULL, [&](cryptonote::transaction &tx, size_t tx_idx){
358  return true;
359  });
360 }
#define CRYPTONOTE_MINED_ETN_UNLOCK_WINDOW
void derivation_to_scalar(const key_derivation &derivation, size_t output_index, ec_scalar &res)
Definition: crypto.h:279
size_t n_bulletproof_max_amounts(const Bulletproof &proof)
Definition: rctTypes.cpp:278
bool generate(std::vector< test_event_entry > &events) const
bool generate(std::vector< test_event_entry > &events) const
crypto::public_key real_out_tx_key
bool generate(std::vector< test_event_entry > &events) const
bool generate_with(std::vector< test_event_entry > &events, size_t mixin, size_t n_txes, const uint64_t *amounts_paid, bool valid, const rct::RCTConfig *rct_config, const std::function< bool(std::vector< cryptonote::tx_source_entry > &sources, std::vector< cryptonote::tx_destination_entry > &destinations, size_t)> &pre_tx, const std::function< bool(cryptonote::transaction &tx, size_t)> &post_tx) const
bool generate(std::vector< test_event_entry > &events) const
bool generate(std::vector< test_event_entry > &events) const
POD_CLASS key_derivation
Definition: crypto.h:98
#define CHECK_AND_ASSERT_MES(expr, fail_ret_val, message)
Definition: misc_log_ex.h:181
bool generate(std::vector< test_event_entry > &events) const
bool generate(std::vector< test_event_entry > &events) const
#define LOG_PRINT_L0(x)
Definition: misc_log_ex.h:99
crypto namespace.
Definition: crypto.cpp:58
bool rct
unsigned char uint8_t
Definition: stdint.h:124
crypto::secret_key generate(const crypto::secret_key &recovery_key=crypto::secret_key(), bool recover=false, bool two_random=false)
Definition: account.cpp:158
uint64_t amount
uint8_t type
Definition: rctTypes.h:241
etn_amount decodeRct(const rctSig &rv, const key &sk, unsigned int i, key &mask, hw::device &hwdev)
Definition: rctSigs.cpp:1150
bool generate_key_derivation(const public_key &key1, const secret_key &key2, key_derivation &derivation)
Definition: crypto.h:272
size_t real_output
bool generate(std::vector< test_event_entry > &events) const
#define CHECK_TEST_CONDITION(cond)
Definition: chaingen.h:1057
#define MDEBUG(x)
Definition: misc_log_ex.h:76
const account_keys & get_keys() const
Definition: account.cpp:264
bool is_rct_bulletproof(int type)
Definition: rctTypes.cpp:227
Holds cryptonote related classes and helpers.
Definition: ban.cpp:40
bool generate(std::vector< test_event_entry > &events) const
rctSigPrunable p
Definition: rctTypes.h:437
bool generate(std::vector< test_event_entry > &events) const
bool generate(std::vector< test_event_entry > &events) const
device & get_device(const std::string &device_descriptor)
Definition: device.cpp:95
#define MAKE_GENESIS_BLOCK(VEC_EVENTS, BLK_NAME, MINER_ACC, TS)
Definition: chaingen.h:833
std::string obj_to_json_str(T &obj)
unsigned __int64 uint64_t
Definition: stdint.h:136
std::unique_ptr< void, terminate > context
Unique ZMQ context handle, calls zmq_term on destruction.
Definition: zmq.h:98
crypto::public_key get_tx_pub_key_from_extra(const std::vector< uint8_t > &tx_extra, size_t pk_index)
uint64_t amount
void push_output(uint64_t idx, const crypto::public_key &k, uint64_t amount)
void skGen(key &sk)
Definition: rctOps.cpp:253
account_public_address addr
account_public_address m_account_address
Definition: account.h:43
key identity()
Definition: rctOps.h:73
size_t real_output_in_tx_index
crypto::hash get_transaction_hash(const transaction &t)
POD_CLASS hash
Definition: hash.h:50
#define DIFFICULTY_BLOCKS_ESTIMATE_TIMESPAN
#define GENERATE_ACCOUNT(account)
Definition: chaingen.h:801
bool generate(std::vector< test_event_entry > &events) const
bool generate(std::vector< test_event_entry > &events) const
#define DEFINE_TESTS_ERROR_CONTEXT(text)
Definition: chaingen.h:1056
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)
bool generate(std::vector< test_event_entry > &events) const
bool check_bp(const cryptonote::transaction &tx, size_t tx_idx, const size_t *sizes, const char *context) const
std::vector< Bulletproof > bulletproofs
Definition: rctTypes.h:320
#define DO_CALLBACK(VEC_EVENTS, CB_NAME)
Definition: chaingen.h:820
bool generate(std::vector< test_event_entry > &events) const
etn_amount decodeRctSimple(const rctSig &rv, const key &sk, unsigned int i, key &mask, hw::device &hwdev)
Definition: rctSigs.cpp:1180
Bulletproof bulletproof_PROVE(const rct::key &v, const rct::key &gamma)
rct::key mask