diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-11-05 14:23:00 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-11-05 14:25:11 +0000 |
commit | 00907c3987af00d6eb8ff7144a184a74906a8edf (patch) | |
tree | 948f4741ef24c04762c1043c210b3e0f9fe3e1c5 /src | |
parent | Merge pull request #4702 (diff) | |
download | monero-00907c3987af00d6eb8ff7144a184a74906a8edf.tar.xz |
rct: speedup commit a little
saves a conversion, and uses a double scalarmult instead of
two scalarmults
Diffstat (limited to 'src')
-rw-r--r-- | src/ringct/rctOps.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/ringct/rctOps.cpp b/src/ringct/rctOps.cpp index 41bbf6ca3..6c0588cf6 100644 --- a/src/ringct/rctOps.cpp +++ b/src/ringct/rctOps.cpp @@ -117,8 +117,7 @@ namespace rct { //generates C =aG + bH from b, a is given.. void genC(key & C, const key & a, xmr_amount amount) { - key bH = scalarmultH(d2h(amount)); - addKeys1(C, a, bH); + addKeys2(C, a, d2h(amount), rct::H); } //generates a <secret , public> / Pedersen commitment to the amount @@ -149,10 +148,8 @@ namespace rct { } key commit(xmr_amount amount, const key &mask) { - key c = scalarmultBase(mask); - key am = d2h(amount); - key bH = scalarmultH(am); - addKeys(c, c, bH); + key c; + genC(c, mask, amount); return c; } |