aboutsummaryrefslogtreecommitdiff
path: root/tests/unit_tests
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-01-03 21:37:18 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-09-11 13:37:17 +0000
commitaacfd6e3702810c43365658da61bb1afc7470fd5 (patch)
treec33a41a4db2b2f9584bb4a81d8432e23a7d55a8e /tests/unit_tests
parentperformance_tests: don't override log level to 0 (diff)
downloadmonero-aacfd6e3702810c43365658da61bb1afc7470fd5.tar.xz
bulletproofs: multi-output bulletproofs
Diffstat (limited to '')
-rw-r--r--tests/unit_tests/bulletproofs.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/unit_tests/bulletproofs.cpp b/tests/unit_tests/bulletproofs.cpp
index 00595a4c7..d3b804530 100644
--- a/tests/unit_tests/bulletproofs.cpp
+++ b/tests/unit_tests/bulletproofs.cpp
@@ -32,6 +32,7 @@
#include "ringct/rctOps.h"
#include "ringct/bulletproofs.h"
+#include "misc_log_ex.h"
TEST(bulletproofs, valid_zero)
{
@@ -54,6 +55,24 @@ TEST(bulletproofs, valid_random)
}
}
+TEST(bulletproofs, valid_multi_random)
+{
+ for (int n = 0; n < 8; ++n)
+ {
+ size_t outputs = 2 + n;
+ std::vector<uint64_t> amounts;
+ rct::keyV gamma;
+ for (size_t i = 0; i < outputs; ++i)
+ {
+ amounts.push_back(crypto::rand<uint64_t>());
+ gamma.push_back(rct::skGen());
+ }
+ rct::Bulletproof proof = bulletproof_PROVE(amounts, gamma);
+ ASSERT_TRUE(rct::bulletproof_VERIFY(proof));
+ }
+}
+
+
TEST(bulletproofs, invalid_8)
{
rct::key invalid_amount = rct::zero();