diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2021-02-14 17:45:04 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2022-04-05 18:50:22 +0000 |
commit | 4c94cfecfcb96c218b37234eda2f9c262821cf7c (patch) | |
tree | af8183f3dacf18298fe0f6f5493c2dc48ebcc1cd /tests/core_tests | |
parent | ringct: port some of vtnerd's review changes from BP+ to BP (diff) | |
download | monero-4c94cfecfcb96c218b37234eda2f9c262821cf7c.tar.xz |
store outPk/8 in the tx for speed
It avoids dividing by 8 when deserializing a tx, which is a slow
operation, and multiplies by 8 when verifying and extracing the
amount, which is much faster as well as less frequent
Diffstat (limited to 'tests/core_tests')
-rw-r--r-- | tests/core_tests/multisig.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/core_tests/multisig.cpp b/tests/core_tests/multisig.cpp index f8b4f25c1..49ae86eb0 100644 --- a/tests/core_tests/multisig.cpp +++ b/tests/core_tests/multisig.cpp @@ -450,6 +450,8 @@ bool gen_multisig_tx_validation_base::generate_with(std::vector<test_event_entry rct::ecdhTuple ecdh_info = tx.rct_signatures.ecdhInfo[n]; rct::ecdhDecode(ecdh_info, rct::sk2rct(scalar1), tx.rct_signatures.type == rct::RCTTypeBulletproof2 || tx.rct_signatures.type == rct::RCTTypeCLSAG || tx.rct_signatures.type == rct::RCTTypeBulletproofPlus); rct::key C = tx.rct_signatures.outPk[n].mask; + if (rct::is_rct_bulletproof_plus(tx.rct_signatures.type)) + C = rct::scalarmult8(C); rct::addKeys2(Ctmp, ecdh_info.mask, ecdh_info.amount, rct::H); CHECK_AND_ASSERT_MES(rct::equalKeys(C, Ctmp), false, "Failed to decode amount"); amount += rct::h2d(ecdh_info.amount); |