aboutsummaryrefslogtreecommitdiff
path: root/tests/unit_tests/ringct.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-06-06 10:05:14 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-06-06 10:14:36 +0100
commit01cc9787225fb3ac810f25228eb0547516caedc8 (patch)
tree042e53372e04aefa5469033a5118f12311f57d43 /tests/unit_tests/ringct.cpp
parentMerge pull request #3866 (diff)
downloadmonero-01cc9787225fb3ac810f25228eb0547516caedc8.tar.xz
ringct: remove an unnecessary scalarmultBase in zeroCommit
Diffstat (limited to 'tests/unit_tests/ringct.cpp')
-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);
+}