aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-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();