mirror of
https://github.com/monero-project/monero.git
synced 2025-05-19 03:20:23 -04:00
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
This commit is contained in:
parent
a345060ace
commit
4c94cfecfc
5 changed files with 31 additions and 7 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue