aboutsummaryrefslogtreecommitdiff
path: root/tests/unit_tests
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 /tests/unit_tests
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 'tests/unit_tests')
-rw-r--r--tests/unit_tests/ringct.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/unit_tests/ringct.cpp b/tests/unit_tests/ringct.cpp
index b7fcbbcab..0f4bd3edf 100644
--- a/tests/unit_tests/ringct.cpp
+++ b/tests/unit_tests/ringct.cpp
@@ -1061,3 +1061,13 @@ TEST(ringct, key_ostream)
out.str()
);
}
+
+TEST(ringct, zeroCommmit)
+{
+ static const uint64_t amount = crypto::rand<uint64_t>();
+ const rct::key z = rct::zeroCommit(amount);
+ const rct::key a = rct::scalarmultBase(rct::identity());
+ const rct::key b = rct::scalarmultH(rct::d2h(amount));
+ const rct::key manual = rct::addKeys(a, b);
+ ASSERT_EQ(z, manual);
+}