aboutsummaryrefslogtreecommitdiff
path: root/tests/unit_tests/ringct.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit_tests/ringct.cpp')
-rw-r--r--tests/unit_tests/ringct.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/unit_tests/ringct.cpp b/tests/unit_tests/ringct.cpp
index 6e3958f8a..3877ef785 100644
--- a/tests/unit_tests/ringct.cpp
+++ b/tests/unit_tests/ringct.cpp
@@ -1085,3 +1085,34 @@ TEST(ringct, zeroCommmit)
const rct::key manual = rct::addKeys(a, b);
ASSERT_EQ(z, manual);
}
+
+TEST(ringct, H)
+{
+ ge_p3 p3;
+ ASSERT_EQ(ge_frombytes_vartime(&p3, rct::H.bytes), 0);
+ ASSERT_EQ(memcmp(&p3, &ge_p3_H, sizeof(ge_p3)), 0);
+}
+
+TEST(ringct, mul8)
+{
+ ASSERT_EQ(rct::scalarmult8(rct::identity()), rct::identity());
+ ASSERT_EQ(rct::scalarmult8(rct::H), rct::scalarmultKey(rct::H, rct::EIGHT));
+ ASSERT_EQ(rct::scalarmultKey(rct::scalarmultKey(rct::H, rct::INV_EIGHT), rct::EIGHT), rct::H);
+}
+
+TEST(ringct, aggregated)
+{
+ static const size_t N_PROOFS = 16;
+ std::vector<rctSig> s(N_PROOFS);
+ std::vector<const rctSig*> sp(N_PROOFS);
+
+ for (size_t n = 0; n < N_PROOFS; ++n)
+ {
+ static const uint64_t inputs[] = {1000, 1000};
+ static const uint64_t outputs[] = {500, 1500};
+ s[n] = make_sample_simple_rct_sig(NELTS(inputs), inputs, NELTS(outputs), outputs, 0);
+ sp[n] = &s[n];
+ }
+
+ ASSERT_TRUE(verRctSemanticsSimple(sp));
+}