From aacfd6e3702810c43365658da61bb1afc7470fd5 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Wed, 3 Jan 2018 21:37:18 +0000 Subject: bulletproofs: multi-output bulletproofs --- tests/unit_tests/bulletproofs.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests') 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 amounts; + rct::keyV gamma; + for (size_t i = 0; i < outputs; ++i) + { + amounts.push_back(crypto::rand()); + 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(); -- cgit v1.2.3