mirror of
https://github.com/monero-project/monero.git
synced 2025-08-01 20:56:10 -04:00
rct: add a zeroCommit cache for common pre-rct case
This is called for every pre-rct output at blockchain sync time, and a lot of them wil hit the cache, saving a scalarmult each.
This commit is contained in:
parent
963d247154
commit
5d7c231604
4 changed files with 211 additions and 0 deletions
|
@ -40,6 +40,7 @@ enum test_op
|
|||
op_sc_mul,
|
||||
op_ge_add_raw,
|
||||
op_ge_add_p3_p3,
|
||||
op_zeroCommitCached,
|
||||
ops_fast,
|
||||
|
||||
op_addKeys,
|
||||
|
@ -54,6 +55,7 @@ enum test_op
|
|||
op_addKeys3,
|
||||
op_addKeys3_2,
|
||||
op_isInMainSubgroup,
|
||||
op_zeroCommitUncached,
|
||||
};
|
||||
|
||||
template<test_op op>
|
||||
|
@ -108,6 +110,8 @@ public:
|
|||
case op_addKeys3: rct::addKeys3(key, scalar0, point0, scalar1, precomp1); break;
|
||||
case op_addKeys3_2: rct::addKeys3(key, scalar0, precomp0, scalar1, precomp1); break;
|
||||
case op_isInMainSubgroup: rct::isInMainSubgroup(point0); break;
|
||||
case op_zeroCommitUncached: rct::zeroCommit(9001); break;
|
||||
case op_zeroCommitCached: rct::zeroCommit(9000); break;
|
||||
default: return false;
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue