aboutsummaryrefslogtreecommitdiff
path: root/src/ringct/rctSigs.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2018-09-21 20:42:41 +0200
committerRiccardo Spagni <ric@spagni.net>2018-09-21 20:42:41 +0200
commit4a652d6b52c60d169a0ccdc537afa5353c206b7c (patch)
treeecbf9038109f3f8d852078deff572d25936dffc8 /src/ringct/rctSigs.cpp
parentMerge pull request #4378 (diff)
parentrct: avoid repeated unnecessary conversions when accummulating (diff)
downloadmonero-4a652d6b52c60d169a0ccdc537afa5353c206b7c.tar.xz
Merge pull request #4379
607301bf rct: avoid repeated unnecessary conversions when accummulating (moneromooo-monero)
Diffstat (limited to 'src/ringct/rctSigs.cpp')
-rw-r--r--src/ringct/rctSigs.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/ringct/rctSigs.cpp b/src/ringct/rctSigs.cpp
index fe0cd9c57..0d1789a38 100644
--- a/src/ringct/rctSigs.cpp
+++ b/src/ringct/rctSigs.cpp
@@ -963,18 +963,16 @@ namespace rct {
const bool bulletproof = is_rct_bulletproof(rv.type);
const keyV &pseudoOuts = bulletproof ? rv.p.pseudoOuts : rv.pseudoOuts;
- key sumOutpks = identity();
+ rct::keyV masks(rv.outPk.size());
for (size_t i = 0; i < rv.outPk.size(); i++) {
- addKeys(sumOutpks, sumOutpks, rv.outPk[i].mask);
+ masks[i] = rv.outPk[i].mask;
}
+ key sumOutpks = addKeys(masks);
DP(sumOutpks);
- key txnFeeKey = scalarmultH(d2h(rv.txnFee));
+ const key txnFeeKey = scalarmultH(d2h(rv.txnFee));
addKeys(sumOutpks, txnFeeKey, sumOutpks);
- key sumPseudoOuts = identity();
- for (size_t i = 0 ; i < pseudoOuts.size() ; i++) {
- addKeys(sumPseudoOuts, sumPseudoOuts, pseudoOuts[i]);
- }
+ key sumPseudoOuts = addKeys(pseudoOuts);
DP(sumPseudoOuts);
//check pseudoOuts vs Outs..