diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-06-28 16:03:28 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-08-28 21:28:58 +0100 |
commit | 6d0e47148bc400ca6668860e162fe2f4ad8a3dac (patch) | |
tree | b9d5d32dc975b8811cf992c2f86a75d00bb5c815 /tests/core_tests/rct.cpp | |
parent | ringct: fix size unit mismatch calling keccak (diff) | |
download | monero-6d0e47148bc400ca6668860e162fe2f4ad8a3dac.tar.xz |
rct: add the tx prefix hash into the MLSAG
to protect the non-signatures parts of the tx from tampering.
Diffstat (limited to 'tests/core_tests/rct.cpp')
-rw-r--r-- | tests/core_tests/rct.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/core_tests/rct.cpp b/tests/core_tests/rct.cpp index 465d2036f..f16045ef6 100644 --- a/tests/core_tests/rct.cpp +++ b/tests/core_tests/rct.cpp @@ -467,3 +467,21 @@ bool gen_rct_tx_rct_add_vout::generate(std::vector<test_event_entry>& events) co NULL, [](transaction &tx) {tx.vout.push_back(tx.vout.back());}); } +bool gen_rct_tx_pre_rct_altered_extra::generate(std::vector<test_event_entry>& events) const +{ + const int mixin = 2; + const int out_idx[] = {0, -1}; + const uint64_t amount_paid = 10000; + return generate_with(events, out_idx, mixin, amount_paid, false, + NULL, [](transaction &tx) {std::string extra_nonce; crypto::hash pid = cryptonote::null_hash; set_payment_id_to_tx_extra_nonce(extra_nonce, pid); add_extra_nonce_to_tx_extra(tx.extra, extra_nonce);}); +} + +bool gen_rct_tx_rct_altered_extra::generate(std::vector<test_event_entry>& events) const +{ + const int mixin = 2; + const int out_idx[] = {1, -1}; + const uint64_t amount_paid = 10000; + return generate_with(events, out_idx, mixin, amount_paid, false, + NULL, [](transaction &tx) {std::string extra_nonce; crypto::hash pid = cryptonote::null_hash; set_payment_id_to_tx_extra_nonce(extra_nonce, pid); add_extra_nonce_to_tx_extra(tx.extra, extra_nonce);}); +} + |