aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2018-06-20 14:51:31 -0500
committerluigi1111 <luigi1111w@gmail.com>2018-06-20 14:51:31 -0500
commit34c57d071fc78759414bb0a169d0ea25a84b1484 (patch)
tree833973d21f28e25a5d7be20ee42576f4da69d143 /src
parentMerge pull request #3933 (diff)
parentringct: remove an unnecessary scalarmultBase in zeroCommit (diff)
downloadmonero-34c57d071fc78759414bb0a169d0ea25a84b1484.tar.xz
Merge pull request #3938
01cc978 ringct: remove an unnecessary scalarmultBase in zeroCommit (moneromooo-monero)
Diffstat (limited to 'src')
-rw-r--r--src/ringct/rctOps.cpp5
-rw-r--r--src/ringct/rctOps.h1
2 files changed, 2 insertions, 4 deletions
diff --git a/src/ringct/rctOps.cpp b/src/ringct/rctOps.cpp
index cc46d0aa7..68cc43128 100644
--- a/src/ringct/rctOps.cpp
+++ b/src/ringct/rctOps.cpp
@@ -134,12 +134,9 @@ namespace rct {
}
key zeroCommit(xmr_amount amount) {
- key mask = identity();
- mask = scalarmultBase(mask);
key am = d2h(amount);
key bH = scalarmultH(am);
- addKeys(mask, mask, bH);
- return mask;
+ return addKeys(G, bH);
}
key commit(xmr_amount amount, const key &mask) {
diff --git a/src/ringct/rctOps.h b/src/ringct/rctOps.h
index 3f8f6955c..f8889af5c 100644
--- a/src/ringct/rctOps.h
+++ b/src/ringct/rctOps.h
@@ -62,6 +62,7 @@ namespace rct {
static const key Z = { {0x00, 0x00, 0x00,0x00 , 0x00, 0x00, 0x00,0x00 , 0x00, 0x00, 0x00,0x00 , 0x00, 0x00, 0x00,0x00 , 0x00, 0x00, 0x00,0x00 , 0x00, 0x00, 0x00,0x00 , 0x00, 0x00, 0x00,0x00 , 0x00, 0x00, 0x00,0x00 } };
static const key I = { {0x01, 0x00, 0x00,0x00 , 0x00, 0x00, 0x00,0x00 , 0x00, 0x00, 0x00,0x00 , 0x00, 0x00, 0x00,0x00 , 0x00, 0x00, 0x00,0x00 , 0x00, 0x00, 0x00,0x00 , 0x00, 0x00, 0x00,0x00 , 0x00, 0x00, 0x00,0x00 } };
static const key L = { {0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10 } };
+ static const key G = { {0x58, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66 } };
//Creates a zero scalar
inline key zero() { return Z; }